Skip to content

Commit c8a7880

Browse files
[css-overflow-5] Update scroll-marker-group to include modes #12122 (#13627)
1 parent 5ac87f0 commit c8a7880

File tree

1 file changed

+42
-13
lines changed

1 file changed

+42
-13
lines changed

css-overflow-5/Overview.bs

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -300,11 +300,11 @@ The 'scroll-marker-group' property</h4>
300300

301301
<pre class=propdef>
302302
Name: scroll-marker-group
303-
Value: none | before | after
303+
Value: none | [ [ before | after ] || [ links | tabs ] ]
304304
Initial: none
305305
Applies to: [=scroll containers=]
306306
Inherited: no
307-
Computed value: specified value
307+
Computed value: specified keyword(s)
308308
Animation Type: discrete
309309
Canonical Order: per grammar
310310
</pre>
@@ -331,6 +331,17 @@ The 'scroll-marker-group' property</h4>
331331
the generated pseudo-element's box is the last child of the [=originating element=].
332332
Otherwise, its box is an immediate following sibling to its [=originating element=].
333333

334+
<dt><dfn>links</dfn>
335+
<dd>
336+
The generated ''::scroll-marker-group'' operates in "links" mode,
337+
functioning like a navigation list.
338+
This is the default mode if omitted.
339+
340+
<dt><dfn>tabs</dfn>
341+
<dd>
342+
The generated ''::scroll-marker-group'' operates in "tabs" mode,
343+
functioning like a tablist.
344+
334345
</dl>
335346

336347
<h4 id="scroll-marker-group-pseudo">The ''::scroll-marker-group'' pseudo-element</h4>
@@ -352,9 +363,6 @@ The 'scroll-marker-group' property</h4>
352363
::scroll-marker-group { contain: size !important; }
353364
</pre>
354365

355-
The 'scroll-marker-group' implicitly behaves as a single focusable component,
356-
establishing a <a href="https://open-ui.org/components/focusgroup.explainer/">focusgroup</a>.
357-
358366
<h4 id="scroll-marker-pseudo">The ''::scroll-marker'' pseudo-element</h4>
359367

360368
Similar to ''::before'' and ''::after'', all elements can have a ''::scroll-marker'' pseudo-element,
@@ -370,10 +378,25 @@ The 'scroll-marker-group' property</h4>
370378
These pseudo-elements are [=fully styleable pseudo-elements=] and have a default style like the [[html#the-a-element|HTML &lt;a> element]].
371379

372380
These pseudo-elements have an indicated [=scroll target=] of their <a>originating element</a>.
373-
They behave as an element with a <a href="https://html.spec.whatwg.org/multipage/interaction.html#attr-tabindex"><code>tabindex</code></a> of "-1",
374-
making them focusable within their '::scroll-marker-group' either by arrow key navigation within the group,
375-
or via the tab key when currently active or when no other ''::scroll-marker'' is active and this is the first marker in the group,
376-
ensuring the group has a <a href="https://open-ui.org/components/focusgroup.explainer/#guaranteed-tab-stop">guaranteed tab stop</a>.
381+
382+
<h4 id="scroll-marker-modes">Scroll Marker Modes</h4>
383+
384+
A ''::scroll-marker-group'' operates in either <dfn>links</dfn> or <dfn>tabs</dfn> mode based on the 'scroll-marker-group' property value of its [=originating element=]. The chosen mode significantly affects the roles, focus behaviors, and interactions of the associated elements and pseudo-elements (see [[#scroll-marker-activation]]).
385+
386+
If the mode is [=links=]:
387+
388+
* The roles of ''::scroll-marker-group'' and ''::scroll-marker'' are `navigation` and `link` respectively.
389+
* All ''::scroll-marker'' pseudo-elements are tab stops, in order.
390+
* The roles of the [=originating elements=] are unaffected.
391+
392+
If the mode is [=tabs=]:
393+
394+
* The roles of ''::scroll-marker-group'' and ''::scroll-marker'' are `tablist` and `tab` respectively.
395+
* The ''::scroll-marker-group'' implicitly behaves as a single focusable component, establishing a <a href="https://open-ui.org/components/focusgroup.explainer/">focusgroup</a>.
396+
* Only the active ''::scroll-marker'' is a tab stop; arrow keys are used to switch between markers. They behave as an element with a <a href="https://html.spec.whatwg.org/multipage/interaction.html#attr-tabindex"><code>tabindex</code></a> of "-1", making them focusable within their ''::scroll-marker-group'' either by arrow key navigation within the group, or via the tab key when currently active (or when no other ''::scroll-marker'' is active and this is the first marker in the group), ensuring the group has a <a href="https://open-ui.org/components/focusgroup.explainer/#guaranteed-tab-stop">guaranteed tab stop</a>.
397+
* [=Originating elements=] of ''::scroll-marker'' are given an implicit role of `tabpanel`. If the [=originating element=] is a ''::column'' pseudo-element, the `tabpanel` role is given to the [=originating element=] of the ''::column''.
398+
* The ''::scroll-marker'' pseudo-element is a focus navigation scope owner for its associated [=originating element=]. This means that tab focus moves from the marker to the content. Since only the active marker is a tab stop, contents of the inactive tabpanels are not reached unless the active tab is switched.
399+
* Content from inactive tabs is also hidden from the accessibility tree, meaning authors do not need to carefully apply `interactivity: inert` to hide the inactive tabpanels.
377400

378401
<h4 id="active-before-after-scroll-markers">
379402
Selecting Scroll Markers: '':target-current'', '':target-before'' and '':target-after'' pseudo-classes</h4>
@@ -520,14 +543,20 @@ Calculating the Active Scroll Marker</h4>
520543
1. <a lt='scroll a target into view'>Scroll the |element| into view</a> with <var>block</var>, <var>inline</var>, and <var>container</var>.
521544
1. : If the activation was triggered by invocation
522545
::
523-
1. <a spec=html>Follow the hyperlink</a> updating the URL, however retain focus on the marker element.
524-
525-
Note: If the user tabs away the focus behavior will ensure they tab into the relevant content.
546+
1. <a spec=html>Follow the hyperlink</a> updating the URL.
547+
1. : If the [=scroll marker group=] is in [=tabs=] mode
548+
::
549+
Retain focus on the [=scroll marker=] element.
550+
1. : If the [=scroll marker group=] is in [=links=] mode
551+
::
552+
Set the <a href="https://html.spec.whatwg.org/multipage/interaction.html#sequential-focus-navigation-starting-point">sequential focus navigation starting point</a> to the [=originating element=], losing focus from the [=scroll marker=].
553+
554+
Note: In [=tabs=] mode, if the user tabs away, the focus behavior will ensure they tab into the relevant content.
526555
</div>
527556

528557
<h4 id="scroll-marker-next-focus">Next tab-index-ordered focus</h4>
529558

530-
When a [=scroll marker=] is activated,
559+
When a [=scroll marker=] in [=tabs=] mode is activated,
531560
the next tabindex-ordered focus navigation will focus the [=scroll target=] if it is focusable,
532561
otherwise, it will find the next focusable element from the [=scroll target=]
533562
as though it were focused.

0 commit comments

Comments
 (0)