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] Allow for shifts in root-relative coordinates for scroll anchoring #29292

Merged
merged 1 commit into from Jun 10, 2021

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Jun 8, 2021

Currently, layout adjustments plus scroll anchoring may result in all
three of the following happening in the same rendering update:

  • Layout changes that moves a tracked element relative to its
    layout shift root (e.g. via content-visibility changing skip state, but
    it could also be any layout change offscreen)
  • Natural scroll via a user gesture that visually moves the element
    visually on-screen
  • Scroll anchoring to counter the layout change, but not the natural
    scroll

We currently do not handle that case. We only handle the case of
a layout change that is directly counter-balanced by a scroll, or
a pure scroll.

This CL serves the above use case by plumbing the value of the scroll
anchor scroll to LayoutShiftTracker, and early-outing if the root-
relative position of the before and after rects are equal, once
scroll anchoring is taken into account.

Bug: 1215368

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

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.

Currently, layout adjustments plus scroll anchoring may result in all
three of the following happening in the same rendering update:

* Layout changes that moves a tracked element relative to its
layout shift root (e.g. via content-visibility changing skip state, but
it could also be any layout change offscreen)
* Natural scroll via a user gesture that visually moves the element
visually on-screen
* Scroll anchoring to counter the layout change, but not the natural
scroll

We currently do not handle that case. We only handle the case of
a layout change that is directly counter-balanced by a scroll, or
a pure scroll.

This CL serves the above use case by plumbing the value of the scroll
anchor scroll to LayoutShiftTracker, and early-outing if the root-
relative position of the before and after rects are equal, once
scroll anchoring is taken into account.

Bug: 1215368

Change-Id: I8a5240603cebf3a78dfc4fa82b4839cf1af68800
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2946459
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#891250}
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

3 participants