Add steps for shadow roots and slots (#167) · w3c/accname@67ca225 (original) (raw)

`@@ -334,6 +334,8 @@

Terminology

`

334

334

`

The DOM [=nodes|node=] or [=element=] for which the text alternative is sought.

`

335

335

`

Current node

`

336

336

`

The DOM [=nodes|node=] currently traversed to compute the root node's text equivalent. Initially, the current node is the root node, but at later stages is either some descendant of the root node, or another referenced node.

`

``

337

`+

Rendered child nodes

`

``

338

`+

The [=nodes=] that are rendered as child nodes of a given node when taking [=shadow root|shadow roots=] and [=slot|slots=] into consideration.

`

337

339

`

Flat string

`

338

340

`

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.

`

339

341

`

Total accumulated text

`

`@@ -496,9 +498,17 @@

Computation steps

`

496

498

`

  • For ::after pseudo elements, User agents MUST append CSS textual content, without a space, to the textual content of the current node.
  • `

    497

    499

    `

    `

    498

    500

    `

    `

    499

    ``

    `-

  • Name From Each Child: For each child node of the current node:

    `

    ``

    501

    `+

    `

    ``

    502

    `+

  • Determine Child Nodes: Determine the rendered child nodes of the current node:

    `

    500

    503

    `

      `

      501

      ``

      `-

    1. Set the current node to the child node.
    2. `

      ``

      504

      `+

    3. If the current node has an attached [=shadow root=], set the rendered child nodes to be the child nodes of the [=shadow root=].
    4. `

      ``

      505

      `+

    5. Otherwise, if the current node is a [=slot=] with [=slot/assigned nodes=], set the rendered child nodes to be the [=slot/assigned nodes=] of the current node.
    6. `

      ``

      506

      `+

    7. Otherwise, set the rendered child nodes to be the child nodes of the current node.
    8. `

      ``

      507

      `+

    `

    ``

    508

    `+

  • `

    ``

    509

    `+

  • Name From Each Child: For each rendered child node of the current node:

    `

    ``

    510

    `+

      `

      ``

      511

      `+

    1. Set the current node to the rendered child node.
    2. `

      502

      512

      `

    3. Compute the text alternative of the current node beginning with the overall Computation step. Set the result to that text alternative.
    4. `

      503

      513

      `

    5. Append the result to the accumulated text.
    6. `

      504

      514

      `

    `