Proposal: Layout Stability Metric

Many websites suffer from “layout jank” - DOM elements shifting around due to content loading asynchronously.

We propose a way for the user agent to measure layout jank during a browsing session to compute a cumulative “jank score”, which would be exposed by a new interface in the Performance API.

Explainer: Layout Stability Metric

The proposed layout stability metric would likely be useful to quantify the impact of Google Display Ads related changes to layout jank.

There was at least one change to the Google Publisher Tag in the past year which was expected to improve layout stability based on manual testing, but the real world effect on layouts couldn’t be measured.

1 Like

This would be very useful for Wikipedia. The JS that runs on a particular Wikipedia article varies depending on content, language, etc. and community administrators are allowed to install their own JS on their wikis. As a result, it’s hard for us to be aware of layout jank that might happen in specific circumstances, since end-users might not know what it is and report it, and the set of pages we test automatically is limited.

Also, the ability to measure it beyond onload is very interesting to us, as the dynamic parts of the page are even less monitored for this sort of issue.

Finally, it will be interesting to see if this new metric correlates to users’ performance perception, using a microsurvey we’re running. The ability to calculate the jank score up to a specific point in time will be great for that, as it will allow us to know the jank score at the time the user answers the mcirosurvey to tell us whether or not they fell like the page was fast to load.

We would like to move the following Github repo for layout stability into WICG.

It contains the latest version of the explainer, and will soon have a draft spec.

Sounds good!

The repo now lives in https://github.com/WICG/layout-instability

Happy incubation!! :slight_smile: