Re: [csswg-drafts] [css-nav-1] Clarify how sptialNavigationSearch() works (#3743)

>- add an isContainer() (or some similar name) method to element

I think this new API would be useful because it would be frequently used.
But `isSpatialNavigationContainer()` seems better name.

>- inside spatialNavigationSearch(options)'s definition change point 2.else.1.else to
>>else, let container be the element if it is a spatial navigation container, or its nearest spatial navigation container ancestor otherwise.

I think `spatialNavigationSearch(options)`'s default container needs to be set as the **nearest ancestor spatial navigation container** always.
Because this behavior should be the same as the behavior of [`getSpatialNavigationContainer()`](https://drafts.csswg.org/css-nav-1/#dom-element-getspatialnavigationcontainer).
`getSpatialNavigationContainer()` always returns the nearest ancestor spatial navigation container of the target element. 
If those aren't the same, it will confuse the author because of the inconsistent methodology.

Also, with this change, if the author wants to find the best candidate outside of the target element ,
a line of code will be:
`elm.spatialNavigationSearch("right", {container: elm.getSpatialNavigationContainer()});`
Calling the function inside another is sometimes inconvenient, especially when this type of code is used frequently.
This would be much simpler in the suggestion, like:
`elm.spatialNavigationSearch(“right");`

-- 
GitHub Notification of comment by jihyerish
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3743#issuecomment-501164930 using your GitHub account

Received on Wednesday, 12 June 2019 08:03:27 UTC