-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add flat tree parent definition #1223
base: main
Are you sure you want to change the base?
Conversation
This can be used in the HTML spec as suggested in this issue: whatwg/html#8970
<li><p>If <var>node</var>'s <a for=slottable>assigned slot</a> is null, then return null.</p></li> | ||
|
||
<li><p>Return <var>node</var>'s <a for=slottable>assigned slot</a>'s <a | ||
for=tree>parent</a>.</p></li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mfreed7 do I need to run anything recursive in the last step here? I briefly tried to make a demo with a slot assigned into another slot, but it didn't seem to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I at least need to check if the parent is a shadow host, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was hoping this definition could mostly stay in CSS and in DOM we could use the composed tree (which we use for events).
Perhaps having both concepts in DOM is useful, but early on we were fairly deliberate on the split and I feel like we lost some of the knowledge as to why we did things that way.
for=DocumentFragment>host</a>.</p></li> | ||
|
||
<li><p>If <var>parent</var> is not a <a for=Element>shadow host</a>, then return | ||
<var>node</var>.</p></li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You want to return parent here, presumably.
<ol> | ||
<li><p>Let <var>parent</var> be <var>node</var>'s <a for=tree>parent</a>.</p></li> | ||
|
||
<li><p>If <var>parent</var> is a <a for=/>shadow root</a>, then return <var>parent</var>'s <a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No wrapping in phrasing elements.
@@ -5956,6 +5956,23 @@ is an object or one of its <a>shadow-including ancestors</a>. | |||
<p class=note>The <a>retargeting</a> algorithm is used by <a lt=dispatch>event dispatch</a> as well | |||
as other specifications, such as <cite>Fullscreen</cite>. [[FULLSCREEN]] | |||
|
|||
<p>To get the <dfn export>flat tree parent</dfn> of a <var>node</var>:</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about children of a slot element?
This can be used in the HTML spec as suggested in this issue: whatwg/html#8970
(See WHATWG Working Mode: Changes for more details.)
Preview | Diff