Re: [csswg-drafts] [cssom-view] Add notIfViewed to ScrollIntoViewOptions; add FocusScrollOptions

Thank you for your analysis and comments @anawhj! 

Let me try to state my understanding, so we can reach common ground.

* `preventScroll: true` + IntersectionObserver + `scrollIntoView()` handles all use cases, but might not be so convenient.
* Making https://drafts.csswg.org/cssom-view/#smooth-scrolling apply to scrolls caused by moved focus would be a convenient way to enable smooth scrolling for `focus()`. https://github.com/w3c/csswg-drafts/issues/1783
* Customizing scrolling for `focus()` in a convenient manner, but less clear and less powerful compared to the first item in this list, could be done with a nested dictionary. The semantics and naming here is still under discussion. We agree that it shouldn't cover differentiating for the partially visible case, since that would make it too complicated.

To your points:

1. <blockquote>I suggest "if-hidden" that means scrolling only if the element is hidden (partially or entirely in the view).</blockquote>
   
   Sounds good to me.
2. <blockquote> scroll to scrollMode </blockquote>
   
   Sounds good to me. 
3. <blockquote> The default values of FocusScrollOptions would be same as ScrollIntoViewOptions</blockquote> 
   
   Why? The primary reason for introducing `FocusScrollOptions`, as explained in https://github.com/whatwg/html/pull/2787#issuecomment-328801350 , is that omitting the dictionary should be equivalent to specifying an empty dictionary. Compare with https://github.com/w3c/csswg-drafts/issues/1720 . As noted by @jihyerish above https://github.com/w3c/csswg-drafts/pull/1805#issuecomment-331383688 the current browser behavior for `focus()` does not match that of `scrollIntoView()`. Therefore, the defaults for focus need to be different. Since we don't yet have interoperability on how `focus()` scrolls, what those defaults should be is up to the UA. We should work towards interoperability on that, but that can be separated imo.

-- 
GitHub Notification of comment by zcorpan
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/pull/1805#issuecomment-336809834 using your GitHub account

Received on Monday, 16 October 2017 08:00:40 UTC