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
+23-16
Original file line number
Diff line number
Diff line change
@@ -995,9 +995,9 @@ To run the <dfn>spatial navigation steps</dfn> in <var>direction</var>, do the f
995
995
996
996
and return if the result is <code>false</code>.</span>
997
997
3. Run the <a>focusing steps</a> for <var>bestCandidate</var> and return
998
-
<span class=cssapi>* Else if the computed value of the 'spatial-navigation-action' property on <var>eventTarget</var> is not ''spatial-navigation-action/focus''
999
-
and <var>eventTarget</var><a>can be manually scrolled</a>,
1000
-
then <a>directionally scroll the element</a><var>eventTarget</var> in <var>direction</var> and return.</span>
998
+
<span class=cssapi>* Else if the computed value of the 'spatial-navigation-action' property on <var>eventTarget</var> is not ''spatial-navigation-action/focus''
999
+
and <var>eventTarget</var><a>can be manually scrolled</a>,
1000
+
then <a>directionally scroll the element</a><var>eventTarget</var> in <var>direction</var> and return.</span>
1001
1001
* Else, fallback to the next step.
1002
1002
* Else, fallback to the next step.
1003
1003
5. Let <var>container</var> be the nearest ancestor of <var>eventTarget</var> that is a <a>spatial navigation container</a>.
@@ -1066,11 +1066,14 @@ The <dfn>boundary box</dfn> of an object is defined as follows:
1066
1066
* if the object is a [=box=] or [=box fragment=], the boundary box is the <a>border box</a> of that box or fragment
1067
1067
* if the object is a <a>focusable area</a> which is not an element, the boundary box is the axis-aligned the bounding box of that <a>focusable area</a>
1068
1068
1069
-
The <dfn>inside area</dfn> of an object is defined as follows:
1069
+
The <dfn>inside area</dfn> of an object is defined as follows:
1070
1070
* if the object is a <a>scroll container</a>, its <a>optimal viewing region</a>
1071
1071
* if the object is a <a>document</a>, the viewport of its <a>browsing context</a>
1072
+
* if the object is a [=box=] or [=box fragment=], its <a>boundary box</a>
1072
1073
* otherwise, the <a>optimal viewing region</a> of its nearest ancestor <a>scroll container</a>
1073
1074
1075
+
NOTE: If an object is offscreen, the <a>inside area</a> should be the nearest visible ancestor container.
1076
+
1074
1077
Issue(w3c/csswg-drafts#2324): CSS should have a term for “border box taking into account corner shaping properties like border-radius”.
1075
1078
1076
1079
The <dfn>search origin</dfn> is the origin for searching next target.
@@ -1159,11 +1162,13 @@ run the following steps:
1159
1162
1. If <var>candidates</var> is <a spec=infra for=set>empty</a>, return <code>null</code>
1160
1163
2. If <var>candidates</var> contains a single item, return that item
1161
1164
3. Let <var>insiders</var> be the subset of <var>candidates</var>
1165
+
* If <var>searchOrigin</var> is the <a>spatial navigation container</a>,
1162
1166
whose <a>boundary box</a>'s
1163
-
* top edge is below the top edge of <a>inside area</a> of <var>searchOrigin</var> if <var>dir</var> is {{SpatialNavigationDirection/down}}
1164
-
* bottom edge is above the bottom edge of <a>inside area</a> of <var>searchOrigin</var> if <var>dir</var> is {{SpatialNavigationDirection/up}}
1165
-
* right edge is left of the right edge of <a>inside area</a> of <var>searchOrigin</var> if <var>dir</var> is {{SpatialNavigationDirection/left}}
1166
-
* left edge is right of the left edge of <a>inside area</a> of <var>searchOrigin</var> if <var>dir</var> is {{SpatialNavigationDirection/right}}
1167
+
* top edge is below the top edge of <a>inside area</a> of <var>searchOrigin</var> if <var>dir</var> is {{SpatialNavigationDirection/down}}
1168
+
* bottom edge is above the bottom edge of <a>inside area</a> of <var>searchOrigin</var> if <var>dir</var> is {{SpatialNavigationDirection/up}}
1169
+
* right edge is left of the right edge of <a>inside area</a> of <var>searchOrigin</var> if <var>dir</var> is {{SpatialNavigationDirection/left}}
1170
+
* left edge is right of the left edge of <a>inside area</a> of <var>searchOrigin</var> if <var>dir</var> is {{SpatialNavigationDirection/right}}
1171
+
* Else, whose boundary box fully overlaps with <a>inside area</a> of <var>searchOrigin</var>.
1167
1172
1168
1173
Note: this sub-setting is necessary to avoid going in the opposite direction than the one requested.
1169
1174
4.
@@ -1180,19 +1185,21 @@ run the following steps:
1180
1185
and that item is higher in the CSS [=painting order=].
1181
1186
In that case, return that item instead,
1182
1187
unless it too is overlapped with another higher item, recursively.
1183
-
1184
1188
* Else
1185
-
1. Set <var>candidates</var> be the subset of its items
1186
-
whose <a>boundary box</a>'s geometric center is within the closed half plane
1187
-
whose boundary goes through the geometric center of the <var>searchOrigin</var>
1188
-
and is perpendicular to <var>dir</var>.
1189
+
1. Set <var>candidates</var> be the subset of its items which satisfies one of the following conditions:
1190
+
* the item overlaps with <var>searchOrigin</var> and its <a>boundary box</a>'s
1191
+
* top edge is below the bottom edge of <var>searchOrigin</var>'s <a>boundary box</a> if <var>dir</var> is {{SpatialNavigationDirection/down}}
1192
+
* bottom edge is above the top edge of <var>searchOrigin</var>'s <a>boundary box</a> if <var>dir</var> is {{SpatialNavigationDirection/up}}
1193
+
* right edge is left of the left edge of <var>searchOrigin</var>'s <a>boundary box</a> if <var>dir</var> is {{SpatialNavigationDirection/left}}
1194
+
* left edge is right of the right edge of <var>searchOrigin</var>'s <a>boundary box</a> if <var>dir</var> is {{SpatialNavigationDirection/right}}
1195
+
* the item partially overlaps with <var>searchOrigin</var> and
1196
+
its two edges which are orthogonal to <var>dir</var> should be on the navigation direction of the respective ones of <var>searchOrigin</var>.
1189
1197
2. For each <var>candidate</var> in <var>candidates</var>,
1190
-
[=find the shortest distance=] between <var>searchOrigin</var> and <var>candidate</var>
1191
-
in direction <var>dir</var>.
1198
+
[=find the shortest distance=] between <var>searchOrigin</var>.
1192
1199
3. Return the item of the <var>candidates</var> set that has the smallest distance.
1193
1200
If several have the same distance,
1194
1201
return the first one in document order,
1195
-
unless its [=boundary box=] overlaps with the [=boundary box=] of an other item at the same distance,
1202
+
unless its [=boundary box=] overlaps with the [=boundary box=] of another item at the same distance,
1196
1203
and that item is higher in the CSS [=painting order=].
1197
1204
In that case, return that item instead,
1198
1205
unless it too is overlapped with another higher item at the same distance, recursively.
0 commit comments