Skip to content

Commit 9386def

Browse files
Takayoshi Kochizcorpan
authored andcommitted
[cssom-view] Update offsetParent spec for Shadow DOM
The previous attempt to update offsetParent was incomplete: when the real offsetParent in the closed shadow tree has 'position:fixed', offsetParent should return null, instead of continue searching for unclosed ancestor. PR: w3c#252 Fixes w3c#159.
1 parent e2f369b commit 9386def

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

cssom-view/Overview.bs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,11 +1352,14 @@ The <dfn attribute for=HTMLElement>offsetParent</dfn> attribute must return the
13521352
* The element is the root element.
13531353
* The element is <a>the HTML <code>body</code> element</a>.
13541354
* The element's computed value of the 'position' property is ''position/fixed''.
1355-
1. Return the nearest ancestor <a lt="unclosed node">unclosed</a> element of the element for which at least one of the following is true and terminate this algorithm if such an ancestor is found: [[!DOM]]
1356-
* The computed value of the 'position' property is not ''static''.
1357-
* It is <a>the HTML <code>body</code> element</a>.
1358-
* The computed value of the 'position' property of the element is ''static'' and the ancestor is one of the following <a>HTML elements</a>: <code>td</code>, <code>th</code>, or <code>table</code>.
1359-
1. Return null.
1355+
1. Let <var>ancestor</var> be the parent of the element in the <a>flat tree</a> and repeat these substeps:
1356+
1. If <var>ancestor</var> is not an <a lt="unclosed node">unclosed</a> element of the element and its computed value of the 'position' property is ''position/fixed'', terminate this algorithm and return null.
1357+
1. If <var>ancestor</var> is an <a lt="unclosed node">unclosed</a> element of the element and satisfies at least one of the following, terminate this algorithm and return <var>ancestor</var>.
1358+
* The computed value of the 'position' property is not ''static''.
1359+
* It is <a>the HTML <code>body</code> element</a>.
1360+
* The computed value of the 'position' property of the element is ''static'' and the ancestor is one of the following <a>HTML elements</a>: <code>td</code>, <code>th</code>, or <code>table</code>.
1361+
1. If there is no more parent of <var>ancestor</var> in the <a>flat tree</a>, terminate this algorithm and return null.
1362+
1. Let <var>ancestor</var> be the parent of <var>ancestor</var> in the <a>flat tree</a>.
13601363

13611364
The <dfn attribute for=HTMLElement>offsetTop</dfn> attribute must return the result of running these steps:
13621365

0 commit comments

Comments
 (0)