Skip to content

Commit 13ad7df

Browse files
committed
Restore at-risk the property to create additional spatnav containers
At the same time, I have renamed it to the better naming discussed in w3c#17
1 parent ba5a959 commit 13ad7df

File tree

1 file changed

+55
-10
lines changed

1 file changed

+55
-10
lines changed

index.bs

Lines changed: 55 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Abstract: This specification defines a general model for navigating the focus us
1212
as well as related CSS and JavaScript features.
1313
At risk: {{getSpatnavContainer()}}
1414
At risk: {{focusableAreas()}}
15+
At risk: 'spatial-navigation-contain'
1516
</pre>
1617
<pre class="anchors">
1718
spec: ui-events; urlPrefix: https://w3c.github.io/uievents/;
@@ -105,7 +106,7 @@ spatial navigation related controls.
105106
However, in the spirit of the <a href="https://github.com/extensibleweb/manifesto">Extensible Web Manifesto</a> [[EXTENSIBLE]],
106107
we feel it is important to provide the right JavaScript primitives
107108
to let authors experiment and explore the problem space.
108-
Declarative features may be added later,
109+
More declarative features may be added later,
109110
based on feedback and experience acquired through such JavaScript usage.
110111

111112
Note: A few features are marked <dfn noexport>at-risk</dfn>.
@@ -144,7 +145,9 @@ More specifically,
144145
the User Agent will first search for visible and focusable items
145146
in the direction indicated
146147
within the current <a>spatial navigation focus container</a>
147-
(the root element, scrollable elements, or iframes)
148+
(by default the root element, scrollable elements, and iframes,
149+
but other elements can be made into <a>spatial navigation focus containers</a>
150+
using the 'spatial-navigation-contain' property).
148151

149152
If it finds any, it will pick the best one for that direction,
150153
and move the focus there.
@@ -265,7 +268,6 @@ and [[#js-api]] for details about the JavaScript API.
265268
</pre>
266269
</div>
267270

268-
269271
<h2 id=triggering>
270272
Triggering Spatial Navigation</h2>
271273

@@ -857,19 +859,30 @@ for <a href="https://github.com/WICG/overscroll-behavior">the proposed overscrol
857859
Issue(21): The following does not take shadow dom into account.
858860

859861

860-
<h3 id=nav>
861-
Navigation</h3>
862+
<h3 id=grouping>
863+
Groupings of elements</h3>
864+
865+
While the general model for spatial navigation
866+
is to work from the layout of the document
867+
and the relative position of focusable elements,
868+
the User Agent is required to prioritize finding elements
869+
from a local logical grouping,
870+
only looking for focusable elements outside of the grouping
871+
if a suitable one cannot be found inside it (see [[#nav]] for details).
872+
873+
Such groupings are called <dfn lt="spatial navigation focus container | spatial navigation focus containers | spatnav container | spatnav containers">spatial navigation focus containers</dfn> (or <strong>spatnav containers</strong> for short).
862874

863-
<dfn lt="spatial navigation focus container | spatial navigation focus containers | spatnav container | spatnav containers">Spatial navigation focus containers</dfn> (or <strong>spatnav containers</strong> for short),
864-
are defined to be any of:
875+
By default, <a>spatnav containers</a> are established by:
865876
* the <a>document element</a> of a <a for="/">browsing context</a>'s <a>document</a>
866877
(not limited to the <a>top-level browsing context</a>)
867878

868879
Issue(18): Should that be the viewport rather than the document element?
869-
* a <a>scroll container</a>
880+
* a <a>scroll containers</a>
870881

871-
Note: A mechanism such as a css property to let the author turn additional elements into
872-
spatnav containers may be added in future extentions of this specification.
882+
Additional <a>spatnav containers</a> can be created using the 'spatial-navigation-contain' property (see [[#container]]).
883+
884+
<h3 id=nav>
885+
Navigation</h3>
873886

874887
There can be a <dfn>spatial navigation starting point</dfn>. It is initially unset.
875888
The user agent may set it when the user indicates that it should be moved.
@@ -1099,6 +1112,38 @@ follow the following steps:
10991112

11001113
</div>
11011114

1115+
<h2 id=declarative>
1116+
Controlling spatial navigation through declarative means</h2>
1117+
1118+
<h3 id=container>
1119+
Creating additional spatnav containers: the 'spatial-navigation-contain' property</h3>
1120+
1121+
<pre class='propdef'>
1122+
Name: spatial-navigation-contain
1123+
Value: auto | contain
1124+
Initial: auto
1125+
Inherited: no
1126+
</pre>
1127+
1128+
<dl dfn-for=spatial-navigation-contain dfn-type=value>
1129+
<dt><dfn>auto</dfn>
1130+
<dd>If the element is either
1131+
the <a>document element</a> of a <a for="/">browsing context</a>'s <a>document</a>
1132+
(not limited to the <a>top-level browsing context</a>)
1133+
or
1134+
a <a>scroll container</a>
1135+
then it establishes a <a>spatial navigation focus container</a>,
1136+
otherwise it does not.
1137+
1138+
<dt><dfn>contain</dfn>
1139+
<dd>The element establishes a <a>spatial navigation focus container</a>
1140+
</dl>
1141+
1142+
Issue(16): Add an example
1143+
1144+
Note: the 'spatial-navigation-contain' property is <a>at-risk</a>.
1145+
1146+
11021147
<h2 class=no-num id=scrolling>Appendix A. Scroll extensions</h2>
11031148

11041149
This section proposes a few extensions to CSS

0 commit comments

Comments
 (0)