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
1. Let <var>direction</var> be the value of {{SpatialNavigationSearchOptions/dir}} attribute from <var>options</var>.
530
-
2. If the value of {{SpatialNavigationSearchOptions/candidates}} attribute from <var>options</var> is not <code>null</code>,
531
-
then let <var>areas</var> be the corresponding value.
532
-
3. Else, let <var>container</var> be
533
-
* the value of {{SpatialNavigationSearchOptions/container}} attribute from <var>options</var>, if it is not <code>null</code>,
534
-
* the element's nearest <a>spatial navigation container</a> ancestor, otherwise.
535
-
4. Let <var>areas</var> be the result of <a>finding focusable areas</a> within <var>container</var>.
536
-
3. Return the result of <a>selecting the best candidate</a> within <var>areas</var> in direction <var>direction</var> from the element.
531
+
1. Let <var>direction</var> be the value of {{SpatialNavigationSearchOptions/dir}} attribute from <var>options</var>.
532
+
2. If the value of {{SpatialNavigationSearchOptions/candidates}} attribute from <var>options</var> is not <code>null</code>,
533
+
then let <var>areas</var> be the corresponding value.
534
+
3. Else, let <var>container</var> be
535
+
* the value of {{SpatialNavigationSearchOptions/container}} attribute from <var>options</var>, if it is not <code>null</code>,
536
+
* the element's nearest <a>spatial navigation container</a> ancestor, otherwise.
537
+
4. Let <var>areas</var> be the result of <a>finding focusable areas</a> within <var>container</var>.
538
+
5. Return the result of <a>selecting the best candidate</a> within <var>areas</var> in direction <var>direction</var> from the element.
537
539
538
540
Note: When neither a container nor a list of candidates is provided,
539
541
this only searches through the visible focusable areas of the nearest
@@ -981,14 +983,14 @@ To run the <dfn>spatial navigation steps</dfn> in <var>direction</var>, do the f
981
983
and return if the result is <code>false</code>.</span>
982
984
3. Run the <a>focusing steps</a> for <var>bestCandidate</var> and return
983
985
* Else if <var>eventTarget</var><a>can be manually scrolled</a>, <a>directionally scroll the element</a>
984
-
<var>eventTarget</var> in <var>direction</var> and return.
986
+
<var>eventTarget</var> in <var>direction</var> and return.
985
987
* Else, fallback to the next step.
986
988
6. Let <var>container</var> be the nearest ancestor of <var>eventTarget</var> that is a <a>spatial navigation container</a>.
987
989
7. <i>Loop</i>: Let <var>candidates</var> be the result of <a>finding focusable areas</a>
988
990
within <var>container</var>, excluding <var>searchOrigin</var>
989
991
8. If <var>candidates</var> is empty:
990
992
* If <var>container</var> is a <a>scroll container</a> that <a>can be manually scrolled</a>, <a>directionally scroll the element</a>
991
-
<var>container</var> in <var>direction</var> and return.
993
+
<var>container</var> in <var>direction</var> and return.
992
994
* Else,
993
995
1. If <a>navigation-override</a><a>is enabled</a> in the [=node document=] of <var>eventTarget</var> for the <a spec=html for="/">origin</a> of the [=active document=] of the [=top-level browsing context=], then
994
996
<span class=api><a>fire an event</a> named <a event>navnotarget</a> at <var>eventTarget</var> using {{NavigationEvent}} with:
@@ -1145,6 +1147,7 @@ run the following steps:
1145
1147
and that item is higher in the CSS [=painting order=].
1146
1148
In that case, return that item instead,
1147
1149
unless it too is overlapped with another higher item at the same distance, recursively.
1150
+
1148
1151
</div>
1149
1152
1150
1153
<div algorithm="to calculate the distance">
@@ -1166,9 +1169,9 @@ The meaning of each factor in the function is as follows:
1166
1169
1167
1170
* <var>orthogonalBias</var>
1168
1171
* If the <var>dir</var> is {{SpatialNavigationDirection/left}} or {{SpatialNavigationDirection/right}},
1169
-
height of <var>searchOrigin</var> / 2
1172
+
height of <var>searchOrigin</var> / 2
1170
1173
* Else if the <var>dir</var> is {{SpatialNavigationDirection/up}} or {{SpatialNavigationDirection/down}},
1171
-
width of <var>searchOrigin</var> / 2
1174
+
width of <var>searchOrigin</var> / 2
1172
1175
1173
1176
* <var>orthogonalWeight</var>:
1174
1177
* If the <var>dir</var> is {{SpatialNavigationDirection/left}} or {{SpatialNavigationDirection/right}}, 30
@@ -1181,9 +1184,9 @@ The meaning of each factor in the function is as follows:
1181
1184
* <var>alignBias</var>
1182
1185
1183
1186
* If the <var>dir</var> is {{SpatialNavigationDirection/left}} or {{SpatialNavigationDirection/right}},
1184
-
height of <var>intersectRect</var> / height of <var>candidate</var>
1187
+
height of <var>intersectRect</var> / height of <var>candidate</var>
1185
1188
* Else if the <var>dir</var> is {{SpatialNavigationDirection/up}} or {{SpatialNavigationDirection/down}},
1186
-
width of <var>intersectRect</var> / width of <var>candidate</var>
1189
+
width of <var>intersectRect</var> / width of <var>candidate</var>
1187
1190
1188
1191
* <var>alignWeight</var> is 5
1189
1192
@@ -1229,7 +1232,7 @@ NOTE: The values of <var>alignWeight</var> and <var>orthogonalWeight</var> in th
1229
1232
<h2 id=declarative>
1230
1233
Controlling spatial navigation through declarative means</h2>
1231
1234
1232
-
<h3 id=css-property-spatialnavigationcontain>
1235
+
<h3 id=container>
1233
1236
Creating additional spatial navigation containers: the 'spatial-navigation-contain' property</h3>
1234
1237
1235
1238
<pre class='propdef'>
@@ -1372,15 +1375,15 @@ the proper spatial navigation behavior.
1372
1375
<dt><dfn>focus</dfn>
1373
1376
<dd>The directional input moves the focus to all candidates inside a scroll container. The container <a>cannot be scrolled manually</a>.
1374
1377
1375
-
NOTE: If the 'focus' value is given to 'spatial-navigation-action',
1376
-
<a event>navnotarget</a> event occurs when there isn’t any visible candidate in the given direction within the viewport of
1378
+
NOTE: If the ''spatial-navigation-action/focus'' value is given to 'spatial-navigation-action',
1379
+
<a event>navnotarget</a> event occurs when there isn’t any visible candidate in the given direction within the viewport of
1377
1380
the <a>spatial navigation container</a> even through the container can be scrolled more.
1378
1381
1379
1382
<dt><dfn>scroll</dfn>
1380
1383
<dd>If the element is a <a>scroll container</a>,
1381
1384
then directional input only works for manually scrolling the container.
1382
1385
1383
-
Note: The 'scroll' value is <a>at-risk</a>.
1386
+
Note: The ''spatial-navigation-ation/scroll'' value is <a>at-risk</a>.
0 commit comments