Skip to content

Commit f17e249

Browse files
author
Jihye Hong
committed
[css-nav-1] Modify the step for selecting inside elements
1. Modify the making the set of "insiders" in selecting the best candidate steps: 1) From the search origin, fully overlapped elements and partially overlapped elements depending on the requested direction are included in the "insiders" 2) Element which aren't overlapped with the search origin is "outsiders" (*outsider isn't specified in the spec) 2. Modify the selecting the best candidate steps as 1) find the closest element among "insiders" 1-1) if there is one, it is the best candidate 1-2) else fall back to the next step 2) find the closest element among "outsiders" using distance function (https://drafts.csswg.org/css-nav-1/#find-the-shortest-distance) Related to : #4483
1 parent 1631265 commit f17e249

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

css-nav-1/Overview.bs

+9-14
Original file line numberDiff line numberDiff line change
@@ -1167,12 +1167,15 @@ run the following steps:
11671167
1. If <var>candidates</var> is <a spec=infra for=set>empty</a>, return <code>null</code>
11681168
2. If <var>candidates</var> contains a single item, return that item
11691169
3. Let <var>insiders</var> be the subset of <var>candidates</var>
1170-
* If <var>searchOrigin</var> is the <a>spatial navigation container</a>, whose <a>boundary box</a>'s
1171-
* top edge is below the top edge of <a>inside area</a> of <var>searchOrigin</var> if <var>dir</var> is {{SpatialNavigationDirection/down}}
1172-
* bottom edge is above the bottom edge of <a>inside area</a> of <var>searchOrigin</var> if <var>dir</var> is {{SpatialNavigationDirection/up}}
1173-
* right edge is left of the right edge of <a>inside area</a> of <var>searchOrigin</var> if <var>dir</var> is {{SpatialNavigationDirection/left}}
1174-
* left edge is right of the left edge of <a>inside area</a> of <var>searchOrigin</var> if <var>dir</var> is {{SpatialNavigationDirection/right}}
1175-
* Else, whose boundary box fully overlaps with <a>inside area</a> of <var>searchOrigin</var>.
1170+
* whose boundary box fully overlaps with <a>inside area</a> of <var>searchOrigin</var>
1171+
* whose boundary box partially overlaps with <a>inside area</a> of <var>searchOrigin</var> as
1172+
* top edge is below the top edge of <var>searchOrigin</var>'s <a>boundary box</a> if <var>dir</var> is {{SpatialNavigationDirection/down}}
1173+
* bottom edge is above the bottom edge of <var>searchOrigin</var>'s <a>boundary box</a> if <var>dir</var> is {{SpatialNavigationDirection/up}}
1174+
* right edge is left of the right edge of <var>searchOrigin</var>'s <a>boundary box</a> if <var>dir</var> is {{SpatialNavigationDirection/left}}
1175+
* left edge is right of the left edge of <var>searchOrigin</var>'s <a>boundary box</a> if <var>dir</var> is {{SpatialNavigationDirection/right}}
1176+
1177+
NOTE: More detail condition about how the element is overlapped with the search origin affects the sequence of focus movement.
1178+
The sequence of focus movement is related to UX, so it depends on the UA-defined mechanism.
11761179

11771180
Note: this sub-setting is necessary to avoid going in the opposite direction than the one requested.
11781181
4.
@@ -1196,14 +1199,6 @@ run the following steps:
11961199
* bottom edge is above the top edge of <var>searchOrigin</var>'s <a>boundary box</a> if <var>dir</var> is {{SpatialNavigationDirection/up}}
11971200
* right edge is left of the left edge of <var>searchOrigin</var>'s <a>boundary box</a> if <var>dir</var> is {{SpatialNavigationDirection/left}}
11981201
* left edge is right of the right edge of <var>searchOrigin</var>'s <a>boundary box</a> if <var>dir</var> is {{SpatialNavigationDirection/right}}
1199-
* the item partially overlaps with <var>searchOrigin</var> and its <a>boundary box</a>'s
1200-
* top edge is below the top edge of <var>searchOrigin</var>'s <a>boundary box</a> if <var>dir</var> is {{SpatialNavigationDirection/down}}
1201-
* bottom edge is above the bottom edge of <var>searchOrigin</var>'s <a>boundary box</a> if <var>dir</var> is {{SpatialNavigationDirection/up}}
1202-
* right edge is left of the right edge of <var>searchOrigin</var>'s <a>boundary box</a> if <var>dir</var> is {{SpatialNavigationDirection/left}}
1203-
* left edge is right of the left edge of <var>searchOrigin</var>'s <a>boundary box</a> if <var>dir</var> is {{SpatialNavigationDirection/right}}
1204-
1205-
NOTE: More detail condition about how the element is overlapped with the search origin affects the sequence of focus movement.
1206-
The sequence of focus movement is related to UX, so it depends on the UA-defined mechanism.
12071202

12081203
2. For each <var ignore="">candidate</var> in <var>candidates</var>,
12091204
[=find the shortest distance=] between <var>searchOrigin</var>.

0 commit comments

Comments
 (0)