Scroll Anchoring: interaction with Viewports and page zoom |
|||||||||
Issue descriptionScroll 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.
,
Mar 19 2016
,
Mar 19 2016
,
Jun 29 2016
,
Jun 29 2016
,
Jun 29 2016
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.
,
Jun 30 2016
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.
,
Jun 30 2016
Re #7, I think moving the layout viewport first is correct, for the reason described.
,
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.
,
Jun 30 2016
Scroll anchoring potentially reacts to any layout change (adding, removing, resizing, changing styles, etc).
,
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
,
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
,
Jul 19 2016
,
Sep 27 2016
|
|||||||||
►
Sign in to add a comment |
|||||||||
Comment 1 by kenjibaheux@chromium.org
, Mar 15 2016