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
+45-16Lines changed: 45 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -88,7 +88,7 @@ the specification remains the full document.
88
88
89
89
<input type=checkbox id=api-check><label for=api-check>Hide JavaScript APIs, including events</label><br>
90
90
<input type=checkbox id=cssapi-check><label for=cssapi-check>Hide CSS properties that enable selecting behavior variants, and related information</label><br>
91
-
<input type=checkbox id=verbose-check><label for=verbose-check>Hide informative sections that explain and summarise normative sections without adding more information</label><br>
91
+
<input type=checkbox id=verbose-check><label for=verbose-check>Hide informative sections that explain and summarize normative sections without adding more information</label><br>
92
92
93
93
<h2 id="intro" class=non-normative>
94
94
Introduction</h2>
@@ -209,7 +209,7 @@ until it has either moved focus,
209
209
scrolled,
210
210
or reached the root.
211
211
212
-
Note: As a consequnce of this processing model,
212
+
Note: As a consequence of this processing model,
213
213
the elements that are reachable by sequential navigation
214
214
and by spatial navigation are almost the same:
215
215
elements that are currently outside of the viewport of a scrollable element
@@ -394,7 +394,7 @@ JavaScript API</h2>
394
394
<h3 id=high-level-api>
395
395
Triggering Navigation Programmatically</h3>
396
396
397
-
The {{Window/navigate()}} method enables the author to trigger spatial navigation programatically,
397
+
The {{Window/navigate()}} method enables the author to trigger spatial navigation programmatically,
398
398
as if the user had done so manually
399
399
(for instance, by pressing the arrow keys in a browser where that is the way to trigger spatial navigation).
400
400
@@ -483,14 +483,44 @@ The {{Element/getSpatialNavigationContainer()}} method must follow these steps:
483
483
484
484
<div algorithm="focusableAreas steps">
485
485
The {{Element/focusableAreas()}} method must follow these steps:
486
-
1. Let <var>v</var> be <code>false</code>
487
-
if the argument's {{FocusableAreasOptions/mode}} attribute if present and equal to <code>"all"</code>,
486
+
1. Let <var>visibleOnly</var> be <code>false</code>
487
+
if the argument's {{FocusableAreasOptions/mode}} attribute is present and equal to <code>'all'</code>,
488
488
or <code>true</code> otherwise.
489
-
4. Let <var>areas</var> be the result of <a>finding focusable areas</a> within the element with the visibleOnly argument set to <var>v</var>
489
+
2. Let <var>areas</var> be the result of <a>finding focusable areas</a> within the element with the <var>visibleOnly</var> argument.
490
+
3. Loop: If there is a <a>spatial navigation container</a><var>container</var> among <var>areas</var>,
491
+
then add the result of <a>finding focusable areas</a> to <var>areas</var> within the <var>container</var>.
490
492
5. Let <var>anchors</var> be a <a for=list>clone</a> of <var>areas</var>,
491
493
with every <a>focusable area</a> which is not itself a <a>Node</a> replaced with its <a>DOM anchor</a>.
492
494
6. Return <var>anchors</var>
495
+
</div>
496
+
497
+
<div class=example id=focusAreas-visible>
498
+
The following code shows how to get all the visible focusable elements in the current page using {{Element/focusableAreas()}}.
499
+
If the method finds a <a>spatial navigation container</a>, it recursively finds focusable areas inside it.
500
+
However, <code>'visible'</code> is given to the {{FocusableAreasOptions/mode}} attribute of this method,
501
+
the focusable element which isn’t inside the <a>scrollport</a> is excluded from the result.
0 commit comments