@@ -1025,25 +1025,25 @@ Issue(23): The focusing steps should probably reset the <a>spatial navigation st
1025
1025
<div algorithm="to run the spatial navigation steps">
1026
1026
To run the <dfn>spatial navigation steps</dfn> in <var> direction</var> , do the following:
1027
1027
1028
- 1. Let <var> startingPoint </var> be the <a>DOM anchor</a> of the <a>currently focused area of a top-level browsing context</a> .
1028
+ 1. Let <var> searchOrigin </var> be the <a>DOM anchor</a> of the <a>currently focused area of a top-level browsing context</a> .
1029
1029
2. If the <a>spatial navigation starting point</a> is not <code> null</code>
1030
- and it is inside <var> startingPoint </var>
1031
- then set <var> startingPoint </var> to the <a>spatial navigation starting point</a>
1030
+ and it is inside <var> searchOrigin </var>
1031
+ then set <var> searchOrigin </var> to the <a>spatial navigation starting point</a>
1032
1032
3.
1033
- * If <var> startingPoint </var> is an <a>node</a> ,
1034
- let <var> eventTarget</var> be <var> startingPoint </var>
1035
- * else (<a>assert</a> : the starting point is a position)
1036
- let <var> eventTarget</var> be the <a>node</a> which contains <var> startingPoint </var>
1033
+ * If <var> searchOrigin </var> is an <a>node</a> ,
1034
+ let <var> eventTarget</var> be <var> searchOrigin </var>
1035
+ * else (<a>assert</a> : <var> searchOrigin </var> is a position)
1036
+ let <var> eventTarget</var> be the <a>node</a> which contains <var> searchOrigin </var>
1037
1037
4. If <var> eventTarget</var> is the <a>Document</a> or the <a>document element</a> ,
1038
1038
set <var> eventTarget</var> be <a>the body element</a> if it is not <code> null</code>
1039
1039
or to the <a>document element</a> otherwise.
1040
- 5. If <var> startingPoint </var> is either a <a>scroll container</a> or the <a>document</a>
1040
+ 5. If <var> searchOrigin </var> is either a <a>scroll container</a> or the <a>document</a>
1041
1041
1. Let <var> candidates</var> be the result of <a>finding focusable areas</a>
1042
- within <var> startingPoint </var>
1042
+ within <var> searchOrigin </var>
1043
1043
2.
1044
1044
* If <var> candidates</var> contains at least 1 item:
1045
1045
1. Let <var> bestCandidate</var> be the result of <a>selecting the best candidate</a>
1046
- within <var> candidates</var> in <var> direction</var> starting from <var> startingPoint </var>
1046
+ within <var> candidates</var> in <var> direction</var> starting from <var> searchOrigin </var>
1047
1047
2. <span class=api> <a>Fire an event</a> named <a event>navbeforefocus</a> at <var> eventTarget</var> using {{NavigationEvent}}
1048
1048
with its {{NavigationEvent/dir}} set to <var> direction</var> and {{NavigationEvent/relatedTarget}} set to <var> bestCandidate</var>
1049
1049
and with it's <code> bubbles</code> and <code> cancelable</code> attributes set to <code> true</code> ,
@@ -1059,7 +1059,7 @@ To run the <dfn>spatial navigation steps</dfn> in <var>direction</var>, do the f
1059
1059
* Else, fallback to the next step
1060
1060
6. Let <var> container</var> be the nearest ancestor of <var> eventTarget</var> that is a <a>spatial navigation container</a> .
1061
1061
7. <i> Loop</i> : Let <var> candidates</var> be the result of <a>finding focusable areas</a>
1062
- within <var> container</var> , excluding <var> startingPoint </var>
1062
+ within <var> container</var> , excluding <var> searchOrigin </var>
1063
1063
8. If <var> candidates</var> is empty:
1064
1064
* If <var> container</var> is a <a>scroll container</a> that <a>can be manually scrolled</a> :
1065
1065
1. <span class=api> <a>Fire an event</a> named <a event>navbeforescroll</a> at <var> eventTarget</var> using {{NavigationEvent}}
@@ -1078,16 +1078,16 @@ To run the <dfn>spatial navigation steps</dfn> in <var>direction</var>, do the f
1078
1078
then return.
1079
1079
The User Agent may transfer focus to its own controls (if any) honouring <var> direction</var> .
1080
1080
* Else, if <var> container</var> is the <a>document element</a> of a <a>nested browsing context</a> then:
1081
- 1. Set <var> startingPoint </var> to <var> container</var> 's <a>browsing context container</a>
1082
- 2. Set <var> eventTarget</var> be <var> startingPoint </var>
1083
- 3. Set <var> container</var> to the nearest ancestor of <var> startingPoint </var> that is a <a>spatial navigation container</a> .
1081
+ 1. Set <var> searchOrigin </var> to <var> container</var> 's <a>browsing context container</a>
1082
+ 2. Set <var> eventTarget</var> be <var> searchOrigin </var>
1083
+ 3. Set <var> container</var> to the nearest ancestor of <var> searchOrigin </var> that is a <a>spatial navigation container</a> .
1084
1084
4. Return to the step labeled <i> loop</i> .
1085
1085
1086
1086
Issue(28): is it sane from a security standpoint that this propagates up from iframes?
1087
1087
* Else, set <var> container</var> to its closest ancestor that is itself a <a>spatial navigation container</a>
1088
1088
and return to the step labeled <i> loop</i> .
1089
1089
9. Let <var> bestCandidate</var> be the result of <a>selecting the best candidate</a>
1090
- within <var> candidates</var> in <var> direction</var> starting from <var> startingPoint </var>
1090
+ within <var> candidates</var> in <var> direction</var> starting from <var> searchOrigin </var>
1091
1091
10. <span class=api> <a>Fire an event</a> named <a event>navbeforefocus</a> at <var> eventTarget</var> using {{NavigationEvent}}
1092
1092
with its {{NavigationEvent/dir}} set to <var> direction</var> and {{NavigationEvent/relatedTarget}} set to <var> bestCandidate</var>
1093
1093
and with it's <code> bubbles</code> and <code> cancelable</code> attributes set to <code> true</code> ,
@@ -1167,17 +1167,17 @@ follow the following steps:
1167
1167
To <dfn lt="select the best candidate | selecting the best candidate">select the best candidate</dfn>
1168
1168
within a <a spec=infra for="/">set</a> of <var> candidates</var>
1169
1169
in a direction <var> dir</var> ,
1170
- starting from <var> starting point </var> ,
1170
+ starting from <var> searchOrigin </var> ,
1171
1171
follow the following steps:
1172
1172
1173
1173
1. If <var> candidates</var> is <a spec=infra for=set>empty</a> , return <code> null</code>
1174
1174
2. If <var> candidates</var> contains a single item, return that item
1175
1175
3. Let <var> insideArea</var> be
1176
- * the <a>optimal viewing region</a> of <var> starting point </var> if <var> starting point </var> is a <a>scroll container</a> ,
1177
- * the viewport if <var> starting point </var> is a <a>Document</a> ,
1178
- * the <a>border box</a> of <var> starting point </var> otherwise.
1176
+ * the <a>optimal viewing region</a> of <var> searchOrigin </var> if <var> searchOrigin </var> is a <a>scroll container</a> ,
1177
+ * the viewport if <var> searchOrigin </var> is a <a>Document</a> ,
1178
+ * the <a>border box</a> of <var> searchOrigin </var> otherwise.
1179
1179
4. Let <var> insiders</var> be the subset of <var> candidates</var> items
1180
- whose [=DOM anchor=] are descendants of <var> starting point </var>
1180
+ whose [=DOM anchor=] are descendants of <var> searchOrigin </var>
1181
1181
and whose <a>boundary box</a> 's
1182
1182
* top edge is below the top edge of <var> insideArea</var> if <var> D</var> is <code> down</code>
1183
1183
* bottom edge is above the bottom edge of <var> insideArea</var> if <var> D</var> is <code> up</code>
@@ -1203,10 +1203,10 @@ follow the following steps:
1203
1203
* Else
1204
1204
1. Set <var> candidates</var> be the subset of its items
1205
1205
whose <a>boundary box</a> 's geometric center is within the closed half plane
1206
- whose boundary goes through the geometric center of the <var> starting point </var>
1206
+ whose boundary goes through the geometric center of the <var> searchOrigin </var>
1207
1207
and is perpendicular to <var> D</var> .
1208
1208
2. For each <var> candidate</var> in <var> candidates</var> ,
1209
- find the points <var> P1</var> inside the <a>boundary box</a> of <var> starting point </var>
1209
+ find the points <var> P1</var> inside the <a>boundary box</a> of <var> searchOrigin </var>
1210
1210
and <var> P2</var> inside the <a>boundary box</a> of <var> candidate</var>
1211
1211
that minimize the <var> distance</var> between these two points,
1212
1212
when <var> distance</var> is defined as follows:
@@ -1225,7 +1225,7 @@ follow the following steps:
1225
1225
<dd> The absolute distance in the direction which is orthogonal to <var> dir</var> between <var> P1</var> and <var> P2</var>
1226
1226
1227
1227
<dt><var> D</var> :
1228
- <dd> The square root of the area of intersection between the <a>boundary boxes</a> of <var> candidate</var> and <var> starting point </var>
1228
+ <dd> The square root of the area of intersection between the <a>boundary boxes</a> of <var> candidate</var> and <var> searchOrigin </var>
1229
1229
</dl>
1230
1230
3. Return the item of the <var> candidates</var> set that has the smallest <var> distance</var> .
1231
1231
If several have the same distance,
0 commit comments