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

Give ElementInternals element-reflecting attributes more power #8932

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
40 changes: 28 additions & 12 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -8147,10 +8147,22 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
null:</p>

<ul>
<li><p>If <var>reflectedTarget</var>'s <span>explicitly set <var>attr</var>-element</span> is
a <span>descendant</span> of any of <var>element</var>'s <span
data-x="concept-shadow-including-ancestor">shadow-including ancestors</span>, then return
<var>reflectedTarget</var>'s <span>explicitly set <var>attr</var>-element</span>.</p></li>
<li>
<p>If one of the following is true:

<ul class="brief">
<li><var>reflectedTarget</var> is an <code>ElementInternals</code> object and
<var>reflectedTarget</var>'s <span>explicitly set <var>attr</var>-element</span>'s
<span>shadow-including root</span> is <var>element</var>'s <span>shadow-including
root</span></li>
<li><var>reflectedTarget</var>'s <span>explicitly set <var>attr</var>-element</span> is a
<span>descendant</span> of any of <var>element</var>'s <span
data-x="concept-shadow-including-ancestor">shadow-including ancestors</span></li>
</ul>

<p>then return <var>reflectedTarget</var>'s <span>explicitly set
<var>attr</var>-element</span>.</p>
</li>

<li><p>Return null.</p></li>
</ul>
Expand Down Expand Up @@ -8257,16 +8269,20 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
<ol>
<li>
<p><span data-x="list iterate">For each</span> <var>attrElement</var> in
<var>reflectedTarget</var>'s <span>explicitly set <var>attr</var>-elements</span>:</p>
<var>reflectedTarget</var>'s <span>explicitly set <var>attr</var>-elements</span>: if one of
the following is true:

<ol>
<li><p>If <var>attrElement</var> is not a <span>descendant</span> of any of
<var>element</var>'s <span data-x="concept-shadow-including-ancestor">shadow-including
ancestors</span>, then <span>continue</span>.</p></li>
<ul class="brief">
<li><var>reflectedTarget</var> is an <code>ElementInternals</code> object and
<var>attrElement</var>'s <span>shadow-including root</span> is <var>element</var>'s
<span>shadow-including root</span></li>

<li><p><span data-x="list append">Append</span> <var>attrElement</var> to
<var>elements</var>.</p></li>
</ol>
<li><var>attrElement</var> is a <span>descendant</span> of any of <var>element</var>'s
<span data-x="concept-shadow-including-ancestor">shadow-including ancestors</span></li>
</ul>

<p>then <span data-x="list append">append</span> <var>attrElement</var> to
<var>elements</var>.</p>
</li>
</ol>
</li>
Expand Down