Does Cumulative Layout Shift stop measuring on user-interaction?

邮差的信 提交于 2021-02-02 09:46:06

问题


Does the Cumulative Layout Shift metric stop measuring on user-interaction? Google's guidance on Cumulative Layout Shift says:

Layout shifts that occur in response to user interactions (clicking a link, pressing a button, typing in a search box and similar) are generally fine, as long as the shift occurs close enough to the interaction that the relationship is clear to the user.


回答1:


It's important to remember that Cumulative Layout Shift (CLS) is not just focused on page load. Many of the most problematic layout shifts we see happen after the initial load of a page has completed. You may have started reading an article or scrolled when all of a sudden content "shifts" because of an ad that has been injected or updated.

So, CLS is accumulated until a page reaches unload. It does not "stop" measuring upon a user input, as one of the goals of the metric is to measure the experience real users have of unstable page layouts.

You might wonder if this means that long-lived pages or sessions could end up with a worse CLS. There is thought going into how best to factor in this nuance this via the WebPerf Working Group. Ultimately, we need to normalize how we measure metrics like layout shift across the length of a session.



来源:https://stackoverflow.com/questions/62722217/does-cumulative-layout-shift-stop-measuring-on-user-interaction

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!