w3c / csswg-drafts

CSS Working Group Editor Drafts
https://drafts.csswg.org/
Other
4.51k stars 669 forks source link

[css-overscroll-behavior] Should we propagate non-auto overscroll-behavior from either root element or body? #6406

Open xidachen opened 3 years ago

xidachen commented 3 years ago

According to the spec: https://drafts.csswg.org/css-overscroll/Overview.html, the overscroll-behavior should propagate from the root element.

At this moment, many websites put the non-auto overscroll-behavior in the body element instead of root. Some examples are: open.spotify.com reddit.com (mobile version) www.tumblr.com www.tiktok.com www.redfin.com www.tinder.com www.tesla.com www.pinterest.com

It is likely that there is a long list of sites and I only know some of them. I believe in this case, the intended behavior of these websites is actually to propagate the non-auto overscroll-behavior from the body element.

This is an interop issue because Chrome propagates overscroll-behavior from the body element, while Firefox from the root element.

Should we change the spec such that a non-auto overscroll-behavior is propagated from either root or body? Here are the specific cases:

  1. root is non-auto, body is auto: propagate from root
  2. root is auto, body is non-auto: propagate from body
  3. both root and body are non-auto: propagate from root

With this change, the websites listed above don't need to change their sites at all, and we will get consistent behavior cross all browser vendors.

Loirooriol commented 3 years ago

Relevant resolutions from https://github.com/w3c/csswg-drafts/issues/6079#issuecomment-816307011:

RES0LVED: No future properties should propagate from <body> to the ICB RES0LVED: deprecate any existing use of body propagation