-
Notifications
You must be signed in to change notification settings - Fork 22
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 steps for shadow roots and slots #167
Changes from 12 commits
cf152ed
3007834
852dd64
8020dce
37d4048
fd225a3
afd6ea5
95782ce
442df9a
8d17a28
51c6b09
f33d45d
ecf6cb4
9a625c8
a9cfa2e
84a03a5
1d37077
493b13b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -272,6 +272,8 @@ <h4>Terminology</h4> | |||||||
<dd>The <abbr title="Document Object Model">DOM</abbr> [=nodes|node=] or [=element=] for which the text alternative is sought.</dd> | ||||||||
<dt>Current node</dt> | ||||||||
<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> | ||||||||
<dt>Rendered child nodes</dt> | ||||||||
<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> | ||||||||
<dt>Flat string</dt> | ||||||||
<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> | ||||||||
<dt>Total accumulated text</dt> | ||||||||
|
@@ -437,14 +439,21 @@ <h4>Computation steps</h4> | |||||||
<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> | ||||||||
</ol> | ||||||||
</li> | ||||||||
<li id="comp_name_from_content_for_each_child" name="step2F.iii"><em>Name From Each Child:</em> For each child node of the <code>current node</code>: | ||||||||
<li id="comp_name_from_content_find_child" name="step2F.iii"><em>Determine Child Nodes:</em> Determine the <code>rendered child nodes</code> of the <code>current node</code>: | ||||||||
<ol> | ||||||||
<li id="comp_name_from_content_for_each_child_set_current" name="step2F.iii.a">Set the <code>current node</code> to the child node.</li> | ||||||||
<li id="comp_name_from_content_for_each_child_recursion" name="step2F.iii.b">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> | ||||||||
<li id="comp_for_each_child_append" name="step2F.iii.c">Append the <code>result</code> to the <code>accumulated text</code>. </li> | ||||||||
<li id="comp_name_from_content_find_child_has_shadow_root" name="step2F.iii.a">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> | ||||||||
<li id="comp_name_from_content_find_child_is_slot" name="step2F.iii.b">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> | ||||||||
<li id="comp_name_from_content_find_child_otherwise" name="step2F.iii.c">Otherwise, set the <code>rendered child nodes</code> to be the child nodes of the <code>current node</code>.</li> | ||||||||
</ol> | ||||||||
</li> | ||||||||
<li id="comp_name_from_content_return" name="step2F.iv">Return the <code>accumulated text</code> if it is not the empty string ("").</li> | ||||||||
<li id="comp_name_from_content_for_each_child" name="step2F.iv"><em>Name From Each Child:</em> For each <code>rendered child node</code> of the <code>current node</code>: | ||||||||
<ol> | ||||||||
<li id="comp_name_from_content_for_each_child_set_current" name="step2F.iv.a">Set the <code>current node</code> to the <code>rendered child node</code>.</li> | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Perhaps we should even add comments like above so this is less likely to happen in the future There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good. I did add a comment just to be safe: Line 442 in a9cfa2e
|
||||||||
<li id="comp_name_from_content_for_each_child_recursion" name="step2F.iv.b">Compute the text alternative of the <code>current node</code> beginning with step 2. Set the <code>result</code> to that text alternative.</li> | ||||||||
<li id="comp_for_each_child_append" name="step2F.iv.c">Append the <code>result</code> to the <code>accumulated text</code>. </li> | ||||||||
</ol> | ||||||||
</li> | ||||||||
<li id="comp_name_from_content_return" name="step2F.v">Return the <code>accumulated text</code> if it is not the empty string ("").</li> | ||||||||
</ol> | ||||||||
<p><strong>Important</strong>: Each [=nodes|node=] in the subtree is consulted only once. If text has been collected from a descendant, but is referenced by another IDREF in some descendant node, then that second, or subsequent, reference is not followed. This is done to avoid infinite loops. </p> | ||||||||
<div><details> | ||||||||
|
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.
Repurposing the "step2F.iii.a" here breaks the old permalinks. We kept those so that legacy deep links in would not break, but the legacy
name
value should stay with the original reference (comp_name_from_content_for_each_child_set_current) and no new numberedname
values should be added.New permalinks should used uniquely names
id
values only.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 problem. I changed it so that:
name
comp_name_from_content_for_each_child
) has the samename
as beforeGitHub doesn't do a great job with the diff, but permalinks should not be broken anymore.