W3C home > Mailing lists > Public > public-css-archive@w3.org > June 2019

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

From: Jihye Hong via GitHub <sysbot+gh@w3.org>
Date: Wed, 12 Jun 2019 08:03:26 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-501164930-1560326605-sysbot+gh@w3.org>
>- 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

This archive was generated by hypermail 2.4.0 : Tuesday, 19 October 2021 01:31:10 UTC