@@ -15,6 +15,7 @@ At risk: {{getSpatialNavigationContainer()}}
1515At risk : {{focusableAreas()}}
1616At risk : 'spatial-navigation-contain'
1717At risk : ''spatial-navigation-action: scroll''
18+ At risk : 'spatial-navigation-function'
1819</pre>
1920<pre class="anchors">
2021spec: ui-events; urlPrefix: https://w3c.github.io/uievents/;
@@ -1496,6 +1497,56 @@ Pressing the down arrow key moves the focus directly to it without scrolling man
14961497
14971498</div>
14981499
1500+ <h3 id=css-property-spatialnavigationfunction>
1501+ Selecting the navigation algorithm: the 'spatial-navigation-function' property</h3>
1502+
1503+ <pre class='propdef'>
1504+ Name : spatial-navigation-function
1505+ Value : normal | grid
1506+ Initial : normal
1507+ Applies to : <a>spatial navigation container</a>
1508+ Inherited : yes
1509+ </pre>
1510+
1511+ Depending on the layout types, the default algorithm of spatial navigation may need the fine tune.
1512+
1513+ <dl dfn-for=spatial-navigation-function dfn-type=value>
1514+ <dt> <dfn>normal</dfn>
1515+ <dd>
1516+ Moves the focus with the default focus navigation algorithm defined by UA.
1517+ In general, the focus moves to the closest element from the <a>spatial navigation starting point</a> .
1518+
1519+ <dt> <dfn>grid</dfn>
1520+ <dd>
1521+ Moves the focus to the closest element based on 2D rectilinear distance.
1522+
1523+ If there are more than one aligned candidates in the navigation direction,
1524+ Among the aligned candidates, select the best one as a result of the calculation from the distance
1525+ along the axis which corresponds to the navigation direction.
1526+ In case of best candidates more than two, select the best one with the minimum amount of alignment.
1527+
1528+ Else if there isn't any aligned candidate in a given direction,
1529+ Among not aligned)candidates, select the best ones as a result of calculation from the distance
1530+ along the axis which corresponds to the navigation direction.
1531+ In case of best candidates more than two, select the best one with the minimum distance
1532+ along the axis which is orthogonal to the navigation direction.
1533+ </dl>
1534+
1535+ <div class=example>
1536+ This example shows how the focus moves differently by the value of <code> spatial-navigation-function</code> .
1537+
1538+ <figure>
1539+ <img alt="" src="images/spatnav-function.png" style="width: 500px;"/>
1540+ <figcaption> Moving focus from "A" to one of the candidate elements</figcaption>
1541+ </figure>
1542+
1543+ Let the element which contains "A", "B", "C" and "D" is the <a>spatial navigation focus container</a> .
1544+
1545+ If <code> normal</code> value is given to <code> spatial-navigation-function</code> of the element,
1546+ when the user presses the down arrow key, the focus will move to "C".
1547+ Otherwise, <code> grid</code> was specified to the element, the focus will move to "B".
1548+ </div>
1549+
14991550<h2 class=no-num id=scrolling>Appendix A. Scroll extensions</h2>
15001551
15011552This section proposes a few extensions to CSS
0 commit comments