diff --git a/spec/shadow/autolink-config.js b/spec/shadow/autolink-config.js index d5141338..9d216106 100644 --- a/spec/shadow/autolink-config.js +++ b/spec/shadow/autolink-config.js @@ -47,6 +47,7 @@ var autolinkConfig = { 'shadow tree': '#concept-shadow-tree', 'shadow-including descendant': '#concept-shadow-including-descendant', 'shadow-including root': '#concept-shadow-including-root', + 'shadow-including tree order': '#shadow-including-tree-order', 'static': '#concept-collection-static', 'stop propagation flag': '#stop-propagation-flag', 'target': '#dom-event-target', @@ -75,6 +76,7 @@ var autolinkConfig = { 'fallback content': '#fallback-content', 'fieldset element': '#the-fieldset-element', 'flow content': '#flow-content', + 'focusable area': '#focusable-area', 'focusable': '#focusable-area', 'form element': '#the-form-element', 'form submission': '#form-submission', @@ -94,7 +96,6 @@ var autolinkConfig = { 'reflect': '#reflect', 'root element of a document object': '#root-element-of-a-document-object', 'sequential focus navigation': '#sequential-focus-navigation', - 'sequential focus navigation order': '#sequential-focus-navigation-order', 'style': '#the-style-attribute', 'tabindex': '#attr-tabindex', 'textarea element': '#the-textarea-element', diff --git a/spec/shadow/index.html b/spec/shadow/index.html index 54857894..9b1d5f7a 100644 --- a/spec/shadow/index.html +++ b/spec/shadow/index.html @@ -1117,21 +1117,150 @@

Ranges and Selections

-

Focus Navigation

+

Sequential Focus Navigation

-

If a node doesn’t participate in the document flat tree, the node must be skipped from the sequential focus navigation.

+

focus navigation scope is a set of elements in a shadow-including document. An element belongs to at most one focus navigation scope.

-

The sequential focus navigation order for a given shadow tree A must be inserted into the sequential focus navigation order for the parent tree B as follows:

-
    -
  1. Let HOST be the shadow host which hosts A
  2. -
  3. - The sequential focus navigation order for A must be inserted into the sequential focus navigation order for B: -
      -
    1. immediately after HOST, if HOST is focusable; or
    2. -
    3. in place of the HOST as if HOST were assigned the tabindex value 0 for determining its position.
    4. -
    -
  4. -
+

focus navigation scope owner is a node that owns a focus navigation scope. A document, a shadow root, or a slot element can be a focus navigation scope owner.

+ +

document sequential focus navigation order is an order of all of the focusable areas in a shadow-including document, reachable by sequential focus navigation.

+ +

When a shadow-including document is given, the document sequential focus navigation order is determined by the following steps:

+ +

Step 1.

+
+
+
INPUT
+
DOCUMENT, a composed document
+
OUTPUT
+
OWNERS, a set of focus navigation scope owner nodes
+
+
    +
  1. Let OWNERS be an empty set.
  2. +
  3. For each node tree TREE in DOCUMENT: +
      +
    1. For each node NODE in TREE, in tree order: +
        +
      1. If NODE is a document, a shadow root, or a slot element, append it to OWNERS.
      2. +
      +
    2. +
    +
  4. +
+
+ +

Step 2.

+
+
+
INPUT
+
DOCUMENT, a composed document
+
OWNERS, a set of focus navigation scope owner nodes from Step 1
+
OUTPUT
+
SCOPEs, a set of focus navigation scopes each of which is an ordered list of elements
+
SCOPE-MAP, a map from each focus navigation scope owner to its corresponding focus navigation scope +
+
    +
  1. For each owner OWNER in OWNERS: +
      +
    1. Let SCOPE be empty list.
    2. +
    3. Append SCOPE to SCOPE-MAP[OWNER].
    4. +
    +
  2. +
  3. For each node tree TREE in DOCUMENT, in shadow-including tree order: +
      +
    1. For each ELEMENT in TREE: +
        +
      1. Let CURRENT be ELEMENT.
      2. +
      3. Repeat the following steps until the algorithm stops.
      4. +
      5. If CURRENT is a child of a shadow host: +
          +
        1. If CURRENT is assigned to any slot SLOT, append ELEMENT to SCOPE-MAP[SLOT].
        2. +
        3. Otherwise do not append ELEMENT to any scope.
        4. +
        5. Stop this algorithm.
        6. +
        +
      6. +
      7. If CURRENT is a slot element and not equal to ELEMENT: +
          +
        1. If CURRENT has any assigned nodes, do not append ELEMENT to any scope.
        2. +
        3. Otherwise append ELEMENT to SCOPE-MAP[CURRENT].
        4. +
        5. Stop this algorithm.
        6. +
        +
      8. +
      9. If CURRENT is a child of a root node (a shadow root or document) ROOT: +
          +
        1. Append ELEMENT to SCOPE-MAP[ROOT].
        2. +
        3. Stop this algorithm.
        4. +
        +
      10. Otherwise: +
          +
        1. Set CURRENT to the parent element of CURRENT.
        2. +
        +
      11. + +
      +
    2. +
    +
  4. +
+
+ +

Step 3.

+
+
+
INPUT
+
SCOPE, a focus navigation scope
+
OUTPUT
+
NAVIGATION-ORDER, an ordered list of elements which should be visited.
+
+
    +
  1. For each scope SCOPE: +
      +
    1. Let NAVIGATION-ORDER be an empty list.
    2. +
    3. For each element ELEMENT in a focus navigation scope SCOPE, +
        +
      1. if ELEMENT is focusable, a shadow host, or a slot element, append ELEMENT to NAVIGATION-ORDER.
      2. +
      +
    4. Reorder NAVIGATION-ORDER according to the tabindex value attached to each node. In this step, an element whose tabindex value is negative must not be appended to NAVIGATION-ORDER.
    5. +
    +
  2. +
+
+ +

Step 4.

+

Apply the following focus navigation order merging algorithm with document’s focus navigation order as input. The result is the document sequential focus navigation order.

+ +
+
+
INPUT
+
NAVIGATION-ORDER, an ordered list of elements.
+
OUTPUT
+
MERGED-NAVIGATION-ORDER, an ordered list of elements.
+
+
    +
  1. Let MERGED-NAVIGATION-ORDER be an empty list.
  2. +
  3. For each element ELEMENT in NAVIGATION-ORDER: +
      +
    1. If ELEMENT is a shadow host: +
        +
      1. Unless its shadow root’s delegatesFocus flag is set, append ELEMENT to MERGED-NAVIGATION-ORDER.
      2. +
      3. Apply the focus navigation order merging algorithm with the focus navigation order owned by its shadow root as input, then append the result to MERGED-NAVIGATION-ORDER.
      4. +
      +
    2. +
    3. If ELEMENT is a slot element: +
        +
      1. Apply the focus navigation order merging algorithm with the focus navigation order owned by the slot element as input, then append the result to MERGED-NAVIGATION-ORDER.
      2. +
      +
    4. +
    5. Otherwise: +
        +
      1. Append ELEMENT to MERGED-NAVIGATION-ORDER.
      2. +
      +
    6. +
    7. Return MERGED-NAVIGATION-ORDER.
    8. +
    +
  4. +
+

For directional focus navigation [[!CSS3-UI]], it is up to the user agent to integrate the shadow trees into the document's directional focus navigation.