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
Copy file name to clipboardExpand all lines: css-nav-1/Overview.bs
+26-26Lines changed: 26 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -201,9 +201,9 @@ either because it is not a scrollable element
201
201
or because it is already scrolled to the maximum in that direction,
202
202
the User Agent will select the next <a>spatial navigation focus container</a> up the ancestry chain.
203
203
204
-
The process of looking for an eligible focus target and
205
-
if there is any, then move the focus,
206
-
else if the <a>spatial navigation focus container</a> can be scrolled, then scroll,
204
+
The process of looking for an eligible focus target and
205
+
if there is any, then move the focus,
206
+
else if the <a>spatial navigation focus container</a> can be scrolled, then scroll,
207
207
otherwise, going up to the next container
208
208
is repeated until the ancestry chain reaches the root element.
209
209
@@ -213,7 +213,7 @@ the elements that are reachable by sequential navigation
213
213
and by spatial navigation are almost the same:
214
214
* Elements that are currently outside of the viewport of a scrollable element
215
215
can only be reached once they have been scrolled into view
216
-
* Elements that cannot be scrolled into view.
216
+
* Elements that cannot be scrolled into view.
217
217
For instance, those are out of reach because they are placed at a negative offset.
218
218
</div>
219
219
@@ -499,7 +499,7 @@ Note: the {{focusableAreas()}} and {{getSpatialNavigationContainer()}} methods a
499
499
<div class=example id=focusAreas-visible>
500
500
The following code shows how to get all the visible focusable elements in the current page using {{Element/focusableAreas()}}.
501
501
If the method finds a <a>spatial navigation container</a>, it recursively finds focusable areas inside it.
502
-
However, <code>visible</code> is given to the {{FocusableAreasOptions/mode}} attribute of this method,
502
+
However, <code>visible</code> is given to the {{FocusableAreasOptions/mode}} attribute of this method,
503
503
the focusable element which isn’t inside the <a>scrollport</a> is excluded from the result.
504
504
505
505
<pre><code highlight=markup>
@@ -982,15 +982,15 @@ To run the <dfn>spatial navigation steps</dfn> in <var>direction</var>, do the f
982
982
983
983
and return if the result is <code>false</code>.</span>
984
984
3. Run the <a>focusing steps</a> for <var>bestCandidate</var> and return
985
-
* Else if <var>eventTarget</var><a>can be manually scrolled</a>,<a>directionally scroll the element</a>
986
-
<var>eventTarget</var> in <var>direction</var> and return.
985
+
* Else if <var>eventTarget</var><a>can be manually scrolled</a>,
986
+
<a>directionally scroll the element</a><var>eventTarget</var> in <var>direction</var> and return.
987
987
* Else, fallback to the next step.
988
988
6. Let <var>container</var> be the nearest ancestor of <var>eventTarget</var> that is a <a>spatial navigation container</a>.
989
989
7. <i>Loop</i>: Let <var>candidates</var> be the result of <a>finding focusable areas</a>
990
990
within <var>container</var>, excluding <var>searchOrigin</var>
991
991
8. If <var>candidates</var> is empty:
992
-
* If <var>container</var> is a <a>scroll container</a> that <a>can be manually scrolled</a>,<a>directionally scroll the element</a>
993
-
<var>container</var> in <var>direction</var> and return.
992
+
* If <var>container</var> is a <a>scroll container</a> that <a>can be manually scrolled</a>,
993
+
<a>directionally scroll the element</a><var>container</var> in <var>direction</var> and return.
994
994
* Else,
995
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
996
996
<span class=api><a>fire an event</a> named <a event>navnotarget</a> at <var>eventTarget</var> using {{NavigationEvent}} with:
@@ -1013,7 +1013,7 @@ To run the <dfn>spatial navigation steps</dfn> in <var>direction</var>, do the f
1013
1013
9. Let <var>bestCandidate</var> be the result of <a>selecting the best candidate</a>
1014
1014
within <var>candidates</var> in <var>direction</var> starting from <var>searchOrigin</var>.
1015
1015
10. 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
1016
-
<span class=api><a>fire an event</a> named <a event>navbeforefocus</a> at <var>eventTarget</var> using {{NavigationEvent}} with:
1016
+
<span class=api><a>fire an event</a> named <a event>navbeforefocus</a> at <var>eventTarget</var> using {{NavigationEvent}} with:
1017
1017
* Set {{NavigationEvent/dir}} to <var>direction</var>
1018
1018
* Set {{NavigationEvent/relatedTarget}} to <var>bestCandidate</var>
1019
1019
* Set <code>bubbles</code> and <code>cancelable</code> attributes to <code>true</code>
@@ -1133,20 +1133,20 @@ run the following steps:
1133
1133
whose boundary goes through the geometric center of the <var>searchOrigin</var>
1134
1134
and is perpendicular to <var>dir</var>.
1135
1135
2. For each <var>candidate</var> in <var>candidates</var>,
1136
-
1. If the <var>searchOrigin</var> is an element, then find the points <var>P1</var> inside the <a>boundary box</a>
1136
+
1. If the <var>searchOrigin</var> is an element, then find the points <var>P1</var> inside the <a>boundary box</a>
1137
1137
of <var>searchOrigin</var> and P2 inside the boundary box of <var>candidate</var>.
1138
-
2. Else if the <var>searchOrigin</var> is a point, then let the point <var>P1</var> be the <var>searchOrigin</var>
1138
+
2. Else if the <var>searchOrigin</var> is a point, then let the point <var>P1</var> be the <var>searchOrigin</var>
1139
1139
and find the point <var>P2</var> inside the <a>boundary box</a>.
1140
1140
3. Let <var>intersectRect</var> be an <dfn>intersecting area</dfn> between the search origin and a candidate.
1141
-
4. Select the <var>P1</var> and <var>P2</var> that make the smallest <var>distance</var> between those two points by
1142
-
<a>calculating the distance</a>.
1141
+
4. Select the <var>P1</var> and <var>P2</var> that make the smallest <var>distance</var> between those two points by
1142
+
<a>calculating the distance</a>.
1143
1143
5. Return the item of the <var>candidates</var> set that has the smallest <var>distance</var>.
1144
1144
If several have the same distance,
1145
1145
return the first one in document order,
1146
1146
unless its [=boundary box=] overlaps with the [=boundary box=] of an other item at the same distance,
1147
1147
and that item is higher in the CSS [=painting order=].
1148
1148
In that case, return that item instead,
1149
-
unless it too is overlapped with another higher item at the same distance, recursively.
1149
+
unless it too is overlapped with another higher item at the same distance, recursively.
1150
1150
1151
1151
</div>
1152
1152
@@ -1168,9 +1168,9 @@ The meaning of each factor in the function is as follows:
1168
1168
<dd>Defined as <pre class="prod">(absolute distance on the axis orthogonal to <var>dir</var> + <var>orthogonalBias</var>) * <var>orthogonalWeight</var></pre>
1169
1169
1170
1170
* <var>orthogonalBias</var>
1171
-
* If the <var>dir</var> is {{SpatialNavigationDirection/left}} or {{SpatialNavigationDirection/right}},
1171
+
* If the <var>dir</var> is {{SpatialNavigationDirection/left}} or {{SpatialNavigationDirection/right}},
1172
1172
height of <var>searchOrigin</var> / 2
1173
-
* Else if the <var>dir</var> is {{SpatialNavigationDirection/up}} or {{SpatialNavigationDirection/down}},
1173
+
* Else if the <var>dir</var> is {{SpatialNavigationDirection/up}} or {{SpatialNavigationDirection/down}},
1174
1174
width of <var>searchOrigin</var> / 2
1175
1175
1176
1176
* <var>orthogonalWeight</var>:
@@ -1183,23 +1183,23 @@ The meaning of each factor in the function is as follows:
1183
1183
1184
1184
* <var>alignBias</var>
1185
1185
1186
-
* If the <var>dir</var> is {{SpatialNavigationDirection/left}} or {{SpatialNavigationDirection/right}},
1186
+
* If the <var>dir</var> is {{SpatialNavigationDirection/left}} or {{SpatialNavigationDirection/right}},
1187
1187
height of <var>intersectRect</var> / height of <var>candidate</var>
1188
-
* Else if the <var>dir</var> is {{SpatialNavigationDirection/up}} or {{SpatialNavigationDirection/down}},
1188
+
* Else if the <var>dir</var> is {{SpatialNavigationDirection/up}} or {{SpatialNavigationDirection/down}},
1189
1189
width of <var>intersectRect</var> / width of <var>candidate</var>
1190
1190
1191
1191
* <var>alignWeight</var> is 5
1192
1192
1193
1193
<dt><var>sqrt(Overlap)</var>
1194
1194
<dd>The square root of an <a>overlapping area</a> between the <a>boundary boxes</a> of <var>searchOrigin</var> and <var>candidate</var>
1195
-
<dd>Let <var>overlapRect</var> be
1195
+
<dd>Let <var>overlapRect</var> be
1196
1196
<var>intersectRect</var> if the <a>overlapping area</a> exists,
1197
1197
and 0 otherwise.
1198
1198
<dd>Defined as <pre class="prod">sqrt(height of <var>overlapRect</var> * width of <var>overlapRect</var>)</pre>
1199
1199
</dl>
1200
1200
1201
-
NOTE: The values of <var>alignWeight</var> and <var>orthogonalWeight</var> in the function are decided based on
1202
-
the collected <a href="https://wicg.github.io/spatial-navigation/tests/ux/list.html">UX test cases</a>.
1201
+
NOTE: The values of <var>alignWeight</var> and <var>orthogonalWeight</var> in the function are decided based on
1202
+
the collected <a href="https://wicg.github.io/spatial-navigation/tests/ux/list.html">UX test cases</a>.
1203
1203
It aims to show the generally expected result in the real pages.
1204
1204
Everyone is welcome to contribute to the test cases!
1205
1205
@@ -1221,9 +1221,9 @@ NOTE: The values of <var>alignWeight</var> and <var>orthogonalWeight</var> in th
1221
1221
</figure>
1222
1222
1223
1223
In the case above, the search origin element and the candidate element are aligned and the requested direction is {{SpatialNavigationDirection/right}}.
1224
-
The <a>intersecting area</a> is created with
1224
+
The <a>intersecting area</a> is created with
1225
1225
(1) The gap between two elements.
1226
-
(2) The parts of the edges from each element which are overlapped
1226
+
(2) The parts of the edges from each element which are overlapped
1227
1227
when the right edge of the search origin element and the left edge of the candidate are projected to each other.
1228
1228
</div>
1229
1229
</div>
@@ -1369,7 +1369,7 @@ the proper spatial navigation behavior.
1369
1369
<dd>If the element is a <a>scroll container</a>,
1370
1370
then directional input moves the focus to the candidates in the optimal viewing region.
1371
1371
When there isn't any visible candidate, then the container scrolls.
1372
-
1372
+
1373
1373
Otherwise, the focus moves to the candidates in the viewport.
1374
1374
1375
1375
<dt><dfn>focus</dfn>
@@ -1409,7 +1409,7 @@ Pressing the right arrow key moves the focus directly to it without scrolling ma
0 commit comments