Skip to content

Commit 4ce8f75

Browse files
author
Jihye Hong
committed
[css-nav-1] Drop inside option from spatialNavigationSearch API
Drop `inside` option from `spatialNavigationSearch` because it's risky
1 parent 7a80121 commit 4ce8f75

File tree

1 file changed

+1
-38
lines changed

1 file changed

+1
-38
lines changed

css-nav-1/Overview.bs

+1-38
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,6 @@ dictionary FocusableAreasOption {
462462
dictionary SpatialNavigationSearchOptions {
463463
sequence<Node>? candidates;
464464
Node? container;
465-
boolean inside = false;
466465
};
467466

468467
partial interface Element {
@@ -540,13 +539,7 @@ the User Agent must run the steps described below:
540539
if it is not <code>null</code>, the element's nearest <a>spatial navigation container</a> ancestor otherwise.
541540
3. Let <var>areas</var> be the value of {{SpatialNavigationSearchOptions/candidates}} attribute of <var>options</var>
542541
if it is not <code>null</code>, result of <a>finding focusable areas</a> within <var>container</var> otherwise.
543-
4. Let <var>insideFirst</var> be the value of {{SpatialNavigationSearchOptions/inside}} attribute of <var>options</var>
544-
if it is not <code>null</code>, <code>false</code> otherwise.
545-
5. If <var>insideFirst</var> is <code>true</code>,
546-
then let <var>bestCandidate</var> be the result of <a>selecting the best candidate</a> among <var>areas</var> within the element with <var>direction</var>.
547-
* If <var>bestCandidate</var> is not <code>null</code>, return <var>bestCandidate</var>.
548-
* Else, fall back to the next step.
549-
6. Return the result of <a>selecting the best candidate</a> among <var>areas</var> in <var>direction</var> from the element.
542+
4. Return the result of <a>selecting the best candidate</a> among <var>areas</var> within <var>container</var> in <var>direction</var> from the element.
550543

551544
Note: When neither a container nor a list of candidates is provided,
552545
this only searches through the visible focusable areas of the nearest
@@ -622,36 +615,6 @@ and the result will be <code>null</code>.</em>
622615
</div>
623616
</div>
624617

625-
<div class=example id=searchInside>
626-
This example shows different results of {{Element/spatialNavigationSearch()}}
627-
depending on the value of {{SpatialNavigationSearchOptions/inside}} attribute.
628-
629-
When the page has the code snippet as below,
630-
631-
<pre><code highlight=markup>
632-
&lt;body>
633-
&lt;div id="container" style="width:300px; height:200px; overflow-y: scroll;">
634-
&lt;button id="button1" style = "width:50px; height:50px;">&lt;/button>
635-
&lt;/div>
636-
&lt;button id="button2" style = "width:50px; height:50px;">&lt;/button>
637-
&lt;/body>
638-
</code></pre>
639-
640-
<pre><code highlight=javascript>
641-
const container = document.getElementById('container');
642-
643-
const innerBtn = container.spatialNavigationSearch('down', {inside: true});
644-
const outerBtn = container.spatialNavigationSearch('down');
645-
</code></pre>
646-
647-
<code>innerBtn</code> is assigned to the element whose {{Element/id}} matches with <code>button1</code>
648-
because the {{SpatialNavigationSearchOptions/inside}} attribute is <code>true</code>.
649-
But if the author doesn't specify {{SpatialNavigationSearchOptions/inside}} attribute,
650-
<code>false</code> is given to it by default.
651-
Therefore <code>outerBtn</code> is assigned to the element with {{Element/id}} <code>button2</code>
652-
which is outside of <code>container</code>.
653-
</div>
654-
655618
<div class=api>
656619
<h2 id="events-navigationevent">
657620
Navigation Events</h2>

0 commit comments

Comments
 (0)