WICG / layout-instability

A proposal for a Layout Instability specification
https://wicg.github.io/layout-instability/
Other
158 stars 26 forks source link

Case of sticky sidebars changing from absolute to fixed #99

Closed pacifier007 closed 3 years ago

pacifier007 commented 3 years ago

Almost all the sticky sidebars, done in a smarter way than the naive position: sticky solution, use the trick where they transition from position: absolute to position: fixed and back depending on scroll. However they don't really cause layout shifts.

For example a popular sticky solution here: https://somewebmedia.github.io/hc-sticky/demo_1.html (it's the same with every solution/library out there, but I just found this example first)

You can see that while scrolling whenever they sidebar gets sticky it's staying in the view and causes no real layout shift, yet it's detected as a layout shift. The readability of content isn't affected in any way, and the sidebar content is staying in view without being shifted.

I believe this should get the same treatment is using position: sticky.

skobes-chromium commented 3 years ago

I think this is fixed in Chrome 90 by http://crrev.com/849650.