Expected vs. Unexpected Layout Shifts

47 views
Skip to first unread message

Arielle Aurrichio

unread,
Feb 16, 2021, 6:32:48 PM2/16/21
to Chrome UX Report (Discussions)
In my initial analysis, it appears expected layout shifts have a significant impact on Cumulative Layout Shift (CLS.) For example, sessions where a sign-up prompt was displayed to the user perform worse on CLS. 

Isn't the purpose of CLS to prevent unexpected layout shifts. Is there an implementation tactic to avoid being "penalized" for expected layout shifts? 

Anthony RICAUD

unread,
Feb 17, 2021, 7:25:01 AM2/17/21
to Chrome UX Report (Discussions), Arielle Aurrichio
The definition of expected vs unexpected is "there's been a user input in the 500ms before this layout shift". In the API, performance entries have a `hadRecentInput` boolean flag to help differentiate those. Is the sign up prompt displayed after a user click? If it is, the next question is: does the prompt wait for an AJAX request to complete before being displayed? If it does, there's a chance that AJAX request takes more than 500ms.

Without an example, it's difficult to diagnose what the issue you're seeing is. https://web.dev/cls/ and https://web.dev/optimize-cls are good introductions to understand what's happening.

Boris Schapira

unread,
Feb 17, 2021, 9:24:37 AM2/17/21
to Anthony RICAUD, Chrome UX Report (Discussions), Arielle Aurrichio
Definition of expected vs unexpected layout shifts also lacks nuance when layout shifts are provoked by client-side plugins. 
If you're using a plugin to replace the web font by a webfont adapted for dyslexia, you're producing layout shifts that are recorded and added to the global experience of your website.

-- 


--
You received this message because you are subscribed to the Google Groups "Chrome UX Report (Discussions)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chrome-ux-repo...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chrome-ux-report/08e397ac-eaa7-4d8e-901a-ba6a8bf7687en%40chromium.org.
Reply all
Reply to author
Forward
0 new messages