Skip to content

Commit 67ca225

Browse files
nolanlawsoncookiecrookjnurthen
authored
Add steps for shadow roots and slots (#167)
Co-authored-by: James Craig <[email protected]> Co-authored-by: James Nurthen <[email protected]>
1 parent 0dcd545 commit 67ca225

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

index.html

+12-2
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,8 @@ <h4>Terminology</h4>
334334
<dd>The <abbr title="Document Object Model">DOM</abbr> [=nodes|node=] or [=element=] for which the text alternative is sought.</dd>
335335
<dt>Current node</dt>
336336
<dd>The <abbr title="Document Object Model">DOM</abbr> [=nodes|node=] currently traversed to compute the <code>root node</code>'s text equivalent. Initially, the <code>current node</code> is the <code>root node</code>, but at later stages is either some descendant of the <code>root node</code>, or another referenced node.</dd>
337+
<dt>Rendered child nodes</dt>
338+
<dd>The [=nodes=] that are rendered as child nodes of a given node when taking [=shadow root|shadow roots=] and [=slot|slots=] into consideration.</dd>
337339
<dt>Flat string</dt>
338340
<dd>A string of characters where all carriage returns, newlines, tabs, and form-feeds are replaced with a single space, and multiple spaces are reduced to a single space. The string contains only character data; it does not contain any markup. </dd>
339341
<dt>Total accumulated text</dt>
@@ -496,9 +498,17 @@ <h4>Computation steps</h4>
496498
<li id="comp_name_from_content_pseudo_element_after">For <code>::after</code> pseudo elements, <a class="termref">User agents</a> MUST append <abbr title="Cascading Style Sheets">CSS</abbr> textual content, without a space, to the textual content of the <code>current node</code>. </li>
497499
</ol>
498500
</li>
499-
<li id="comp_name_from_content_for_each_child"><span id="step2F.iii"><!-- Don't link to this legacy numbered ID. --></span><em>Name From Each Child:</em> For each child node of the <code>current node</code>:
501+
<!-- The following section uses its own convention for the name attribute to avoid breaking existing permalinks for other sections-->
502+
<li id="comp_name_from_content_find_child"><em>Determine Child Nodes:</em> Determine the <code>rendered child nodes</code> of the <code>current node</code>:
500503
<ol>
501-
<li id="comp_name_from_content_for_each_child_set_current"><span id="step2F.iii.a"><!-- Don't link to this legacy numbered ID. --></span>Set the <code>current node</code> to the child node.</li>
504+
<li id="comp_name_from_content_find_child_has_shadow_root">If the <code>current node</code> has an attached [=shadow root=], set the <code>rendered child nodes</code> to be the child nodes of the [=shadow root=].</li>
505+
<li id="comp_name_from_content_find_child_is_slot">Otherwise, if the <code>current node</code> is a [=slot=] with [=slot/assigned nodes=], set the <code>rendered child nodes</code> to be the [=slot/assigned nodes=] of the <code>current node</code>.</li>
506+
<li id="comp_name_from_content_find_child_otherwise">Otherwise, set the <code>rendered child nodes</code> to be the child nodes of the <code>current node</code>.</li>
507+
</ol>
508+
</li>
509+
<li id="comp_name_from_content_for_each_child"><span id="step2F.iii"><!-- Don't link to this legacy numbered ID. --></span><em>Name From Each Child:</em> For each <code>rendered child node</code> of the <code>current node</code>:
510+
<ol>
511+
<li id="comp_name_from_content_for_each_child_set_current"><span id="step2F.iii.a"><!-- Don't link to this legacy numbered ID. --></span>Set the <code>current node</code> to the <code>rendered child node</code>.</li>
502512
<li id="comp_name_from_content_for_each_child_recursion"><span id="step2F.iii.b"><!-- Don't link to this legacy numbered ID. --></span>Compute the text alternative of the <code>current node</code> beginning with the overall <a href="#comp_computation">Computation</a> step. Set the <code>result</code> to that text alternative.</li>
503513
<li id="comp_for_each_child_append"><span id="step2F.iii.c"><!-- Don't link to this legacy numbered ID. --></span>Append the <code>result</code> to the <code>accumulated text</code>. </li>
504514
</ol>

0 commit comments

Comments
 (0)