Skip to content

Commit 2bcfde1

Browse files
committed
[css-nav-1] Bikeshed fixes
1 parent 1b3d41b commit 2bcfde1

File tree

1 file changed

+31
-28
lines changed

1 file changed

+31
-28
lines changed

css-nav-1/Overview.bs

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -477,21 +477,23 @@ Note: the {{focusableAreas()}} and {{getSpatialNavigationContainer()}} methods a
477477
<div algorithm="getSpatialNavigationContainer steps">
478478
: <dfn method for=Element lt="getSpatialNavigationContainer()">{{Element/getSpatialNavigationContainer()}}</dfn>
479479
:: Follows these steps:
480-
1. Return the element if it is a <a>spatial navigation container</a>,
481-
or the nearest ancestor of the element that is a <a>spatial navigation container</a>,
482-
or the <a>document</a> if the nearest <a>spatial navigation container</a> is the viewport.
480+
1. Return the element if it is a <a>spatial navigation container</a>,
481+
or the nearest ancestor of the element that is a <a>spatial navigation container</a>,
482+
or the <a>document</a> if the nearest <a>spatial navigation container</a> is the viewport.
483+
483484
</div>
484485

485486
<div algorithm="focusableAreas steps">
486487
: <dfn method for=Element lt="focusableAreas(option)">focusableAreas(<var>option</var>)</dfn>
487488
:: Follows these steps:
488-
1. Let <var>visibleOnly</var> be <code>false</code>
489-
if <var>option</var> is present and its value is equal to <code>'all'</code>,
490-
or <code>true</code> otherwise.
491-
2. Let <var>areas</var> be the result of <a>finding focusable areas</a> within the element with the <var>visibleOnly</var>.
492-
3. Let <var>anchors</var> be a <a for=list>clone</a> of <var>areas</var>,
493-
with every <a>focusable area</a> which is not itself a <a>Node</a> replaced with its <a>DOM anchor</a>.
494-
4. Return <var>anchors</var>
489+
1. Let <var>visibleOnly</var> be <code>false</code>
490+
if <var>option</var> is present and its value is equal to <code>'all'</code>,
491+
or <code>true</code> otherwise.
492+
2. Let <var>areas</var> be the result of <a>finding focusable areas</a> within the element with the <var>visibleOnly</var>.
493+
3. Let <var>anchors</var> be a <a for=list>clone</a> of <var>areas</var>,
494+
with every <a>focusable area</a> which is not itself a <a>Node</a> replaced with its <a>DOM anchor</a>.
495+
4. Return <var>anchors</var>
496+
495497
</div>
496498

497499
<div class=example id=focusAreas-visible>
@@ -526,14 +528,14 @@ Note: the {{focusableAreas()}} and {{getSpatialNavigationContainer()}} methods a
526528
<div algorithm="spatialNavigationSearch steps">
527529
: <dfn method for=Element lt="spatialNavigationSearch(options)">spatialNavigationSearch(<var>options</var>)</dfn>
528530
:: Follows these steps:
529-
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.
537539

538540
Note: When neither a container nor a list of candidates is provided,
539541
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
981983
and return if the result is <code>false</code>.</span>
982984
3. Run the <a>focusing steps</a> for <var>bestCandidate</var> and return
983985
* 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.
985987
* Else, fallback to the next step.
986988
6. Let <var>container</var> be the nearest ancestor of <var>eventTarget</var> that is a <a>spatial navigation container</a>.
987989
7. <i>Loop</i>: Let <var>candidates</var> be the result of <a>finding focusable areas</a>
988990
within <var>container</var>, excluding <var>searchOrigin</var>
989991
8. If <var>candidates</var> is empty:
990992
* 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.
992994
* Else,
993995
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
994996
<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:
11451147
and that item is higher in the CSS [=painting order=].
11461148
In that case, return that item instead,
11471149
unless it too is overlapped with another higher item at the same distance, recursively.
1150+
11481151
</div>
11491152

11501153
<div algorithm="to calculate the distance">
@@ -1166,9 +1169,9 @@ The meaning of each factor in the function is as follows:
11661169

11671170
* <var>orthogonalBias</var>
11681171
* 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
11701173
* 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
11721175

11731176
* <var>orthogonalWeight</var>:
11741177
* 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:
11811184
* <var>alignBias</var>
11821185

11831186
* 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>
11851188
* 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>
11871190

11881191
* <var>alignWeight</var> is 5
11891192

@@ -1229,7 +1232,7 @@ NOTE: The values of <var>alignWeight</var> and <var>orthogonalWeight</var> in th
12291232
<h2 id=declarative>
12301233
Controlling spatial navigation through declarative means</h2>
12311234

1232-
<h3 id=css-property-spatialnavigationcontain>
1235+
<h3 id=container>
12331236
Creating additional spatial navigation containers: the 'spatial-navigation-contain' property</h3>
12341237

12351238
<pre class='propdef'>
@@ -1372,15 +1375,15 @@ the proper spatial navigation behavior.
13721375
<dt><dfn>focus</dfn>
13731376
<dd>The directional input moves the focus to all candidates inside a scroll container. The container <a>cannot be scrolled manually</a>.
13741377

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
13771380
the <a>spatial navigation container</a> even through the container can be scrolled more.
13781381

13791382
<dt><dfn>scroll</dfn>
13801383
<dd>If the element is a <a>scroll container</a>,
13811384
then directional input only works for manually scrolling the container.
13821385

1383-
Note: The 'scroll' value is <a>at-risk</a>.
1386+
Note: The ''spatial-navigation-ation/scroll'' value is <a>at-risk</a>.
13841387
</dl>
13851388

13861389
<div class=example>

0 commit comments

Comments
 (0)