@@ -535,19 +535,20 @@ the User Agent must run the steps described below:
535535</div>
536536
537537<div algorithm="spatialNavigationSearch steps">
538- : <dfn method for=Element lt="spatialNavigationSearch(options)">spatialNavigationSearch(<var>options</var>)</dfn>
538+ : <dfn method for=Element lt="spatialNavigationSearch(options)">spatialNavigationSearch(<var>dir</var>, <var> options</var>)</dfn>
539539::
540- 1. Let <var> direction</var> be the value of {{SpatialNavigationSearchOptions/dir}} attribute of <var> options</var> .
541- 2.
542- * If the value of {{SpatialNavigationSearchOptions/candidates}} attribute of <var> options</var> is not <code> null</code> ,
543- then let <var> areas</var> be the that value
544- * else,
545- 1.
546- * If the value of {{SpatialNavigationSearchOptions/container}} attribute of <var> options</var> is not <code> null</code> ,
547- let <var> container</var> be that value
548- * else, let <var> container</var> be the element's nearest <a>spatial navigation container</a> ancestor.
549- 2. Let <var> areas</var> be the result of <a>finding focusable areas</a> within <var> container</var> .
550- 3. Return the result of <a>selecting the best candidate</a> within <var> areas</var> in direction <var> direction</var> from the element.
540+ 1. Let <var> direction</var> be the value of <var> dir</var> .
541+ 2. Let <var> container</var> be the the value of {{SpatialNavigationSearchOptions/container}} attribute of <var> options</var>
542+ if it is not <code> null</code> , the element's nearest <a>spatial navigation container</a> ancestor otherwise.
543+ 3. Let <var> areas</var> be the value of {{SpatialNavigationSearchOptions/candidates}} attribute of <var> options</var>
544+ if it is not <code> null</code> , result of <a>finding focusable areas</a> within <var> container</var> otherwise.
545+ 4. Let <var> insideFirst</var> be the value of {{SpatialNavigationSearchOptions/inside}} attribute of <var> options</var>
546+ if it is not <code> null</code> , <code> false</code> otherwise.
547+ 5. If <var> insideFirst</var> is <code> true</code> ,
548+ then let <var> bestCandidate</var> be the result of <a>selecting the best candidate</a> within element with <var> direction</var> .
549+ * If <var> bestCandidate</var> is not <code> null</code> , return <var> bestCandidate</var> .
550+ * Else, fallback to the next step.
551+ 6. Return the result of <a>selecting the best candidate</a> within <var> areas</var> in <var> direction</var> from the element.
551552
552553Note: When neither a container nor a list of candidates is provided,
553554this only searches through the visible focusable areas of the nearest
0 commit comments