Skip to content

Commit 0039b8f

Browse files
committed
Initial commit
1 parent e80a243 commit 0039b8f

File tree

1 file changed

+132
-0
lines changed

1 file changed

+132
-0
lines changed

source

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12539,6 +12539,7 @@ interface <dfn interface>HTMLElement</dfn> : <span>Element</span> {
1253912539
[<span>CEReactions</span>, <span data-x="xattr-ReflectSetter">ReflectSetter</span>] attribute DOMString <span data-x="dom-writingSuggestions">writingSuggestions</span>;
1254012540
[<span>CEReactions</span>, <span data-x="xattr-ReflectSetter">ReflectSetter</span>] attribute DOMString <span data-x="dom-autocapitalize">autocapitalize</span>;
1254112541
[<span>CEReactions</span>] attribute boolean <span data-x="dom-autocorrect">autocorrect</span>;
12542+
[<span>CEReactions</span>, <span data-focusitem_descendantsx="xattr-Reflect">Reflect</span>] attribute DOMString <dfn attribute for="HTMLElement" data-x="dom-focusgroup">focusgroup</dfn>;
1254212543

1254312544
[<span>CEReactions</span>] attribute [<span>LegacyNullToEmptyString</span>] DOMString <span data-x="dom-innerText">innerText</span>;
1254412545
[<span>CEReactions</span>] attribute [<span>LegacyNullToEmptyString</span>] DOMString <span data-x="dom-outerText">outerText</span>;
@@ -12625,6 +12626,7 @@ interface <dfn interface>HTMLUnknownElement</dfn> : <span>HTMLElement</span> {
1262512626

1262612627
[<span>CEReactions</span>, <span data-x="xattr-Reflect">Reflect</span>] attribute boolean <dfn attribute for="HTMLOrSVGElement" data-x="dom-fe-autofocus">autofocus</dfn>;
1262712628
[<span>CEReactions</span>, <span data-x="xattr-ReflectSetter">ReflectSetter</span>] attribute long <span data-x="dom-tabindex">tabIndex</span>;
12629+
[<span>CEReactions</span>, <span data-x="xattr-Reflect">Reflect</span>] attribute DOMString <dfn attribute for="HTMLOrSVGElement" data-x="dom-focusgroup">focusgroup</dfn>;
1262812630
undefined <span data-x="dom-focus">focus</span>(optional <span>FocusOptions</span> options = {});
1262912631
undefined <span data-x="dom-blur">blur</span>();
1263012632
};</code></pre>
@@ -13896,6 +13898,7 @@ https://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%
1389613898
<li><code data-x="attr-dir">dir</code></li>
1389713899
<li><code data-x="attr-draggable">draggable</code></li>
1389813900
<li><code data-x="attr-enterkeyhint">enterkeyhint</code></li>
13901+
<li><code data-x="attr-focusgroup">focusgroup</code></li>
1389913902
<li><code data-x="attr-headingoffset">headingoffset</code></li>
1390013903
<li><code data-x="attr-headingreset">headingreset</code></li>
1390113904
<li><code data-x="attr-hidden">hidden</code></li>
@@ -90131,6 +90134,135 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
9013190134

9013290135

9013390136

90137+
<h4>The <code data-x="attr-focusgroup">focusgroup</code> attribute</h4>
90138+
90139+
<p>The <dfn element-attr for="html-global"><code data-x="attr-focusgroup">focusgroup</code></dfn>
90140+
content attribute provides declarative focus navigation for a group of related focusable
90141+
elements. When applied to an element, it enables directional arrow key navigation among its
90142+
focusable descendants, forming a <dfn>focus group</dfn>.</p>
90143+
90144+
<p>The attribute's value is a string of space-separated tokens. The first token must be a
90145+
<dfn>behavior token</dfn>, which defines the primary interaction pattern. Subsequent tokens are
90146+
optional <dfn>modifier tokens</dfn>. The exception is the `none` token, which must be used
90147+
alone.</p>
90148+
90149+
<table>
90150+
<thead>
90151+
<tr>
90152+
<th>Token
90153+
<th>Type
90154+
<th>Description
90155+
<tbody>
90156+
<tr>
90157+
<td><dfn data-x="attr-focusgroup-toolbar">`toolbar`</dfn>
90158+
<td>Behavior
90159+
<td>Indicates a toolbar pattern. Infers a `toolbar` role.
90160+
<tr>
90161+
<td><dfn data-x="attr-focusgroup-tablist">`tablist`</dfn>
90162+
<td>Behavior
90163+
<td>Indicates a tablist pattern. Infers a `tablist` role for the owner and a `tab` role for items.
90164+
<tr>
90165+
<td><dfn data-x="attr-focusgroup-radiogroup">`radiogroup`</dfn>
90166+
<td>Behavior
90167+
<td>Indicates a radiogroup pattern. Infers a `radiogroup` role for the owner and a `radio` role for items.
90168+
<tr>
90169+
<td><dfn data-x="attr-focusgroup-listbox">`listbox`</dfn>
90170+
<td>Behavior
90171+
<td>Indicates a listbox pattern. Infers a `listbox` role for the owner and an `option` role for items.
90172+
<tr>
90173+
<td><dfn data-x="attr-focusgroup-menu">`menu`</dfn>
90174+
<td>Behavior
90175+
<td>Indicates a menu pattern. Infers a `menu` role for the owner and a `menuitem` role for items.
90176+
<tr>
90177+
<td><dfn data-x="attr-focusgroup-menubar">`menubar`</dfn>
90178+
<td>Behavior
90179+
<td>Indicates a menubar pattern. Infers a `menubar` role for the owner and a `menuitem` role for items.
90180+
<tr>
90181+
<td><dfn data-x="attr-focusgroup-wrap">`wrap`</dfn>
90182+
<td>Modifier
90183+
<td>Enables navigation to wrap from the last item to the first, and vice-versa.
90184+
<tr>
90185+
<td><dfn data-x="attr-focusgroup-inline">`inline`</dfn>
90186+
<td>Modifier
90187+
<td>Restricts arrow key navigation to the inline axis (e.g., left/right arrows).
90188+
<tr>
90189+
<td><dfn data-x="attr-focusgroup-block">`block`</dfn>
90190+
<td>Modifier
90191+
<td>Restricts arrow key navigation to the block axis (e.g., up/down arrows).
90192+
<tr>
90193+
<td><dfn data-x="attr-focusgroup-no-memory">`no-memory`</dfn>
90194+
<td>Modifier
90195+
<td>Disables the "last focused item" memory when re-entering the focus group.
90196+
<tr>
90197+
<td><dfn data-x="attr-focusgroup-none">`none`</dfn>
90198+
<td>Behavior
90199+
<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>
90247+
90248+
<pre><code class="html">&lt;div focusgroup="tablist inline wrap no-memory" aria-label="Common Operating Systems"&gt;
90249+
&lt;button id="tab-1" aria-selected="false" aria-controls="tabpanel-1" tabindex="-1"&gt;macOS&lt;/button&gt;
90250+
&lt;button id="tab-2" aria-selected="true" aria-controls="tabpanel-2" tabindex="0"&gt;Windows&lt;/button&gt;
90251+
&lt;button id="tab-3" aria-selected="false" aria-controls="tabpanel-3" tabindex="-1"&gt;Linux&lt;/button&gt;
90252+
&lt;/div&gt;
90253+
&lt;div id="tabpanel-1" role="tabpanel" tabindex="0" aria-labelledby="tab-1" hidden&gt; … &lt;/div&gt;
90254+
&lt;div id="tabpanel-2" role="tabpanel" tabindex="0" aria-labelledby="tab-2"&gt; … &lt;/div&gt;
90255+
&lt;div id="tabpanel-3" role="tabpanel" tabindex="0" aria-labelledby="tab-3" hidden&gt; … &lt;/div&gt;</code></pre>
90256+
90257+
<p>The <code data-x="attr-focusgroup-inline">inline</code> token restricts navigation to
90258+
horizontal arrow keys only, <code data-x="attr-focusgroup-wrap">wrap</code> enables
90259+
wrap-around navigation, and <code data-x="attr-focusgroup-no-memory">no-memory</code> ensures
90260+
that focus always returns to the explicitly selected tab (with <code data-x="attr-tabindex">tabindex="0"</code>)
90261+
rather than the last focused tab.</p>
90262+
</div>
90263+
90264+
90265+
9013490266
<h4>The <code data-x="attr-draggable">draggable</code> attribute</h4>
9013590267

9013690268
<p>All <span>HTML elements</span> may have the <dfn element-attr for="html-global"><code

0 commit comments

Comments
 (0)