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

Issue 592799 link

Starred by 2 users

Issue metadata

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



Sign in to add a comment

first programmatic smooth scroll runs on main thread

Project Member Reported by skobes@chromium.org, Mar 7 2016

Issue description

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.
 
repro.html
708 bytes View Download
Labels: Hotlist-Input-Dev

Comment 2 by ymalik@chromium.org, Mar 11 2016

Owner: ymalik@chromium.org
Status: Started (was: Available)
Project Member

Comment 3 by bugdroid1@chromium.org, Mar 16 2016

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

commit 899920c656fc71ca44cb81ea3a1b73639dab52e1
Author: ymalik <ymalik@chromium.org>
Date: Wed Mar 16 01:52:39 2016

First programmatic smooth scroll should run on the compositor if it can

CompositorAnimationPlayer owned by a ScrollableArea's ProgrammaticScrollAnimator
is not initially attached to any layer.  As a result,
ScrollAnimatorCompositorCoordinator::addAnimation returns false the first time
a programmatic scroll is initiated.

This CL attaches the animation player to the correct layer when
::updateCompositorState is called. To do so, we need the CompositorAnimationTimeline
from the ScrollingCoordinator of a ScrollableArea. This CL exposes the timeline from
the subclasses of ScrollableArea.

BUG= 592799 

Review URL: https://codereview.chromium.org/1801753002

Cr-Commit-Position: refs/heads/master@{#381379}

[modify] https://crrev.com/899920c656fc71ca44cb81ea3a1b73639dab52e1/third_party/WebKit/LayoutTests/TestExpectations
[add] https://crrev.com/899920c656fc71ca44cb81ea3a1b73639dab52e1/third_party/WebKit/LayoutTests/virtual/threaded/fast/scroll-behavior/first-scroll-runs-on-compositor-expected.txt
[add] https://crrev.com/899920c656fc71ca44cb81ea3a1b73639dab52e1/third_party/WebKit/LayoutTests/virtual/threaded/fast/scroll-behavior/first-scroll-runs-on-compositor.html
[modify] https://crrev.com/899920c656fc71ca44cb81ea3a1b73639dab52e1/third_party/WebKit/Source/core/frame/FrameView.cpp
[modify] https://crrev.com/899920c656fc71ca44cb81ea3a1b73639dab52e1/third_party/WebKit/Source/core/frame/FrameView.h
[modify] https://crrev.com/899920c656fc71ca44cb81ea3a1b73639dab52e1/third_party/WebKit/Source/core/frame/VisualViewport.cpp
[modify] https://crrev.com/899920c656fc71ca44cb81ea3a1b73639dab52e1/third_party/WebKit/Source/core/frame/VisualViewport.h
[modify] https://crrev.com/899920c656fc71ca44cb81ea3a1b73639dab52e1/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.h
[modify] https://crrev.com/899920c656fc71ca44cb81ea3a1b73639dab52e1/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
[modify] https://crrev.com/899920c656fc71ca44cb81ea3a1b73639dab52e1/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h
[modify] https://crrev.com/899920c656fc71ca44cb81ea3a1b73639dab52e1/third_party/WebKit/Source/core/testing/Internals.cpp
[modify] https://crrev.com/899920c656fc71ca44cb81ea3a1b73639dab52e1/third_party/WebKit/Source/core/testing/Internals.h
[modify] https://crrev.com/899920c656fc71ca44cb81ea3a1b73639dab52e1/third_party/WebKit/Source/core/testing/Internals.idl
[modify] https://crrev.com/899920c656fc71ca44cb81ea3a1b73639dab52e1/third_party/WebKit/Source/platform/scroll/ProgrammaticScrollAnimator.cpp
[modify] https://crrev.com/899920c656fc71ca44cb81ea3a1b73639dab52e1/third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp
[modify] https://crrev.com/899920c656fc71ca44cb81ea3a1b73639dab52e1/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp
[modify] https://crrev.com/899920c656fc71ca44cb81ea3a1b73639dab52e1/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.h
[modify] https://crrev.com/899920c656fc71ca44cb81ea3a1b73639dab52e1/third_party/WebKit/Source/platform/scroll/ScrollableArea.h

Comment 4 by ymalik@chromium.org, Mar 17 2016

Status: Fixed (was: Started)

Sign in to add a comment