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

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 Nov 24, 2020
…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}
@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-2556211 branch from 5b348c2 to c04c66e Nov 25, 2020
@Hexcles Hexcles closed this Nov 25, 2020
@Hexcles Hexcles reopened this Nov 25, 2020
@chromium-wpt-export-bot chromium-wpt-export-bot merged commit 92d9bd4 into master Nov 25, 2020
22 checks passed
22 checks passed
Azure Pipelines Build #20201125.36 succeeded
Details
Azure Pipelines (./wpt test-jobs) ./wpt test-jobs succeeded
Details
Azure Pipelines (affected tests without changes: Safari Technology Preview) affected tests without changes: Safari Technology Preview succeeded
Details
Azure Pipelines (affected tests: Safari Technology Preview) affected tests: Safari Technology Preview succeeded
Details
Azure Pipelines (wpt.fyi hook: safari-preview-affected-tests) wpt.fyi hook: safari-preview-affected-tests succeeded
Details
Azure Pipelines (wpt.fyi hook: safari-preview-affected-tests-without-changes) wpt.fyi hook: safari-preview-affected-tests-without-changes succeeded
Details
download-firefox-nightly Community-TC (pull_request)
Details
lint Community-TC (pull_request)
Details
sink-task Community-TC (pull_request)
Details
staging.wpt.fyi - chrome[experimental] Chrome results
Details
staging.wpt.fyi - firefox[experimental] Firefox results
Details
staging.wpt.fyi - safari[experimental] Safari results
Details
wpt-chrome-dev-results Community-TC (pull_request)
Details
wpt-chrome-dev-results-without-changes Community-TC (pull_request)
Details
wpt-chrome-dev-stability Community-TC (pull_request)
Details
wpt-decision-task Community-TC (pull_request)
Details
wpt-firefox-nightly-results Community-TC (pull_request)
Details
wpt-firefox-nightly-results-without-changes Community-TC (pull_request)
Details
wpt-firefox-nightly-stability Community-TC (pull_request)
Details
wpt.fyi - chrome[experimental] Chrome results
Details
wpt.fyi - firefox[experimental] Firefox results
Details
wpt.fyi - safari[experimental] Safari results
Details
@chromium-wpt-export-bot chromium-wpt-export-bot deleted the chromium-export-cl-2556211 branch Nov 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants