Example: - https://s.codepen.io/mirisuzanne/debug/yLBNpdQ Expected Behavior: - `scroll-padding` and `scroll-snap-type` should be applied to the default viewport scrolling. Actual Behavior: - Neither property is applied, so there is no scroll-snapping or scroll offset applied - The demo only works if you set the properties on `body` instead of `html`, which is counter-to-spec and breaks the (proper) Firefox implementation Related: - Chrome bug: https://bugs.chromium.org/p/chromium/issues/detail?id=952711 - CSSWG discussion: https://github.com/w3c/csswg-drafts/issues/3740 [Note that *neither* `body` nor `html` seems to work inside an iframe, which is why I link to the "debug" view in codepen. The original pen is available here: https://codepen.io/mirisuzanne/pen/yLBNpdQ?editors=1100)
<rdar://problem/54277211>
As of Chrome 78, Blink is changing its behavior [1] to match specification and Gecko. Hopefully we will manage to get this done without lots of compat issues which should help Safari to attempt the fix as well. [1] https://bugs.chromium.org/p/chromium/issues/detail?id=952711
I think the propagate from <body> too, right?
> I think the propagate from <body> too, right? While that is true for 'overflow' but it not the case for these more recent properties such as 'scroll-snap-type' and others. The scroll-snap spec is explicit about this now: https://drafts.csswg.org/css-scroll-snap/#scroll-snap-type "UAs must apply the scroll-snap-type value set on the root element to the document viewport. Note that, unlike overflow, scroll-snap-type values are not propagated from HTML body." The relevant spec discussion and decision are documented here: https://github.com/w3c/csswg-drafts/issues/3740
Now that issue 210469 is closed, these properties do propagate from <html>, but they still propagate from <body> for backwards-compatibility reasons. Perhaps this bug could be repurposed to track the possible eventual removal of propagation from <body>
Pull request: https://github.com/WebKit/WebKit/pull/3287
Committed 253430@main (54380c808801): <https://commits.webkit.org/253430@main> Reviewed commits have been landed. Closing PR #3287 and removing active labels.