New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 594876 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
(currently inactive on Chromium)
Closed: Jul 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Feature

Blocking:
issue 558575



Sign in to add a comment

Scroll Anchoring: interaction with Viewports and page zoom

Project Member Reported by kenjibaheux@chromium.org, Mar 15 2016

Issue description

Scroll Anchoring is an intervention whose intent is to mitigate reflows that unnecessarily impact the user experience.

We should confirm if it interacts well with Viewports and page zoom.
 
Blocking: 558575

Comment 2 by e...@chromium.org, Mar 19 2016

Labels: -Type-Bug Type-Feature

Comment 3 by e...@chromium.org, Mar 19 2016

Status: Available (was: Unconfirmed)

Comment 4 by ymalik@chromium.org, Jun 29 2016

Status: Started (was: Available)

Comment 5 by ymalik@chromium.org, Jun 29 2016

Cc: -ymalik@chromium.org
Owner: ymalik@chromium.org

Comment 6 by ymalik@chromium.org, Jun 29 2016

Cc: bokan@chromium.org
After some analysis, it looks like we're okay for all the height changes that happen above the layout viewport, but will jump for cases where the height changes happen below the anchor element but above the visual viewport.

I think the right thing to do is to ensure that the selected anchor is within the visual viewport rather than the layout viewport.

Comment 7 by skobes@chromium.org, Jun 30 2016

Cc: tdres...@chromium.org
This sounds right to me.  There is also the question of which viewport to scroll for the adjustment.

Arguably if we are selecting an anchor node based on the visual viewport, we should distribute the adjustment through RootFrameViewport.  In that case RootFrameViewport should own the ScrollAnchor instead of FrameView.

I think tdresser mentioned in the initial design discussion that it may be preferable for the adjustment to scroll the layout viewport first (exclusively?) so that fixed-position elements don't jump.  That might require new plumbing in RootFrameViewport.
Re #7, I think moving the layout viewport first is correct, for the reason described.

Comment 9 by bokan@chromium.org, Jun 30 2016

Agree that we should be anchoring using the visual viewport and scrolling the layout viewport first.

Does scroll anchoring deal with cases where elements are removed from the page or is it just for adding elements? If it's just the latter than I think scrolling just the layout viewport should be enough since you can't get into a situation where you *must* scroll the visual viewport. The former does have those cases and would likely some minor changes in RootFrameViewport.
Scroll anchoring potentially reacts to any layout change (adding, removing, resizing, changing styles, etc).
Project Member

Comment 11 by bugdroid1@chromium.org, Jul 8 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/577f3d408ca3e63ff1a9efc0a95f098df5092fd6

commit 577f3d408ca3e63ff1a9efc0a95f098df5092fd6
Author: ymalik <ymalik@chromium.org>
Date: Fri Jul 08 22:18:02 2016

Improve scroll anchoring's interactions with the visual viewport

ScrollAnchor can now have a RootFrameViewport as its scroller so
that an anchoring adjustment can be distributed between layout
and visual viewports.

BUG= 594876 

Review-Url: https://codereview.chromium.org/2123053002
Cr-Commit-Position: refs/heads/master@{#404508}

[modify] https://crrev.com/577f3d408ca3e63ff1a9efc0a95f098df5092fd6/third_party/WebKit/Source/core/frame/FrameView.cpp
[modify] https://crrev.com/577f3d408ca3e63ff1a9efc0a95f098df5092fd6/third_party/WebKit/Source/core/frame/FrameView.h
[modify] https://crrev.com/577f3d408ca3e63ff1a9efc0a95f098df5092fd6/third_party/WebKit/Source/core/frame/RootFrameViewport.cpp
[modify] https://crrev.com/577f3d408ca3e63ff1a9efc0a95f098df5092fd6/third_party/WebKit/Source/core/frame/RootFrameViewport.h
[modify] https://crrev.com/577f3d408ca3e63ff1a9efc0a95f098df5092fd6/third_party/WebKit/Source/core/frame/VisualViewport.cpp
[modify] https://crrev.com/577f3d408ca3e63ff1a9efc0a95f098df5092fd6/third_party/WebKit/Source/core/frame/VisualViewport.h
[modify] https://crrev.com/577f3d408ca3e63ff1a9efc0a95f098df5092fd6/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp
[modify] https://crrev.com/577f3d408ca3e63ff1a9efc0a95f098df5092fd6/third_party/WebKit/Source/core/layout/ScrollAnchor.h
[modify] https://crrev.com/577f3d408ca3e63ff1a9efc0a95f098df5092fd6/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp
[modify] https://crrev.com/577f3d408ca3e63ff1a9efc0a95f098df5092fd6/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h
[modify] https://crrev.com/577f3d408ca3e63ff1a9efc0a95f098df5092fd6/third_party/WebKit/Source/platform/scroll/ProgrammaticScrollAnimator.cpp
[modify] https://crrev.com/577f3d408ca3e63ff1a9efc0a95f098df5092fd6/third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp
[modify] https://crrev.com/577f3d408ca3e63ff1a9efc0a95f098df5092fd6/third_party/WebKit/Source/platform/scroll/ScrollAnimator.h
[modify] https://crrev.com/577f3d408ca3e63ff1a9efc0a95f098df5092fd6/third_party/WebKit/Source/platform/scroll/ScrollAnimatorBase.cpp
[modify] https://crrev.com/577f3d408ca3e63ff1a9efc0a95f098df5092fd6/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp
[modify] https://crrev.com/577f3d408ca3e63ff1a9efc0a95f098df5092fd6/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.h
[modify] https://crrev.com/577f3d408ca3e63ff1a9efc0a95f098df5092fd6/third_party/WebKit/Source/platform/scroll/ScrollAnimatorTest.cpp
[modify] https://crrev.com/577f3d408ca3e63ff1a9efc0a95f098df5092fd6/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp
[modify] https://crrev.com/577f3d408ca3e63ff1a9efc0a95f098df5092fd6/third_party/WebKit/Source/platform/scroll/ScrollableArea.h

Project Member

Comment 12 by bugdroid1@chromium.org, Jul 19 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ed3cc7f461c0a5c6ad66e509deace2e07674537c

commit ed3cc7f461c0a5c6ad66e509deace2e07674537c
Author: ymalik <ymalik@chromium.org>
Date: Tue Jul 19 15:19:25 2016

Make scroll anchoring adjustment when the bounds of a scroller is changed

A layout update can change the bounds of a scroller, requiring us to clamp the
current scroll position if its outside the bounds of the scroller. This would
clear the saved scroll anchor and have a visible jump. The main issue is that
we would clear the anchor between ScrollAnchor::save and ScrollAnchor::restore.

This CL calls ::restore if clamping is needed to ensure that scroll anchoring
still works.

BUG= 594876 

Review-Url: https://codereview.chromium.org/2152773002
Cr-Commit-Position: refs/heads/master@{#406277}

[modify] https://crrev.com/ed3cc7f461c0a5c6ad66e509deace2e07674537c/third_party/WebKit/Source/core/frame/FrameView.cpp
[modify] https://crrev.com/ed3cc7f461c0a5c6ad66e509deace2e07674537c/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp
[modify] https://crrev.com/ed3cc7f461c0a5c6ad66e509deace2e07674537c/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp

Status: Fixed (was: Started)
Labels: Hotlist-Input-Dev

Sign in to add a comment