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
<td>Opts the element and its descendants out of any ancestor focus group.
90200
+
</table>
90201
+
90202
+
<h5>Concepts</h5>
90203
+
90204
+
<p>A <dfn>focusgroup owner</dfn> is an element with the <code data-x="attr-focusgroup">focusgroup</code> attribute specified.</p>
90205
+
90206
+
<p>The <dfn>focusgroup scope</dfn> of a focusgroup owner is the owner itself and all of its <span>shadow-inclusive descendants</span>, excluding any descendants that are themselves focusgroup owners or have opted out with <code data-x="attr-focusgroup-none">focusgroup="none"</code>.</p>
90207
+
90208
+
<p>A <dfn>focusgroup item</dfn> is any <span>focusable</span> element within the focusgroup scope.</p>
90209
+
90210
+
<h5>ARIA Role Inference</h5>
90211
+
90212
+
<p>When a <span data-x="focusgroup-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 `<div>` or `<span>`) and does not have an explicit <code data-x="attr-aria-role">role</code> attribute.</p>
90213
+
90214
+
<p>For example, `<div focusgroup="toolbar">` would be exposed with a `toolbar` role. However, if the element has existing semantics (e.g., `<nav focusgroup="toolbar">`) or an explicit role (e.g., `<div focusgroup="toolbar" role="navigation">`), the existing role is preserved and only the focus navigation behavior is applied.</p>
90215
+
90216
+
<p class="note">Role inference never overrides explicit author-defined roles or meaningful native-element semantics. It also does not infer variant roles like `menuitemcheckbox`; such roles must be specified explicitly by the author.</p>
90217
+
90218
+
<h5>Focus Handling</h5>
90219
+
90220
+
<h6>Directional Navigation</h6>
90221
+
<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 perform the following steps:</p>
90222
+
<ol>
90223
+
<li>Let <var>owner</var> be the <span data-x="focusgroup owner">focusgroup owner</span>.</li>
90224
+
<li>Let <var>currentItem</var> be the currently focused element.</li>
90225
+
<li>Let <var>items</var> be all <span data-x="focusgroup item">focusgroup items</span> in <span data-x="tree order">tree order</span>.</li>
90226
+
<li>Determine the <var>nextItem</var> by finding the geometrically nearest item in the direction of the arrow key, respecting the owner's <span>writing mode</span> and <span>direction</span>.
90227
+
<ul class="brief">
90228
+
<li>If the <code data-x="attr-focusgroup-inline">inline</code> token is present, only consider items on the inline axis.</li>
90229
+
<li>If the <code data-x="attr-focusgroup-block">block</code> token is present, only consider items on the block axis.</li>
90230
+
</ul>
90231
+
</li>
90232
+
<li>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.</li>
90233
+
<li>If a <var>nextItem</var> is identified, move focus to it. This must not affect the sequential focus navigation order.</li>
90234
+
</ol>
90235
+
90236
+
<h6>Sequential Navigation and Guaranteed Tab Stop</h6>
90237
+
<p>A focus group must have a <dfn>guaranteed tab stop</dfn>. When a user navigates into a focus group using <kbd>Tab</kbd> or <kbd>Shift</kbd>+<kbd>Tab</kbd>, the user agent must identify the target item by applying the following rules:</p>
90238
+
<ol>
90239
+
<li>If the focus group has a <dfn>last focused item</dfn> and the <code data-x="attr-focusgroup-no-memory">no-memory</code> token is not present, the target is the last focused item.</li>
90240
+
<li>Otherwise, if an item is <span>sequentially focusable</span> (e.g., has `tabindex="0"`), the target is the first such item.</li>
90241
+
<li>Otherwise, the target is the first <span data-x="focusgroup item">focusgroup item</span> in <span>tree order</span>.</li>
90242
+
</ol>
90243
+
<p>Once the target item is identified, focus is moved to it. All other <span data-x="focusgroup item">focusgroup items</span> must be removed from the sequential focus navigation order (e.g., by treating their `tabindex` as -1).</p>
90244
+
90245
+
<div class="example">
90246
+
<p>This example shows a tablist with manual activation, wrap-around navigation, and disabled memory:</p>
0 commit comments