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:
-
- - Let HOST be the shadow host which hosts A
- -
- The sequential focus navigation order for A must be inserted into the sequential focus navigation order for B:
-
- - immediately after HOST, if HOST is focusable; or
- - in place of the HOST as if HOST were assigned the tabindex value 0 for determining its position.
-
-
-
+ 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
+
+
+ - Let OWNERS be an empty set.
+ - For each node tree TREE in DOCUMENT:
+
+ - For each node NODE in TREE, in tree order:
+
+ - If NODE is a document, a shadow root, or a slot element, append it to OWNERS.
+
+
+
+
+
+
+
+ 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
+
+
+ - For each owner OWNER in OWNERS:
+
+ - Let SCOPE be empty list.
+ - Append SCOPE to SCOPE-MAP[OWNER].
+
+
+ - For each node tree TREE in DOCUMENT, in shadow-including tree order:
+
+ - For each ELEMENT in TREE:
+
+ - Let CURRENT be ELEMENT.
+ - Repeat the following steps until the algorithm stops.
+ - If CURRENT is a child of a shadow host:
+
+ - If CURRENT is assigned to any slot SLOT, append ELEMENT to SCOPE-MAP[SLOT].
+ - Otherwise do not append ELEMENT to any scope.
+ - Stop this algorithm.
+
+
+ - If CURRENT is a slot element and not equal to ELEMENT:
+
+ - If CURRENT has any assigned nodes, do not append ELEMENT to any scope.
+ - Otherwise append ELEMENT to SCOPE-MAP[CURRENT].
+ - Stop this algorithm.
+
+
+ - If CURRENT is a child of a root node (a shadow root or document) ROOT:
+
+ - Append ELEMENT to SCOPE-MAP[ROOT].
+ - Stop this algorithm.
+
+ - Otherwise:
+
+ - Set CURRENT to the parent element of CURRENT.
+
+
+
+
+
+
+
+
+
+
+ Step 3.
+
+
+ - INPUT
+ - SCOPE, a focus navigation scope
+ - OUTPUT
+ - NAVIGATION-ORDER, an ordered list of elements which should be visited.
+
+
+ - For each scope SCOPE:
+
+ - Let NAVIGATION-ORDER be an empty list.
+ - For each element ELEMENT in a focus navigation scope SCOPE,
+
+ - if ELEMENT is focusable, a shadow host, or a slot element, append ELEMENT to NAVIGATION-ORDER.
+
+ - 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.
+
+
+
+
+
+ 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.
+
+
+ - Let MERGED-NAVIGATION-ORDER be an empty list.
+ - For each element ELEMENT in NAVIGATION-ORDER:
+
+ - If ELEMENT is a shadow host:
+
+ - Unless its shadow root’s delegatesFocus flag is set, append ELEMENT to MERGED-NAVIGATION-ORDER.
+ - 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.
+
+
+ - If ELEMENT is a slot element:
+
+ - 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.
+
+
+ - Otherwise:
+
+ - Append ELEMENT to MERGED-NAVIGATION-ORDER.
+
+
+ - Return MERGED-NAVIGATION-ORDER.
+
+
+
+
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.