-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
High CLS without actual content shifting #10873
Comments
Thanks very much for filing this @marto55555! Lots going on here I think we might want to break apart this into a few separate issues.
|
I looked into the high CLS through DevTools’ layout shift regions highlighting. I thought this might be useful for you too, so here's what I found, from most to least significant:
For now, I won’t push any updates to the web app, to make it easier for you to fully investigate :) |
Thanks for the additional information @marto55555, great investigation!
Thanks very much for your offer to leave the site as-is. I don't want to block your dev flow though :) If it's possible to throw it onto a free static hosting site such as http://surge.sh/ where it can sit without bothering anyone that would be amazing, but for now I've taken a snapshot of the Lighthouse artifacts so at least we can observe the trace events at a later date. |
No, it's only while in the viewport. As you've said, the small size of the spinner should have a negligible effect on CLS. However, LH currently "tracks" the spinner area as if it was much larger (size of a sliding card + slightly more). This is particularly noticeable for viewport width>900px -- when 2 cards are on the same row, with the network set to Fast/Slow 3G. Thanks for being considerate of dev flow! I've uploaded this version to https://splighthouse.marti.bg for your future investigations :) |
Ah, do you have the spinner wrapped in a div that's the size of a card? If the spinner were implemented with margin I wouldn't expect the area tracked to be very large. This to me is one of those stupid "fixes" that doesn't change the UX in anyway but makes the metric happy. |
Nope, it's directly placed after the Apparently, I was wrong about the spinner being the problem. Instead, it's 2 things around it:
|
Because CLS doesn't account for empty content. Sorry, but I don't know what else to tell ya I didn't design CLS :) I think it would make sense to raise this in Chromium though in the layout stability API. https://melodic-class.glitch.me/cls-empty.html is a particularly damning example of CLS being completely unrelated to perceived user layout shifts. |
Filed WICG/layout-instability#45 👍 |
admin edit: moved to dedicated issue: #11601 |
Thanks @widmanski! That appears to be a separate issue that's specific to web.dev/PSI, would you mind moving your comment to a new issue we could track separately? :) |
Looks like this was resolved in WICG/layout-instability#96 Closing! |
Provide the steps to reproduce
https://bonusi.soft-press.com/https://splighthouse.marti.bg (or onhttps://bonusi.soft-press.com/allhttps://splighthouse.marti.bg/all)What is the current behavior?
The CLS jumps from 0 to seemingly random higher value, despite no visible layout shifts in the preview pane. The value is higher on web.dev than on DevTools. "Avoid large layout shifts" returns "Error!", or gives different elements on every run. See screen recordings.zip
What is the expected behavior?
The CLS should stay at 0, as it does with Simulated throttling on.
Environment Information
Related issues
The text was updated successfully, but these errors were encountered: