To repro, run: chrome --enable-blink-features=CSSOMSmoothScroll https://output.jsbin.com/zoboyo/quiet
Click button, note jank mid-way through scroll. The animation should run on the compositor thread where it would not be affected by script jank, but it runs on the main thread instead.
Only the first scroll after the document loads is janky; subsequent clicks produce smooth scrolls.
This happens because the CompositorAnimationPlayer owned by the FrameView's ProgrammaticScrollAnimator is not initially attached to any layer. As a result, ScrollAnimatorCompositorCoordinator::addAnimation returns false.
The compositor player for any existing scroll animator gets attached during ScrollableArea::layerForScrollingDidChange, which runs after every scroll and also during PaintLayerCompositor::ensureRootLayer.
But ProgrammaticScrollAnimator is created lazily, and all the calls to layerForScrollingDidChange have already occurred by the time it is instantiated. ScrollAnimator gets created a bit earlier so it doesn't suffer from this problem.
Probably the right fix is to attach the compositor player when the scroll animator is created. However I am not sure of the correct way to plumb CompositorAnimationTimeline for this attachment.
|
Deleted:
repro.html
708 bytes
|
Comment 1 by dtapu...@chromium.org
, Mar 10 2016