Scroll Anchoring: smooth scroll overrides anchoring adjustment |
||||||
Issue descriptionWe might need some special handling to avoid having the scroll anchoring intervention negatively impact an on-going scroll intent. Note: It's hard to confirm from hands-on testing if the scroll anchoring intervention can impact an on-going scroll intent. Maybe, carefully walking through the code in that situation will tell us that we don't need to worry?
,
Mar 14 2016
The status quo is that scroll anchoring has no idea whether we are in the middle of a scroll gesture. I haven't investigated exactly what the consequence of this is. It's possible the gesture will just override the anchor. The problem of anchoring mid-gesture is actually easier than the general scroll anchoring problem: since we have already hit-tested the point under the user's finger, we have a natural candidate for the anchor object.
,
Mar 14 2016
,
Mar 19 2016
So I think we are in decent shape for touch gestures because the GestureScrollUpdate events generate deltas, so they compose correctly with anchoring scrolls. Arguably we should use the event target as the anchor node, but that is a low priority optimization. The hard case is actually smooth scrolling, because the animation curve is giving us absolute scroll offsets. I guess the right thing is for the anchoring scroll to adjust both initial and target values of the in-progress animation, with attendant plumbing to the compositor thread. Without this, scroll anchoring is effectively disabled during the smooth scroll. :-/
,
Mar 29 2016
,
Apr 21 2016
,
Apr 27 2016
,
Apr 27 2016
The main thread part here is not that bad since we can just abort the animation, update the curve, and start another animation. Main thread part = animation that get initiated by MT and run on CC (or MT). The CC part is a little tricky because we probably need to have some plumbing that tells CC to do the same, or takeover the animation. Resolving issue 607047 may give that to us for free.
,
May 2 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/98eaa26e00d063ccf9f31cd85261f66441bcd5b8 commit 98eaa26e00d063ccf9f31cd85261f66441bcd5b8 Author: ymalik <ymalik@chromium.org> Date: Mon May 02 18:21:22 2016 Smooth scroll animation should not override scroll anchoring update (MT) Previously, the adjustment made by scroll anchoriing would be overwritten by the scroll position updates from the scroll offset animation because it worked with absolute scroll offset values. Now, when an adjustment is about to be made with an ongoing animation initiated by MT, we cancel that animation, update the curve, and schedule an animatiion with the update target. We do this by introducing a new state to the ScrollAnimator class which also fixes issue 599876 . BUG= 594456 , 599876 Review-Url: https://codereview.chromium.org/1926473003 Cr-Commit-Position: refs/heads/master@{#390997} [modify] https://crrev.com/98eaa26e00d063ccf9f31cd85261f66441bcd5b8/third_party/WebKit/LayoutTests/TestExpectations [add] https://crrev.com/98eaa26e00d063ccf9f31cd85261f66441bcd5b8/third_party/WebKit/LayoutTests/fast/scroll-behavior/smooth-scroll/ongoing-smooth-scroll-anchors.html [modify] https://crrev.com/98eaa26e00d063ccf9f31cd85261f66441bcd5b8/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp [modify] https://crrev.com/98eaa26e00d063ccf9f31cd85261f66441bcd5b8/third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp [modify] https://crrev.com/98eaa26e00d063ccf9f31cd85261f66441bcd5b8/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp [modify] https://crrev.com/98eaa26e00d063ccf9f31cd85261f66441bcd5b8/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.h [modify] https://crrev.com/98eaa26e00d063ccf9f31cd85261f66441bcd5b8/third_party/WebKit/Source/platform/scroll/ScrollAnimatorTest.cpp
,
May 4 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/1b8eeda89c1ddb96201d98c9446afd5da2d68c18 commit 1b8eeda89c1ddb96201d98c9446afd5da2d68c18 Author: ymalik <ymalik@chromium.org> Date: Wed May 04 16:18:17 2016 Rename and refactor ScrollOffsetAnimations to ScrollOffsetAnimationsImpl Pre-req CL to enable communication between MT and impl-only animations. This is described in http://bit.ly/1Y6RA6y. Note that this CL has no behavioral change. BUG= 594456 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review-Url: https://codereview.chromium.org/1952563002 Cr-Commit-Position: refs/heads/master@{#391530} [modify] https://crrev.com/1b8eeda89c1ddb96201d98c9446afd5da2d68c18/cc/BUILD.gn [modify] https://crrev.com/1b8eeda89c1ddb96201d98c9446afd5da2d68c18/cc/animation/animation_host.cc [modify] https://crrev.com/1b8eeda89c1ddb96201d98c9446afd5da2d68c18/cc/animation/animation_host.h [add] https://crrev.com/1b8eeda89c1ddb96201d98c9446afd5da2d68c18/cc/animation/scroll_offset_animations_impl.cc [add] https://crrev.com/1b8eeda89c1ddb96201d98c9446afd5da2d68c18/cc/animation/scroll_offset_animations_impl.h [modify] https://crrev.com/1b8eeda89c1ddb96201d98c9446afd5da2d68c18/cc/cc.gyp
,
May 20 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f3a9e63578aff4d5c814a5bb374665a4a0812834 commit f3a9e63578aff4d5c814a5bb374665a4a0812834 Author: ymalik <ymalik@chromium.org> Date: Fri May 20 01:31:07 2016 Communicate MT changes to impl-only scroll offset animations This CL adds cc::ScrollOffsetAnimations which is the MT version of cc::ScrollOffsetAnimationsImpl. The flow is as follows: The scroll offset is changed on the MT (e.g. scroll anchoring adjustment) while there is an ongoing impl-only scroll offset animation. ScrollAnimator::updateImplOnlyAnimationWithAdjustment is called, which pushes the update to MT's cc::AnimationHost via CompositorAnimationTimeline::CompositorAnimationHost::AnimationHost. During commit, cc::ScrollOffsetAnimations::PushPropertiesTo calls the relevant handler in response to the update. Once the updates are applied, the list of updates is cleared. This is described in http://bit.ly/1Y6RA6y. Note that in this CL, this path is only exercised from ScrollAnchor.cpp BUG= 594456 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review-Url: https://codereview.chromium.org/1950243005 Cr-Commit-Position: refs/heads/master@{#394947} [modify] https://crrev.com/f3a9e63578aff4d5c814a5bb374665a4a0812834/cc/BUILD.gn [modify] https://crrev.com/f3a9e63578aff4d5c814a5bb374665a4a0812834/cc/animation/animation_host.cc [modify] https://crrev.com/f3a9e63578aff4d5c814a5bb374665a4a0812834/cc/animation/animation_host.h [modify] https://crrev.com/f3a9e63578aff4d5c814a5bb374665a4a0812834/cc/animation/scroll_offset_animation_curve.cc [modify] https://crrev.com/f3a9e63578aff4d5c814a5bb374665a4a0812834/cc/animation/scroll_offset_animation_curve.h [add] https://crrev.com/f3a9e63578aff4d5c814a5bb374665a4a0812834/cc/animation/scroll_offset_animations.cc [add] https://crrev.com/f3a9e63578aff4d5c814a5bb374665a4a0812834/cc/animation/scroll_offset_animations.h [modify] https://crrev.com/f3a9e63578aff4d5c814a5bb374665a4a0812834/cc/animation/scroll_offset_animations_impl.cc [modify] https://crrev.com/f3a9e63578aff4d5c814a5bb374665a4a0812834/cc/animation/scroll_offset_animations_impl.h [modify] https://crrev.com/f3a9e63578aff4d5c814a5bb374665a4a0812834/cc/cc.gyp [modify] https://crrev.com/f3a9e63578aff4d5c814a5bb374665a4a0812834/cc/trees/layer_tree_host_unittest_animation.cc [modify] https://crrev.com/f3a9e63578aff4d5c814a5bb374665a4a0812834/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp [add] https://crrev.com/f3a9e63578aff4d5c814a5bb374665a4a0812834/third_party/WebKit/Source/platform/animation/CompositorAnimationHost.cpp [add] https://crrev.com/f3a9e63578aff4d5c814a5bb374665a4a0812834/third_party/WebKit/Source/platform/animation/CompositorAnimationHost.h [add] https://crrev.com/f3a9e63578aff4d5c814a5bb374665a4a0812834/third_party/WebKit/Source/platform/animation/CompositorAnimationHostTest.cpp [modify] https://crrev.com/f3a9e63578aff4d5c814a5bb374665a4a0812834/third_party/WebKit/Source/platform/animation/CompositorAnimationTimeline.cpp [modify] https://crrev.com/f3a9e63578aff4d5c814a5bb374665a4a0812834/third_party/WebKit/Source/platform/animation/CompositorAnimationTimeline.h [modify] https://crrev.com/f3a9e63578aff4d5c814a5bb374665a4a0812834/third_party/WebKit/Source/platform/blink_platform.gypi [modify] https://crrev.com/f3a9e63578aff4d5c814a5bb374665a4a0812834/third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp [modify] https://crrev.com/f3a9e63578aff4d5c814a5bb374665a4a0812834/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp [modify] https://crrev.com/f3a9e63578aff4d5c814a5bb374665a4a0812834/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.h [modify] https://crrev.com/f3a9e63578aff4d5c814a5bb374665a4a0812834/third_party/WebKit/Source/platform/scroll/ScrollAnimatorTest.cpp
,
May 31 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/07ed51b3771572c4bff43a990351f4be1de4f4ae commit 07ed51b3771572c4bff43a990351f4be1de4f4ae Author: ymalik <ymalik@chromium.org> Date: Tue May 31 20:24:57 2016 Correctly update scroll offset animations in response to scroll anchoring This CL fixes the incorrect implementation in https://crrev.com/1926473003. In addition to the state WaitingToCancelOnCompositorButNewScroll introduced previously, it adds a new state RunningOnCompositorButNeedsAdjustment when an ongoing animation needs to be adjusted. We need the former to fix issue 599876 . When an adjustment needs to be made, ScrollAnchor calls into ScrollAnimator which adjusts the curve. When the animation is running on MT, this is enough, but if the animation is running on CC, we abort the old animation and push a new one with the adjusted initial and target positions (hence the new state). This CL also cleans up ::updateCompositorAnimations. Added a new test case for testing MT animation and an animation running on CC is tested by the layout test added in the initial patch. (fast/scroll-behavior/smooth-scroll/ongoing-smooth-scroll-anchors.html) BUG= 594456 Review-Url: https://codereview.chromium.org/2015113003 Cr-Commit-Position: refs/heads/master@{#396913} [add] https://crrev.com/07ed51b3771572c4bff43a990351f4be1de4f4ae/third_party/WebKit/LayoutTests/fast/scroll-behavior/smooth-scroll/ongoing-smooth-scroll-vertical-rl-anchors.html [modify] https://crrev.com/07ed51b3771572c4bff43a990351f4be1de4f4ae/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp [modify] https://crrev.com/07ed51b3771572c4bff43a990351f4be1de4f4ae/third_party/WebKit/Source/platform/animation/CompositorScrollOffsetAnimationCurve.cpp [modify] https://crrev.com/07ed51b3771572c4bff43a990351f4be1de4f4ae/third_party/WebKit/Source/platform/animation/CompositorScrollOffsetAnimationCurve.h [modify] https://crrev.com/07ed51b3771572c4bff43a990351f4be1de4f4ae/third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp [modify] https://crrev.com/07ed51b3771572c4bff43a990351f4be1de4f4ae/third_party/WebKit/Source/platform/scroll/ScrollAnimator.h [modify] https://crrev.com/07ed51b3771572c4bff43a990351f4be1de4f4ae/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp [modify] https://crrev.com/07ed51b3771572c4bff43a990351f4be1de4f4ae/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.h [modify] https://crrev.com/07ed51b3771572c4bff43a990351f4be1de4f4ae/third_party/WebKit/Source/platform/scroll/ScrollAnimatorTest.cpp
,
Jun 23 2016
|
||||||
►
Sign in to add a comment |
||||||
Comment 1 by kenjibaheux@chromium.org
, Mar 14 2016Cc: kenjibaheux@chromium.org
Owner: ----