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

Conversation

josepharhar
Copy link
Contributor

@josepharhar josepharhar commented Sep 4, 2023

This can be used in the HTML spec as suggested in this issue: whatwg/html#8970

  • At least two implementers are interested (and none opposed):
  • Tests are written and can be reviewed and commented upon at:
  • Implementation bugs are filed:
    • Chromium: …
    • Gecko: …
    • WebKit: …
    • Deno (only for aborting and events): …
    • Node.js (only for aborting and events): …
  • MDN issue is filed: …

(See WHATWG Working Mode: Changes for more details.)


Preview | Diff

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>
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?

Copy link
Member

@annevk annevk left a 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.

cc @rniwa @hayatoito @domenic @smaug----

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.

<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.

@@ -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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants