Re: [csswg-drafts] [css-overflow] set element as document scrolling element (#4710)

[Scroll-behavior](https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-behavior) lets you prevent scroll from chaining up to the parent. It won't affect things like scrollbars though - you'd have to hide those yourself somehow. For that I'm not sure there's a great solution - you could just apply ::webkit-scrollbar styles to hide the scrollbars but that only works in Blink/WebKit and also might incur layout issues.

There's also [root-scroller](https://github.com/bokand/root-scroller/blob/master/explainer.md) which shipped in Chrome. It lets you mark a single scroller on the page as the "main content" and we give it all the special UX that only the documentElement gets today.

There wasn't any interest from other vendors to make this more flexible with an API so we've limited it to an implicitly applied UA feature. However, because it's implicitly applied, we're rather restricted in how often we can apply it to prevent breaking pages inadvertently. We'll only promote an element to the root-scroller if it meets a rather [rigid set of criteria](https://github.com/bokand/root-scroller/blob/master/explainer.md#implicit-root-scroller). 

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

Received on Wednesday, 29 January 2020 00:48:29 UTC