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
+34-20
Original file line number
Diff line number
Diff line change
@@ -975,29 +975,43 @@ To run the <dfn>spatial navigation steps</dfn> in <var>direction</var>, do the f
975
975
4. If <var>eventTarget</var> is the <a>Document</a> or the <a>document element</a>,
976
976
set <var>eventTarget</var> be <a>the body element</a> if it is not <code>null</code>
977
977
or to the <a>document element</a> otherwise.
978
-
5. If <var>searchOrigin</var> is either a <a>scroll container</a> or the <a>document</a>
979
-
1. Let <var>candidates</var> be the result of <a>finding focusable areas</a>
980
-
within <var>searchOrigin</var>
981
-
2.
982
-
* If <var>candidates</var> contains at least 1 item:
983
-
1. Let <var>bestCandidate</var> be the result of <a>selecting the best candidate</a>
984
-
within <var>candidates</var> in <var>direction</var> starting from <var>searchOrigin</var>
985
-
2. 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
986
-
<span class=api><a>fire an event</a> named <a event>navbeforefocus</a> at <var>eventTarget</var> using {{NavigationEvent}} with:
987
-
* {{NavigationEvent/dir}} set to <var>direction</var>
988
-
* {{NavigationEvent/relatedTarget}} set to <var>bestCandidate</var>
989
-
* the <code>bubbles</code> and <code>cancelable</code> attributes set to <code>true</code>
990
-
991
-
and return if the result is <code>false</code>.</span>
992
-
3. Run the <a>focusing steps</a> for <var>bestCandidate</var> and return
993
-
* Else if <var>eventTarget</var><a>can be manually scrolled</a>,
994
-
<a>directionally scroll the element</a><var>eventTarget</var> in <var>direction</var> and return.
995
-
* Else, fallback to the next step.
978
+
5.
979
+
* If <var>searchOrigin</var> is <a>scroll container</a>
980
+
and the computed value of the 'spatial-navigation-action' property on <var>searchOrigin</var> is ''spatial-navigation-action/scroll''
981
+
and <var>searchOrigin</var>[=can be manually scrolled=],
982
+
then [=directionally scroll the element=]<var>searchOrigin</var> and return.
983
+
* Else, if <var>searchOrigin</var> is either a <a>scroll container</a> or the <a>document</a>
984
+
1. Let <var>candidates</var> be the result of <a>finding focusable areas</a>
985
+
within <var>searchOrigin</var>
986
+
with the argument set to <code>false</code> if computed value of the 'spatial-navigation-action' property on <var>searchOrigin</var> is ''spatial-navigation-action/focus''
987
+
or to <code>true</code> otherwise.
988
+
2.
989
+
* If <var>candidates</var> contains at least 1 item:
990
+
1. Let <var>bestCandidate</var> be the result of <a>selecting the best candidate</a>
991
+
within <var>candidates</var> in <var>direction</var> starting from <var>searchOrigin</var>
992
+
2. 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
993
+
<span class=api><a>fire an event</a> named <a event>navbeforefocus</a> at <var>eventTarget</var> using {{NavigationEvent}} with:
994
+
* {{NavigationEvent/dir}} set to <var>direction</var>
995
+
* {{NavigationEvent/relatedTarget}} set to <var>bestCandidate</var>
996
+
* the <code>bubbles</code> and <code>cancelable</code> attributes set to <code>true</code>
997
+
998
+
and return if the result is <code>false</code>.</span>
999
+
3. Run the <a>focusing steps</a> for <var>bestCandidate</var> and return
1000
+
* Else if the computed value of the 'spatial-navigation-action' property on <var>eventTarget</var> is not ''spatial-navigation-action/focus''
1001
+
and <var>eventTarget</var><a>can be manually scrolled</a>,
1002
+
then <a>directionally scroll the element</a><var>eventTarget</var> in <var>direction</var> and return.
1003
+
* Else, fallback to the next step.
1004
+
* Else, fallback to the next step.
996
1005
6. Let <var>container</var> be the nearest ancestor of <var>eventTarget</var> that is a <a>spatial navigation container</a>.
997
1006
7. <i>Loop</i>: Let <var>candidates</var> be the result of <a>finding focusable areas</a>
998
-
within <var>container</var>, excluding <var>searchOrigin</var>
1007
+
within <var>container</var>
1008
+
with the argument set to <code>false</code>
1009
+
if computed value of the 'spatial-navigation-action' property on <var>container</var> is ''spatial-navigation-action/focus''
1010
+
or to <code>true</code> otherwise,
1011
+
excluding <var>searchOrigin</var>
999
1012
8. If <var>candidates</var> is empty:
1000
-
* If <var>container</var> is a <a>scroll container</a> that <a>can be manually scrolled</a>,
1013
+
* If the computed value of the 'spatial-navigation-action' property on <var>container</var> is not ''spatial-navigation-action/focus''
1014
+
and <var>container</var> is a <a>scroll container</a> that <a>can be manually scrolled</a>,
1001
1015
<a>directionally scroll the element</a><var>container</var> in <var>direction</var> and return.
1002
1016
* Else,
1003
1017
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
0 commit comments