Skip to content

Commit b528ec2

Browse files
author
Jihye Hong
authored
Merge pull request w3c#4369 from jihyerish/revise-select-candidate
[css-nav-1] Fix the unreachability for a focusable element inside the search origin
2 parents 015bc0e + d80493f commit b528ec2

File tree

1 file changed

+23
-16
lines changed

1 file changed

+23
-16
lines changed

css-nav-1/Overview.bs

+23-16
Original file line numberDiff line numberDiff line change
@@ -995,9 +995,9 @@ To run the <dfn>spatial navigation steps</dfn> in <var>direction</var>, do the f
995995

996996
and return if the result is <code>false</code>.</span>
997997
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>
10011001
* Else, fallback to the next step.
10021002
* Else, fallback to the next step.
10031003
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:
10661066
* if the object is a [=box=] or [=box fragment=], the boundary box is the <a>border box</a> of that box or fragment
10671067
* 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>
10681068

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:
10701070
* if the object is a <a>scroll container</a>, its <a>optimal viewing region</a>
10711071
* 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>
10721073
* otherwise, the <a>optimal viewing region</a> of its nearest ancestor <a>scroll container</a>
10731074

1075+
NOTE: If an object is offscreen, the <a>inside area</a> should be the nearest visible ancestor container.
1076+
10741077
Issue(w3c/csswg-drafts#2324): CSS should have a term for “border box taking into account corner shaping properties like border-radius”.
10751078

10761079
The <dfn>search origin</dfn> is the origin for searching next target.
@@ -1159,11 +1162,13 @@ run the following steps:
11591162
1. If <var>candidates</var> is <a spec=infra for=set>empty</a>, return <code>null</code>
11601163
2. If <var>candidates</var> contains a single item, return that item
11611164
3. Let <var>insiders</var> be the subset of <var>candidates</var>
1165+
* If <var>searchOrigin</var> is the <a>spatial navigation container</a>,
11621166
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>.
11671172

11681173
Note: this sub-setting is necessary to avoid going in the opposite direction than the one requested.
11691174
4.
@@ -1180,19 +1185,21 @@ run the following steps:
11801185
and that item is higher in the CSS [=painting order=].
11811186
In that case, return that item instead,
11821187
unless it too is overlapped with another higher item, recursively.
1183-
11841188
* 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>.
11891197
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>.
11921199
3. Return the item of the <var>candidates</var> set that has the smallest distance.
11931200
If several have the same distance,
11941201
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,
11961203
and that item is higher in the CSS [=painting order=].
11971204
In that case, return that item instead,
11981205
unless it too is overlapped with another higher item at the same distance, recursively.

0 commit comments

Comments
 (0)