Skip to content

Update CLS explanation and example to use session windows - #131

Open
adityareddy-dev wants to merge 1 commit into
WICG:mainfrom
adityareddy-dev:cls-session-windows
Open

adityareddy-dev wants to merge 1 commit into
WICG:mainfrom
adityareddy-dev:cls-session-windows

Conversation

@adityareddy-dev

@adityareddy-dev adityareddy-dev commented Nov 3, 2026 •

Copy link
Copy Markdown

The CLS section still adds up every layout shift over the page lifetime, which isn't how CLS is defined anymore. This updates the non-normative explanation and the usage example to keep the largest session-window score, matching the current CLS definition.

The example computes DCLS for the observed document, cause an observer doesn't get entries from child frames, and keeps window state across observer callbacks. It also had a return on a shift with recent input that dropped the rest of the batch, that's a continue now. The text explains how descendant frames feed into CLS on one timeline. Same format as the INP calculation section in Event Timing.


Preview | Diff

@adityareddy-dev
adityareddy-dev marked this pull request as ready for review November 5, 2026 04:08
@adityareddy-dev

Copy link
Copy Markdown
Author

@mmocny the recent-input part here overlaps with Ian's PR, should this wait for that one or go first?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant