@@ -12,6 +12,7 @@ Abstract: This specification defines a general model for navigating the focus us
12
12
as well as related CSS and JavaScript features.
13
13
At risk : {{getSpatnavContainer()}}
14
14
At risk : {{focusableAreas()}}
15
+ At risk : 'spatial-navigation-contain'
15
16
</pre>
16
17
<pre class="anchors">
17
18
spec: ui-events; urlPrefix: https://w3c.github.io/uievents/;
@@ -105,7 +106,7 @@ spatial navigation related controls.
105
106
However, in the spirit of the <a href="https://github.com/extensibleweb/manifesto">Extensible Web Manifesto</a> [[EXTENSIBLE]] ,
106
107
we feel it is important to provide the right JavaScript primitives
107
108
to let authors experiment and explore the problem space.
108
- Declarative features may be added later,
109
+ More declarative features may be added later,
109
110
based on feedback and experience acquired through such JavaScript usage.
110
111
111
112
Note: A few features are marked <dfn noexport>at-risk</dfn> .
@@ -144,7 +145,9 @@ More specifically,
144
145
the User Agent will first search for visible and focusable items
145
146
in the direction indicated
146
147
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).
148
151
149
152
If it finds any, it will pick the best one for that direction,
150
153
and move the focus there.
@@ -265,7 +268,6 @@ and [[#js-api]] for details about the JavaScript API.
265
268
</pre>
266
269
</div>
267
270
268
-
269
271
<h2 id=triggering>
270
272
Triggering Spatial Navigation</h2>
271
273
@@ -857,19 +859,30 @@ for <a href="https://github.com/WICG/overscroll-behavior">the proposed overscrol
857
859
Issue(21): The following does not take shadow dom into account.
858
860
859
861
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).
862
874
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:
865
876
* the <a>document element</a> of a <a for="/">browsing context</a> 's <a>document</a>
866
877
(not limited to the <a>top-level browsing context</a> )
867
878
868
879
Issue(18): Should that be the viewport rather than the document element?
869
- * a <a>scroll container </a>
880
+ * a <a>scroll containers </a>
870
881
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>
873
886
874
887
There can be a <dfn>spatial navigation starting point</dfn> . It is initially unset.
875
888
The user agent may set it when the user indicates that it should be moved.
@@ -1099,6 +1112,38 @@ follow the following steps:
1099
1112
1100
1113
</div>
1101
1114
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
+
1102
1147
<h2 class=no-num id=scrolling>Appendix A. Scroll extensions</h2>
1103
1148
1104
1149
This section proposes a few extensions to CSS
0 commit comments