[BGPT] Update cc::Layer offset from visual viewport
In the linked bug, we try scrolling the page using the keyboard. While all the scroll offsets in Blink are correctly updated, we don't see the scrolling occur on the screen. The reason for this is that we don't realize anything has changed and the commit is aborted due to no changes. It turns out we don't update the offset on the VisualViewport's cc::Layer. The reason this doesn't manifest in other contexts is that we usually perform viewport scrolling using touch or wheel events which are handled on the compositor thread. The fix here is to do what we do for PaintLayerScrollableAreas and call UpdateCompositedScrollOffset on the VisualViewport when the offset changes from the main thread. We need to update the cc::Layer's offset since we use a change in this offset to determine that a commit is needed. This is a similar issue to the one fixed in https://crrev.com/dfe90fdc496af64515756ba1b5970d2760b7314d Bug: 956579 Change-Id: Ie9854f3df1b7065bc2d021b131ff6a8998a8f59d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1617545Reviewed-by:Philip Rogers <pdr@chromium.org> Commit-Queue: David Bokan <bokan@chromium.org> Cr-Commit-Position: refs/heads/master@{#660930}
Showing
Please register or sign in to comment