Skip to content

Commit 6edfe1f

Browse files
committed
[css-nav-1] trailing spaces and line-breaking tweaks
See https://rhodesmill.org/brandon/2012/one-sentence-per-line/ for rationale on line breaking
1 parent 2bcfde1 commit 6edfe1f

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

css-nav-1/Overview.bs

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,9 @@ either because it is not a scrollable element
201201
or because it is already scrolled to the maximum in that direction,
202202
the User Agent will select the next <a>spatial navigation focus container</a> up the ancestry chain.
203203

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,
207207
otherwise, going up to the next container
208208
is repeated until the ancestry chain reaches the root element.
209209

@@ -213,7 +213,7 @@ the elements that are reachable by sequential navigation
213213
and by spatial navigation are almost the same:
214214
* Elements that are currently outside of the viewport of a scrollable element
215215
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.
217217
For instance, those are out of reach because they are placed at a negative offset.
218218
</div>
219219

@@ -499,7 +499,7 @@ Note: the {{focusableAreas()}} and {{getSpatialNavigationContainer()}} methods a
499499
<div class=example id=focusAreas-visible>
500500
The following code shows how to get all the visible focusable elements in the current page using {{Element/focusableAreas()}}.
501501
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,
503503
the focusable element which isn’t inside the <a>scrollport</a> is excluded from the result.
504504

505505
<pre><code highlight=markup>
@@ -982,15 +982,15 @@ To run the <dfn>spatial navigation steps</dfn> in <var>direction</var>, do the f
982982

983983
and return if the result is <code>false</code>.</span>
984984
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.
987987
* Else, fallback to the next step.
988988
6. Let <var>container</var> be the nearest ancestor of <var>eventTarget</var> that is a <a>spatial navigation container</a>.
989989
7. <i>Loop</i>: Let <var>candidates</var> be the result of <a>finding focusable areas</a>
990990
within <var>container</var>, excluding <var>searchOrigin</var>
991991
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.
994994
* Else,
995995
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
996996
<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
10131013
9. Let <var>bestCandidate</var> be the result of <a>selecting the best candidate</a>
10141014
within <var>candidates</var> in <var>direction</var> starting from <var>searchOrigin</var>.
10151015
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:
10171017
* Set {{NavigationEvent/dir}} to <var>direction</var>
10181018
* Set {{NavigationEvent/relatedTarget}} to <var>bestCandidate</var>
10191019
* Set <code>bubbles</code> and <code>cancelable</code> attributes to <code>true</code>
@@ -1133,20 +1133,20 @@ run the following steps:
11331133
whose boundary goes through the geometric center of the <var>searchOrigin</var>
11341134
and is perpendicular to <var>dir</var>.
11351135
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>
11371137
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>
11391139
and find the point <var>P2</var> inside the <a>boundary box</a>.
11401140
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>.
11431143
5. Return the item of the <var>candidates</var> set that has the smallest <var>distance</var>.
11441144
If several have the same distance,
11451145
return the first one in document order,
11461146
unless its [=boundary box=] overlaps with the [=boundary box=] of an other item at the same distance,
11471147
and that item is higher in the CSS [=painting order=].
11481148
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.
11501150

11511151
</div>
11521152

@@ -1168,9 +1168,9 @@ The meaning of each factor in the function is as follows:
11681168
<dd>Defined as <pre class="prod">(absolute distance on the axis orthogonal to <var>dir</var> + <var>orthogonalBias</var>) * <var>orthogonalWeight</var></pre>
11691169

11701170
* <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}},
11721172
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}},
11741174
width of <var>searchOrigin</var> / 2
11751175

11761176
* <var>orthogonalWeight</var>:
@@ -1183,23 +1183,23 @@ The meaning of each factor in the function is as follows:
11831183

11841184
* <var>alignBias</var>
11851185

1186-
* If the <var>dir</var> is {{SpatialNavigationDirection/left}} or {{SpatialNavigationDirection/right}},
1186+
* If the <var>dir</var> is {{SpatialNavigationDirection/left}} or {{SpatialNavigationDirection/right}},
11871187
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}},
11891189
width of <var>intersectRect</var> / width of <var>candidate</var>
11901190

11911191
* <var>alignWeight</var> is 5
11921192

11931193
<dt><var>sqrt(Overlap)</var>
11941194
<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
11961196
<var>intersectRect</var> if the <a>overlapping area</a> exists,
11971197
and 0 otherwise.
11981198
<dd>Defined as <pre class="prod">sqrt(height of <var>overlapRect</var> * width of <var>overlapRect</var>)</pre>
11991199
</dl>
12001200

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>.
12031203
It aims to show the generally expected result in the real pages.
12041204
Everyone is welcome to contribute to the test cases!
12051205

@@ -1221,9 +1221,9 @@ NOTE: The values of <var>alignWeight</var> and <var>orthogonalWeight</var> in th
12211221
</figure>
12221222

12231223
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
12251225
(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
12271227
when the right edge of the search origin element and the left edge of the candidate are projected to each other.
12281228
</div>
12291229
</div>
@@ -1369,7 +1369,7 @@ the proper spatial navigation behavior.
13691369
<dd>If the element is a <a>scroll container</a>,
13701370
then directional input moves the focus to the candidates in the optimal viewing region.
13711371
When there isn't any visible candidate, then the container scrolls.
1372-
1372+
13731373
Otherwise, the focus moves to the candidates in the viewport.
13741374

13751375
<dt><dfn>focus</dfn>
@@ -1409,7 +1409,7 @@ Pressing the right arrow key moves the focus directly to it without scrolling ma
14091409
grid-template-columns: repeat(1, 1fr);
14101410
height: 300px;
14111411
width: 200px;
1412-
overflow-y: scroll;
1412+
overflow-y: scroll;
14131413
spatial-navigation-action: focus;
14141414
}
14151415
.item {

0 commit comments

Comments
 (0)