You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
content attribute provides declarative focus navigation for a group of related focusable
90151
-
elements. When applied to an element, it enables directional arrow key navigation among its
90152
-
focusable descendants, forming a <dfn>focus group</dfn>.</p>
90151
+
elements. When applied to an element, it enables <dfn>Directional Navigation</dfn> among its
90152
+
focusable descendants, forming a <dfn>focus group</dfn>. <span>Directional Navigation</span> is navigation by spatial direction (such as up, down, left, or right), as determined by the user agent and input device (for example, arrow keys, gamepad, remote control, etc.). In contrast, <span>Sequential focus navigation</span> refers to navigation in the order defined by the <span>sequential focus navigation order</span> (see <a href="#sequential-focus-navigation">definition</a>), often via <kbd>Tab</kbd> and <kbd>Shift+Tab</kbd>.</p>
90153
+
90154
+
<h5>Concepts</h5>
90153
90155
90154
90156
<p>The attribute's value is a string of space-separated tokens. The first token must either be a
90155
90157
<dfn>behavior token</dfn>, which defines the primary interaction pattern, or the special token
90156
90158
<code data-x="attr-focusgroup-none">none</code> which is used alone to opt out of focusgroup behavior. If a behavior token is
90157
90159
specified, <dfn>modifier tokens</dfn> can be provided subsequently.</p>
90158
90160
90159
-
<h5>Concepts</h5>
90160
-
90161
-
<p>A <dfn>focusgroup owner</dfn> is an element with a valid <code data-x="attr-focusgroup">focusgroup</code> attribute specified, where the attribute value contains a <span data-x="behavior token">behavior token</span> (not <code data-x="attr-focusgroup-none">none</code>).</p>
90161
+
<p><span data-x="behavior token">Behavior tokens</span> define the <dfn>interaction pattern</dfn>, which refers to how the directional navigation inputs are used to move focus between focusgroup items.</p>
90162
90162
90163
-
<p>The <dfn>focusgroup scope</dfn> of a focusgroup owner is the owner itself and all of its <span data-x="shadow-including descendant">shadow-including descendants</span>, excluding any descendants that are in a different <span data-x="focusgroup scope">focusgroup scope</span> or have opted out with <code data-x="attr-focusgroup-none">focusgroup="none"</code>.</p>
90163
+
<p>The following interaction patterns are defined:</p>
90164
90164
90165
-
<p>A <dfn>focusgroup item</dfn> is any <span>focusable</span> element within the focusgroup scope.</p>
90165
+
<ul>
90166
+
<li><p><dfn data-x="linear interaction pattern">Linear</dfn>: Enables sequential navigation forwards and backwards through a set of focusable items. In a <span data-x="linear interaction pattern">linear interaction pattern</span>, even when both directional input axes are allowed (such as when neither <code data-x="attr-focusgroup-inline">inline</code> nor <code data-x="attr-focusgroup-block">block</code> modifiers are specified), navigation follows the document order of the items rather than spatial positioning.</p></li>
<td>Indicates a tablist pattern. Infers a <code data-x="attr-aria-role-tablist">tablist</code> role for the owner and a <code data-x="attr-aria-role-tab">tab</code> role for items.
<td>Indicates a radiogroup pattern. Infers a <code data-x="attr-aria-role-radiogroup">radiogroup</code> role for the owner and a <code data-x="attr-aria-role-radio">radio</code> role for items.
<td>Indicates a listbox pattern. Infers a <code data-x="attr-aria-role-listbox">listbox</code> role for the owner and an <code data-x="attr-aria-role-option">option</code> role for items.
<td>Indicates a menu pattern. Infers a <code data-x="attr-aria-role-menu">menu</code> role for the owner and a <code data-x="attr-aria-role-menuitem">menuitem</code> role for items.
<td>Indicates a menubar pattern. Infers a <code data-x="attr-aria-role-menubar">menubar</code> role for the owner and a <code data-x="attr-aria-role-menuitem">menuitem</code> role for items.
<td>Opts the element and its descendants out of any ancestor focus group. Must be used alone.
90218
90232
</table>
90219
90233
90234
+
<p>A <dfn>focusgroup owner</dfn> is an element with a valid <code data-x="attr-focusgroup">focusgroup</code> attribute specified, where the attribute value contains a <span data-x="behavior token">behavior token</span> (not <code data-x="attr-focusgroup-none">none</code>).</p>
90235
+
<p>The <dfn>focusgroup scope</dfn> of a focusgroup owner is all of its <span data-x="shadow-including descendant">shadow-including descendants</span>, excluding any descendants that are a <span>focusgroup owner</span> themselves or are are in a different <span data-x="focusgroup scope">focusgroup scope</span> or have opted out with <code data-x="attr-focusgroup-none">focusgroup="none"</code>.</p>
90236
+
<p>A <dfn>focusgroup item</dfn> is any <span>focusable</span> element within the focusgroup scope.</p>
90220
90237
<h5>ARIA Role Inference</h5>
90221
90238
90222
90239
<p>When a <span data-x="behavior token">behavior token</span> is used, the user agent may infer a corresponding ARIA role for the <span data-x="focusgroup owner">focusgroup owner</span> and its <span data-x="focusgroup item">items</span>. This inference must only occur if the element would otherwise have a generic role (such as a <code>div</code> or <code>span</code>) and does not have an explicit <code data-x="attr-aria-role">role</code> attribute.</p>
<p>When a user presses an arrow key and focus is within a <span data-x="focusgroup scope">focusgroup scope</span>, the user agent must run these steps:</p>
90251
+
<p>When a user requests <span>Directional Navigation</span> and focus is within a <span data-x="focusgroup scope">focusgroup scope</span>, the user agent must run these steps:</p>
90235
90252
90236
90253
<ol>
90237
-
<li>If the arrow key pressed is not in an allowed axis given the focusgroup owners's modifiers, do nothing, and do not consume the arrow key event.</li>
90238
-
<li>Let <var>direction</var> be "forwards" or "backwards" corresponding to the arrow key pressed and the document's direction.</li>
90254
+
<li>If the navigation request is not in an allowed axis given the focusgroup owner's modifiers, do nothing.</li>
90255
+
<li>Let <var>direction</var> be the spatial direction requested (e.g., up, down, left, right) as determined by the user agent and input device.</li>
90239
90256
<li>Let <var>owner</var> be the <span>focusgroup owner</span>.</li>
90240
90257
<li><p>Let <var>currentItem</var> be the currently focused <span>focusgroup item</span>.</p></li>
90241
90258
<li><p>Let <var>items</var> be all <span data-x="focusgroup item">focusgroup items</span> in <span>tree order</span>.</p></li>
90242
-
<li><p>Determine the <var>nextItem</var> by finding the nearest item in tree order in the <var>direction</var>.</p></li>
90243
-
<li><p>If no <var>nextItem</var> is found and the <code data-x="attr-focusgroup-wrap">wrap</code> token is present, wrap to the first item in the specified direction. Otherwise, do nothing, do not consume the arrow key event.</p></li>
90259
+
<li><p>Determine the <var>nextItem</var> by finding the nearest item in tree order in the <var>direction</var>.</p></li>
90260
+
<li><p>If no <var>nextItem</var> is found and the <code data-x="attr-focusgroup-wrap">wrap</code> token is present, wrap to the first item in the specified direction. Otherwise, do nothing.</p></li>
90244
90261
<li><p>If a <var>nextItem</var> is identified, run the <span>focusing steps</span> for it.</p></li>
<p>A <span data-x="focus group">focus group</span> must have at least one <dfn>guaranteed tab stop</dfn>. When elements opt-out of a focusgroup using <code data-x="attr-focusgroup-none">focusgroup="none"</code>, they divide the focusgroup for <span>sequential focus navigation</span> purposes, creating one tab stop per focusgroup segment.</p>
90251
90268
<div algorithm>
90252
-
<p>When a user navigates into a <span data-x="focus group">focus group</span> using <kbd>Tab</kbd> or <kbd>Shift</kbd>+<kbd>Tab</kbd>, the user agent must run these steps:</p>
90269
+
<p>When a user requests <span>sequential focus navigation</span> into a <span data-x="focus group">focus group</span>, the user agent must run these steps:</p>
90253
90270
90254
90271
<ol>
90255
-
<li><p>Let <var>direction</var> be "forward" for <kbd>Tab</kbd> and "backward" for <kbd>Shift</kbd>+<kbd>Tab</kbd>.</p></li>
90272
+
<li><p>Let <var>direction</var> be "forward" or "backward" as determined by the user agent and input device (for example, <kbd>Tab</kbd> or <kbd>Shift</kbd>+<kbd>Tab</kbd>).</p></li>
90256
90273
90257
-
<li><p>Let <var>entryElement</var> be the element from which focus is entering the focusgroup (the element with focus before the tab key was pressed).</p></li>
90274
+
<li><p>Let <var>entryElement</var> be the element from which focus is entering the focusgroup.</p></li>
90258
90275
90259
90276
<li><p>Let <var>focusgroupSegment</var> be the set of <span data-x="focusgroup item">focusgroup items</span> in the nearest focusgroup scope that are reachable without crossing any opted-out elements in <span>tree order</span> from <var>entryElement</var> in the direction of navigation.</p></li>
0 commit comments