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
* Fix the confusing usages of 'search origin' terminology
* Add the definition of "Dispatching navbeforefocus event" and "Dispatching navnotarget event"
<dd>The <a>spatial navigation container</a> that was searched in.
791
807
@@ -795,6 +811,13 @@ when it cannot be scrolled further.
795
811
</tbody>
796
812
</table>
797
813
814
+
The User Agent <dfn lt="dispatches navnotarget event | dispatching navnotarget event">dispatches <a event>navnotarget</a> event</dfn>
815
+
with initializing the <a>event target</a> as the element which has focus and
816
+
the {{NavigationEvent/relatedTarget}} as <a>spatial navigation container</a> of the <a>event target</a>.
817
+
818
+
If <a>navigation-override</a> is disabled in the [=node document=] of <var>eventTarget</var> for
819
+
the <a spec=html for="/">origin</a> of the [=active document=] of the [=top-level browsing context=], this event won't be dispatched.
820
+
798
821
<div class='example'>
799
822
This example shows the [[UI-EVENTS#event-order]] when pressing the <code class=key>ArrowDown</code>
800
823
key in the situation like the following figure.
@@ -947,7 +970,6 @@ to fully define the behavior.
947
970
Issue(w3c/csswg-drafts#3376): The following currently does not account
948
971
for <a href="https://github.com/WICG/overscroll-behavior">the proposed overscroll-behavior specification</a>.
949
972
950
-
951
973
<h3 id=grouping>
952
974
Groupings of elements</h3>
953
975
@@ -996,15 +1018,15 @@ To run the <dfn>spatial navigation steps</dfn> in <var>direction</var>, do the f
996
1018
set <var>eventTarget</var> be <a>the body element</a> if it is not <code>null</code>
997
1019
or to the <a>document element</a> otherwise.
998
1020
4. <ul>
999
-
<span class=cssapi><li>If <var>searchOrigin</var> is <a>scroll container</a>
1000
-
and the computed value of the 'spatial-navigation-action' property on <var>searchOrigin</var> is ''spatial-navigation-action/scroll''
1001
-
and <var>searchOrigin</var>[=can be manually scrolled=],
1002
-
then [=directionally scroll the element=]<var>searchOrigin</var> and return.</li></span>
1003
-
<li><span class=cssapi>Else,</span> if <var>searchOrigin</var> is either a <a>scroll container</a> or the <a>document</a>
1021
+
<span class=cssapi><li>If <var>eventTarget</var> is <a>scroll container</a>
1022
+
and the computed value of the 'spatial-navigation-action' property on <var>eventTarget</var> is ''spatial-navigation-action/scroll''
1023
+
and <var>eventTarget</var>[=can be manually scrolled=],
1024
+
then [=directionally scroll the element=]<var>eventTarget</var> and return.</li></span>
1025
+
<li><span class=cssapi>Else,</span> if <var>eventTarget</var> is either a <a>scroll container</a> or the <a>document</a>
1004
1026
1. Let <var>candidates</var> be the result of <a>finding focusable areas</a>
1005
-
within <var>searchOrigin</var>
1027
+
within <var>eventTarget</var>
1006
1028
with the argument <var>visibleOnly</var> set to <code>false</code>
1007
-
<span class=cssapi>if computed value of the 'spatial-navigation-action' property on <var>searchOrigin</var>
1029
+
<span class=cssapi>if computed value of the 'spatial-navigation-action' property on <var>eventTarget</var>
1008
1030
is ''spatial-navigation-action/focus'' or to <code>true</code> otherwise.
1009
1031
</span>
1010
1032
2.
@@ -1016,17 +1038,9 @@ To run the <dfn>spatial navigation steps</dfn> in <var>direction</var>, do the f
1016
1038
<li><span class=cssapi>Else </span>if <var>candidates</var> contains at least 1 item:
1017
1039
1. Let <var>bestCandidate</var> be the result of <a>selecting the best candidate</a>
1018
1040
within <var>candidates</var> in <var>direction</var> starting from <var>searchOrigin</var>
1019
-
<p class=api>
1020
-
2. If <a>navigation-override</a><a>is enabled</a> in the [=node document=] of <var>eventTarget</var> for
1021
-
the <a spec=html for="/">origin</a> of the [=active document=] of the [=top-level browsing context=], then
1022
-
<a>fire an event</a> named <a event>navbeforefocus</a> at <var>eventTarget</var> using {{NavigationEvent}} with:
1023
-
<ul>
1024
-
<li>{{NavigationEvent/dir}} set to <var>direction</var>
1025
-
<li>{{NavigationEvent/relatedTarget}} set to <var>bestCandidate</var>
1026
-
<li>the <code>bubbles</code> and <code>cancelable</code> attributes set to <code>true</code>
1027
-
</ul>
1028
-
and return if the result is <code>false</code>.
1029
-
</p>
1041
+
<p class=api>
1042
+
2. <a>Dispatches navbeforefocus event</a> at <var>eventTarget</var> with <var>direction</var> and <var>bestCandidate</var>.
1043
+
</p>
1030
1044
3. Run the <a>focusing steps</a> for <var>bestCandidate</var> and return
1031
1045
</li>
1032
1046
<li>Else, fall back to the next step.</li>
@@ -1041,7 +1055,7 @@ To run the <dfn>spatial navigation steps</dfn> in <var>direction</var>, do the f
1041
1055
<span class=cssapi>
1042
1056
if computed value of the 'spatial-navigation-action' property on <var>container</var> is ''spatial-navigation-action/focus''
1043
1057
or to <code>true</code> otherwise,
1044
-
excluding <var>searchOrigin</var>
1058
+
excluding <var>eventTarget</var>
1045
1059
</span>
1046
1060
7. If <var>candidates</var> is empty:
1047
1061
<ul>
@@ -1050,34 +1064,22 @@ To run the <dfn>spatial navigation steps</dfn> in <var>direction</var>, do the f
1050
1064
<a>directionally scroll the element</a><var>container</var> in <var>direction</var> and return.
1051
1065
</li></span>
1052
1066
<span class=cssapi><li>Else,</li></span>
1053
-
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
1054
-
<span class=api><a>fire an event</a> named <a event>navnotarget</a> at <var>eventTarget</var> using {{NavigationEvent}} with:
1055
-
* {{NavigationEvent/dir}} set to <var>direction</var>
1056
-
* {{NavigationEvent/relatedTarget}} set to <var>container</var>
1057
-
* the <code>bubbles</code> and <code>cancelable</code> attributes set to <code>true</code>
1058
-
1059
-
and return if the result is <code>false</code>.</span>
1067
+
1. <a>Dispatches navnotarget event</a> at <var>eventTarget</var> with <var>direction</var> and <var>container</var>.
1060
1068
2.
1061
1069
* If <var>container</var> is the <a>document element</a> of the <a>top-level browsing context</a>,
1062
1070
then return.
1063
1071
The User Agent may transfer focus to its own controls (if any) honouring <var>direction</var>.
1064
1072
* Else, if <var>container</var> is the <a>document element</a> of a <a>nested browsing context</a> then:
1065
1073
1. Set <var>searchOrigin</var> to <var>container</var>'s <a>browsing context container</a>
1066
1074
2. Set <var>eventTarget</var> be <var>searchOrigin</var>
1067
-
3. Set <var>container</var> to the nearest ancestor of <var>searchOrigin</var> that is a <a>spatial navigation container</a>.
1075
+
3. Set <var>container</var> to the nearest ancestor of <var>eventTarget</var> that is a <a>spatial navigation container</a>.
1068
1076
4. Return to the step labeled <i>loop</i>.
1069
1077
* Else, set <var>container</var> to its closest ancestor that is itself a <a>spatial navigation container</a>
1070
1078
and return to the step labeled <i>loop</i>.
1071
1079
</ul>
1072
1080
8. Let <var>bestCandidate</var> be the result of <a>selecting the best candidate</a>
1073
-
within <var>candidates</var> in <var>direction</var> starting from <var>searchOrigin</var>.
1074
-
9. 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
1075
-
<span class=api><a>fire an event</a> named <a event>navbeforefocus</a> at <var>eventTarget</var> using {{NavigationEvent}} with:
1076
-
* {{NavigationEvent/dir}} set to <var>direction</var>
1077
-
* {{NavigationEvent/relatedTarget}} set to <var>bestCandidate</var>
1078
-
* the <code>bubbles</code> and <code>cancelable</code> attributes set to <code>true</code>
1079
-
1080
-
and return if the result is <code>false</code>.</span>
1081
+
within <var>candidates</var> in <var>direction</var> starting from <var>eventTarget</var>.
1082
+
9. <a>Dispatches navnotarget event</a> at <var>eventTarget</var> with <var>direction</var> and <var>bestCandidate</var>.
1081
1083
10. Run the <a>focusing steps</a> for <var>bestCandidate</var> and return.
0 commit comments