Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLS] Don't count layout shifts due to content-visibility:auto unskipping #26639

Merged
merged 1 commit into from Nov 25, 2020

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Nov 24, 2020

content-visibility:auto elements have different sizing behavior when
near the viewport vs not. This sizing behavior is an intentional part
of the platform, and should not be considered a layout shift for the
the first time the elements' subtrees become unskipped (*).

There are two cases of "first time":

  • The very first paint when a content-visiblity:auto element is in the
    DOM, and in which the element is found in that frame to be near the
    viewport.
  • The first paint after a content-visiblity:auto element has been
    found to be near the viewport, but was was found for at least one
    frame previously not to be near it.

These two cases are handled in somewhat different ways in Blink - the
former is a synchronous relayout, whereas the second is async.

In both cases, CLS should not be impacted.

In the future, we could consider in the future whether layout shifts
for subsequent unskips should also not count for CLS.

Bug: 1151526

(*) https://drafts.csswg.org/css-contain-2/#skips-its-contents

Change-Id: I9421452430dd572ed87bb20b0bd20e9a7e3501a8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2556211
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: Annie Sullivan <sullivan@chromium.org>
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#830774}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Chromium project.

@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-2556211 branch 2 times, most recently from 0a27048 to 5b348c2 Compare November 24, 2020 21:47
…ping

content-visibility:auto elements have different sizing behavior when
near the viewport vs not. This sizing behavior is an intentional part
of the platform, and should not be considered a layout shift for the
the first time the elements' subtrees become unskipped (*).

There are two cases of "first time":
* The very first paint when a content-visiblity:auto element is in the
  DOM, and in which the element is found in that frame to be near the
  viewport.
* The first paint *after* a content-visiblity:auto element has been
  found to be near the viewport, but was was found for at least one
  frame previously not to be near it.

These two cases are handled in somewhat different ways in Blink - the
former is a synchronous relayout, whereas the second is async.

In both cases, CLS should not be impacted.

In the future, we could consider in the future whether layout shifts
for subsequent unskips should also not count for CLS.

Bug: 1151526

(*) https://drafts.csswg.org/css-contain-2/#skips-its-contents

Change-Id: I9421452430dd572ed87bb20b0bd20e9a7e3501a8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2556211
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: Annie Sullivan <sullivan@chromium.org>
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#830774}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants