Re: [csswg-drafts] [css-nav-1] changing the spatnav scroll controls from JS to declarative (#3401)

I agree with the overall definition of `navnotarget` after dropping `navbeforescroll`.

But the moment when `navnotarget` occurs differs from the condition of candidates (all or visible) seems unnatural to me. It causes inconstant behavior when the scroll container can be scrolled more or not.

Instead, how about define the CSS property as below?

```css
spatial-navigation-behavior: auto | focus | scroll 
(or spatial-navigation-action)
```

* `auto`: The directional input will move the focus to the visible candidates inside the spatial navigation container. If there isn't any visible candidate, the user can manually scroll the container. (current spec)
* `focus`: The directional input will move the focus to candidates(visible or not) inside the spatial navigation container. The user cannot manually scroll the container.
* `scroll`: The directional input will only scroll the spatial navigation container. Moving the focus inside the container doesn't work with the directional input.
  
  * e.g. The container made by the iframe with RSS feeds. In this case, the author may want to make it scroll, not move the focus inside it.

I guess in comparison with your proposal,
`spatial-navigation-candidates: visible` works the same with `spatial-navigation-behavior: auto`
and
`spatial-navigation-candidates: all` is same with `spatial-navigation-behavior: focus`.

Also, the definition of `navnotarget` would be changed to "The event occurs when there won't be any **action with the directional input** for the spatial navigation container before going up the tree to search candidates in the nearest ancestor spatial navigation container".

"**action with the directional input** " above will be 
moving the focus and scrolling if the container is specified as `spatial-navigation-behavior: auto`,
or
just moving the focus (without scrolling) if the container is specified as `spatial-navigation-behavior: focus`.

This way can support the feature of `navbeforescroll` and solve the performance issue.
More detail about the feature of `navbeforescroll`, there will be
(1) Move the focus directly to the invisible candidates in the spatial navigation container
(2) Move the focus directly to a virtual candidate which will be created and added inside the spatial navigation container when the scroll reaches to the end (as the virtual scroller).

(1) is implemented with `spatial-navigation-behavior: focus`.

(2) can be implemented using `navnotarget` and `spatial-navigation-behavior: focus` as below:
   i) when the spatial navigation container (the related target of `navnotarget`) is specified with `spatial-navigation-behavior: focus`
   ii) `navnotarget` occurs if there isn't any candidate (visible or not) in the spatial navigation container no matter what it can be scrolled more or not

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

Received on Monday, 18 February 2019 08:02:16 UTC