Skip to content

Update CLS definition #12350

@paulirish

Description

@paulirish

There were some new variants of CLS and after collecting data (go/nls-lighthouse-analysis and go/nls-ukm-analysis-doc), we got a winner. We're going to use the max-session-gap1s-limit5s one going forward: https://web.dev/evolving-cls/

Also we will use the same existing CLS name as the metric actually doesn't change much, (and even less in a lab scenario). Lastly, we'll upgrade things to the allframes definition, so any shifts from subframes are included.

We'll keep the older definition (aka "uncapped CLS") around for comparison, though with a distinct name. Also, while we're renaming it, we'll get a chance to satisfy the request in CLS: Initial Layout Shift · #12314 and clarify it's only during initial-load, whereas field (legacy) CLS is cumulative for the entire page lifetime.

So we kinda end up with 3: (New) CLS, old CLS (field/page lifetime), Initial-load oldCLS. (See also the last checkbox item)

todo

  • add -allframes for gap1s-limit5s - core: add new CLS (all frames) to hidden metrics audit #12476
  • rename CLS to initial-CLS. keep number exposed, but not in the report (and field tools are renaming CLS to legacy CLS or Total CLS)
    • tactically: keep new all-farmes cls. keep old cls. keep new single-frame cls. delete rest from metrics.
    • move CLS-gap1s-limit5s-all-frames code to CLS and rename to CLS
  • potentially adjust scoring curve and/or score weighting
  • does new CLS still need a specific name for lab's initial-load window to distinguish from field? Personally, I recognize they are distinct but expect that in practice, the gap isn't that wide enough to necessitate a unique name.
  • update AF CLS smoke test for more events?

note that chrome 90 and 91 will get punished slightly if they don't have a viewport. fixed in 92. see #12353


ref core: add hidden layout-shift variant metrics by brendankenny · #12046

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions