[cssom-view] Fix #159 update offsetParent spec for Shadow DOM - #252
Conversation
|
@zcorpan @tabatkins @hayatoito Could you take a look? |
| * It is <a>the HTML <code>body</code> element</a>. | ||
| * 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>. | ||
| 1. Return null. | ||
| 1. Let <var>ancestor</var> be the element and repeat these substeps: |
There was a problem hiding this comment.
ancestor should be the parent of the element here.
b3a734c to
1a55e1c
Compare
| 1. Return null. | ||
| 1. Let <var>ancestor</var> be the parent of the element and repeat these substeps: | ||
| 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. | ||
| 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 is true, terminate this algorithm and return <var>ancestor</var>. |
|
LGTM % wording nit |
1a55e1c to
2341bdc
Compare
|
@tabatkins could you take a look? |
|
@tabatkins Ping? |
1 similar comment
|
@tabatkins Ping? |
|
@tabatkins Had a nice vacation ;) ? |
|
Hmm, this reads a little weird to me. I'm not certain the first condition can ever be hit - we're walking the ancestor chain of the element, and I think an element's ancestors are always unclosed relative to it. |
|
No, it happens when an element is slotted into a closed shadow tree. <div id="shadow" style="position: relative">
#shadow-root (closed)
<div id="container" style="position: relative">
<slot></slot>
</div>
<div id="X">Hello</div>
</div>
Hmm, I should have used "the parent of the element in the flat tree" for all "the parent of ~" |
2341bdc to
0c972e7
Compare
|
@tabatkins Could you take another look? |
| * It is <a>the HTML <code>body</code> element</a>. | ||
| * 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>. | ||
| 1. Return null. | ||
| 1. Let <var>ancestor</var> be the parent of the element in the flat tree and repeat these substeps: |
|
Okay, final nit, then +1 from me. |
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.
0c972e7 to
5589932
Compare
|
Done. Thanks for the review! |
|
@zcorpan could you merge this? |
|
Thank you! |
The previous attempt to update offsetParent to fix #159 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.