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
90169
-
elements. When applied to an element, it enables directional arrow key navigation among its
90170
-
focusable descendants, forming a <dfn>focus group</dfn>.</p>
90169
+
elements. When applied to an element, it enables <dfn>Directional Navigation</dfn> among its
90170
+
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>
90171
+
90172
+
<h5>Concepts</h5>
90171
90173
90172
90174
<p>The attribute's value is a string of space-separated tokens. The first token must either be a
90173
90175
<dfn>behavior token</dfn>, which defines the primary interaction pattern, or the special token
90174
90176
<code data-x="attr-focusgroup-none">none</code> which is used alone to opt out of focusgroup behavior. If a behavior token is
90175
90177
specified, <dfn>modifier tokens</dfn> can be provided subsequently.</p>
90176
90178
90177
-
<h5>Concepts</h5>
90178
-
90179
-
<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>
90179
+
<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>
90180
90180
90181
-
<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>
90181
+
<p>The following interaction patterns are defined:</p>
90182
90182
90183
-
<p>A <dfn>focusgroup item</dfn> is any <span>focusable</span> element within the focusgroup scope.</p>
90183
+
<ul>
90184
+
<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.
90236
90250
</table>
90237
90251
90252
+
<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>
90253
+
<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>
90254
+
<p>A <dfn>focusgroup item</dfn> is any <span>focusable</span> element within the focusgroup scope.</p>
90238
90255
<h5>ARIA Role Inference</h5>
90239
90256
90240
90257
<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>
90269
+
<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>
90253
90270
90254
90271
<ol>
90255
-
<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>
90256
-
<li>Let <var>direction</var> be "forwards" or "backwards" corresponding to the arrow key pressed and the document's direction.</li>
90272
+
<li>If the navigation request is not in an allowed axis given the focusgroup owner's modifiers, do nothing.</li>
90273
+
<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>
90257
90274
<li>Let <var>owner</var> be the <span>focusgroup owner</span>.</li>
90258
90275
<li><p>Let <var>currentItem</var> be the currently focused <span>focusgroup item</span>.</p></li>
90259
90276
<li><p>Let <var>items</var> be all <span data-x="focusgroup item">focusgroup items</span> in <span>tree order</span>.</p></li>
90260
-
<li><p>Determine the <var>nextItem</var> by finding the nearest item in tree order in the <var>direction</var>.</p></li>
90261
-
<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>
90277
+
<li><p>Determine the <var>nextItem</var> by finding the nearest item in tree order in the <var>direction</var>.</p></li>
90278
+
<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>
90262
90279
<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>
90269
90286
<div algorithm>
90270
-
<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>
90287
+
<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>
90271
90288
90272
90289
<ol>
90273
-
<li><p>Let <var>direction</var> be "forward" for <kbd>Tab</kbd> and "backward" for <kbd>Shift</kbd>+<kbd>Tab</kbd>.</p></li>
90290
+
<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>
90274
90291
90275
-
<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>
90292
+
<li><p>Let <var>entryElement</var> be the element from which focus is entering the focusgroup.</p></li>
90276
90293
90277
90294
<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