Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Copy link
Member

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?


<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
Copy link
Member

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.

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>
Copy link
Member

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.


<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>
Copy link
Contributor Author

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.

Copy link
Contributor Author

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?

</ol>


<h3 id=interface-element>Interface {{Element}}</h3>

Expand Down