Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(152)

Issue 1648293003: Fix smooth scroll jump when switching scroll handling between MT and CC (Closed)

Created:
4 years, 10 months ago by ymalik
Modified:
4 years, 10 months ago
Reviewers:
ajuma, skobes, pdr., jbroman
CC:
jbroman, blink-layers+watch_chromium.org, blink-reviews, blink-reviews-platform-graphics_chromium.org, Rik, cc-bugs_chromium.org, chromium-reviews, danakj+watch_chromium.org, dshwang, drott+blinkwatch_chromium.org, krit, f(malita), Justin Novosad, kenneth.christiansen, kinuko+watch, pdr+graphicswatchlist_chromium.org, Rick Byers, rwlbuis, Stephen Chennney, vmpstr+blinkwatch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix smooth scroll jump when switching scroll handling from MT to CC To simulate position:sticky, some websites have JS code that conditionally attaches position:fixed depending on the scroll offset. This CL finishes the the animations on MT before switching to compositor scrolling. ScrollingCoordinator proxys the call to clear main thread scrolling reasons to ScrollAnimator which calls weblayer->clearMTSReasons when the scroll offset animation is finished. ScrollAnimator adds a temporary main thread scrolling reason until the animation is finished. BUG=581875 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Committed: https://crrev.com/002b8a254e34de53be24bea77e3e3ad3fd640f29 Cr-Commit-Position: refs/heads/master@{#377476}

Patch Set 1 #

Patch Set 2 : finish animations on main #

Total comments: 2

Patch Set 3 : always add MTScrollingReason for ScrollAnimator initiated scrolls #

Patch Set 4 : remove fn to clear all main thread scrolling reasons #

Total comments: 7

Patch Set 5 : worked on review feedback #

Patch Set 6 : added layout test #

Total comments: 2

Patch Set 7 : updated layout test #

Total comments: 1

Patch Set 8 : nit spacing #

Patch Set 9 : tiny update to layout test #

Patch Set 10 : fix bugs mentioned in comments #

Patch Set 11 : #

Patch Set 12 : todo + nit #

Total comments: 6

Patch Set 13 : nits #

Total comments: 2

Patch Set 14 : nit #

Patch Set 15 : rebase master #

Patch Set 16 : skip irrelevant test on mac #

Unified diffs Side-by-side diffs Delta from patch set Stats (+340 lines, -28 lines) Patch
M cc/blink/web_layer_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +3 lines, -1 line 0 comments Download
M cc/blink/web_layer_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +8 lines, -2 lines 0 comments Download
M cc/input/main_thread_scrolling_reason.h View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +3 lines, -2 lines 0 comments Download
M cc/layers/layer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -1 line 0 comments Download
M cc/layers/layer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +11 lines, -6 lines 0 comments Download
M cc/layers/layer_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +0 lines, -2 lines 0 comments Download
M cc/layers/layer_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +51 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/TestExpectations View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +2 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/virtual/threaded/fast/scroll-behavior/smooth-scroll/main-thread-scrolling-reason-added.html View 1 2 3 4 5 6 7 8 1 chunk +59 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/virtual/threaded/fast/scroll-behavior/smooth-scroll/main-thread-scrolling-reason-added-expected.txt View 1 2 3 4 5 6 1 chunk +13 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/virtual/threaded/fast/scroll-behavior/smooth-scroll/main-thread-scrolling-reason-correctness.html View 1 2 3 4 5 6 7 8 9 1 chunk +81 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/virtual/threaded/fast/scroll-behavior/smooth-scroll/main-thread-scrolling-reason-correctness-expected.txt View 1 2 3 4 5 6 7 8 9 1 chunk +16 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +13 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/platform/scroll/ScrollAnimator.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +6 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 6 chunks +52 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +4 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +5 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +9 lines, -1 line 0 comments Download
M third_party/WebKit/public/platform/WebLayer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 48 (13 generated)
ymalik
Hey guys, Any tips on how I can test this? @skobes Can you verify that ...
4 years, 10 months ago (2016-02-04 01:45:48 UTC) #4
ajuma
https://codereview.chromium.org/1648293003/diff/20001/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp File third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp (right): https://codereview.chromium.org/1648293003/diff/20001/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp#newcode347 third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp:347: scrollbarGraphicsLayer->setMainThreadScrollingReasons(MainThreadScrollingReason::kScrollbarScrolling); Is changing this from adding a reason to ...
4 years, 10 months ago (2016-02-04 15:05:48 UTC) #5
ymalik
@Ali, PTAL :) I removed the proxying clear main thread scrolling reasons call to scrollable ...
4 years, 10 months ago (2016-02-04 18:45:59 UTC) #6
skobes
Confirmed, this fixes the jump. :) https://codereview.chromium.org/1648293003/diff/60001/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp File third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp (right): https://codereview.chromium.org/1648293003/diff/60001/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp#newcode694 third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp:694: uint32_t mainThreadScrollingReasonsToClear = ...
4 years, 10 months ago (2016-02-04 20:04:40 UTC) #7
ajuma
https://codereview.chromium.org/1648293003/diff/60001/cc/layers/layer.cc File cc/layers/layer.cc (right): https://codereview.chromium.org/1648293003/diff/60001/cc/layers/layer.cc#newcode966 cc/layers/layer.cc:966: DCHECK(main_thread_scrolling_reasons_to_clear); Is it possible that we reach here and ...
4 years, 10 months ago (2016-02-04 20:08:40 UTC) #8
ymalik
@Ali, PTAL :) https://codereview.chromium.org/1648293003/diff/60001/cc/layers/layer.cc File cc/layers/layer.cc (right): https://codereview.chromium.org/1648293003/diff/60001/cc/layers/layer.cc#newcode966 cc/layers/layer.cc:966: DCHECK(main_thread_scrolling_reasons_to_clear); On 2016/02/04 20:08:40, ajuma wrote: ...
4 years, 10 months ago (2016-02-04 21:53:20 UTC) #9
ajuma
lgtm https://codereview.chromium.org/1648293003/diff/60001/cc/layers/layer.cc File cc/layers/layer.cc (right): https://codereview.chromium.org/1648293003/diff/60001/cc/layers/layer.cc#newcode966 cc/layers/layer.cc:966: DCHECK(main_thread_scrolling_reasons_to_clear); On 2016/02/04 21:53:20, ymalik1 wrote: > On ...
4 years, 10 months ago (2016-02-04 22:45:29 UTC) #10
skobes
lgtm2
4 years, 10 months ago (2016-02-04 22:56:20 UTC) #11
ymalik
Hey Guys, Any tips on how to test this? More specifically, I'd be nice to ...
4 years, 10 months ago (2016-02-04 23:49:41 UTC) #12
skobes
On 2016/02/04 23:49:41, ymalik1 wrote: > Any tips on how to test this? More specifically, ...
4 years, 10 months ago (2016-02-04 23:59:14 UTC) #13
ymalik
PTAL :) I added a layout test that checks whether or not the main thread ...
4 years, 10 months ago (2016-02-05 17:56:35 UTC) #14
skobes
> Ideally I would also like to check the animation > run state as Steve ...
4 years, 10 months ago (2016-02-05 19:29:51 UTC) #15
skobes
https://codereview.chromium.org/1648293003/diff/100001/third_party/WebKit/LayoutTests/virtual/threaded/fast/scroll-behavior/smooth-scroll/main-thread-scrolling-reason-added.html File third_party/WebKit/LayoutTests/virtual/threaded/fast/scroll-behavior/smooth-scroll/main-thread-scrolling-reason-added.html (right): https://codereview.chromium.org/1648293003/diff/100001/third_party/WebKit/LayoutTests/virtual/threaded/fast/scroll-behavior/smooth-scroll/main-thread-scrolling-reason-added.html#newcode23 third_party/WebKit/LayoutTests/virtual/threaded/fast/scroll-behavior/smooth-scroll/main-thread-scrolling-reason-added.html:23: ".localeCompare('')", "0"); Curious, why do you need localeCompare instead ...
4 years, 10 months ago (2016-02-05 19:31:43 UTC) #16
ymalik
On 2016/02/05 19:29:51, skobes wrote: > > Ideally I would also like to check the ...
4 years, 10 months ago (2016-02-06 21:46:46 UTC) #17
ymalik
PTAL :) https://codereview.chromium.org/1648293003/diff/100001/third_party/WebKit/LayoutTests/virtual/threaded/fast/scroll-behavior/smooth-scroll/main-thread-scrolling-reason-added.html File third_party/WebKit/LayoutTests/virtual/threaded/fast/scroll-behavior/smooth-scroll/main-thread-scrolling-reason-added.html (right): https://codereview.chromium.org/1648293003/diff/100001/third_party/WebKit/LayoutTests/virtual/threaded/fast/scroll-behavior/smooth-scroll/main-thread-scrolling-reason-added.html#newcode23 third_party/WebKit/LayoutTests/virtual/threaded/fast/scroll-behavior/smooth-scroll/main-thread-scrolling-reason-added.html:23: ".localeCompare('')", "0"); On 2016/02/05 19:31:43, skobes wrote: ...
4 years, 10 months ago (2016-02-06 21:49:06 UTC) #18
skobes
lgtm
4 years, 10 months ago (2016-02-09 00:52:56 UTC) #19
ymalik
On 2016/02/09 00:52:56, skobes wrote: > lgtm Hey Guys, I found some issues with this ...
4 years, 10 months ago (2016-02-09 01:14:37 UTC) #20
skobes
On 2016/02/09 01:14:37, ymalik1 wrote: > 1) Because we add a temporary main thread scrolling ...
4 years, 10 months ago (2016-02-09 01:26:22 UTC) #21
ymalik
On 2016/02/09 01:26:22, skobes wrote: > On 2016/02/09 01:14:37, ymalik1 wrote: > > 1) Because ...
4 years, 10 months ago (2016-02-10 16:33:50 UTC) #22
ymalik
@Ali, Steve I made a bunch of changes after your last lgtm. Can you PTAL ...
4 years, 10 months ago (2016-02-10 16:35:37 UTC) #23
ajuma
On 2016/02/10 16:35:37, ymalik1 wrote: > @Ali, Steve > > I made a bunch of ...
4 years, 10 months ago (2016-02-10 18:43:32 UTC) #24
skobes
lgtm On 2016/02/10 16:33:50, ymalik1 wrote: > I find that a little confusing because when ...
4 years, 10 months ago (2016-02-10 18:53:34 UTC) #25
ymalik
On 2016/02/10 18:53:34, skobes wrote: > lgtm > > On 2016/02/10 16:33:50, ymalik1 wrote: > ...
4 years, 10 months ago (2016-02-10 20:11:21 UTC) #26
ymalik
+Jeremy for Source/platform
4 years, 10 months ago (2016-02-10 20:12:06 UTC) #28
jbroman
The scrolling logic is a bit over my head, but rs lgtm (with nits). https://codereview.chromium.org/1648293003/diff/220001/cc/input/main_thread_scrolling_reason.h ...
4 years, 10 months ago (2016-02-10 20:36:38 UTC) #29
ymalik
+aelias Need your stamp for public/platform :) https://codereview.chromium.org/1648293003/diff/220001/cc/input/main_thread_scrolling_reason.h File cc/input/main_thread_scrolling_reason.h (right): https://codereview.chromium.org/1648293003/diff/220001/cc/input/main_thread_scrolling_reason.h#newcode21 cc/input/main_thread_scrolling_reason.h:21: enum : ...
4 years, 10 months ago (2016-02-10 21:57:58 UTC) #31
jbroman
https://codereview.chromium.org/1648293003/diff/240001/third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp File third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp (right): https://codereview.chromium.org/1648293003/diff/240001/third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp#newcode45 third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp:45: blink::WebLayer* toWebLayer(blink::GraphicsLayer* layer) nit: you can put the anonymous ...
4 years, 10 months ago (2016-02-10 22:42:55 UTC) #32
ymalik
+pdr for public/Platform - aelias I just realized he's on vacation
4 years, 10 months ago (2016-02-11 16:05:45 UTC) #34
pdr.
On 2016/02/11 at 16:05:45, ymalik wrote: > +pdr for public/Platform > - aelias I just ...
4 years, 10 months ago (2016-02-12 00:13:34 UTC) #35
ymalik
https://codereview.chromium.org/1648293003/diff/240001/third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp File third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp (right): https://codereview.chromium.org/1648293003/diff/240001/third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp#newcode45 third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp:45: blink::WebLayer* toWebLayer(blink::GraphicsLayer* layer) On 2016/02/10 22:42:55, jbroman wrote: > ...
4 years, 10 months ago (2016-02-12 17:55:52 UTC) #36
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1648293003/280001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1648293003/280001
4 years, 10 months ago (2016-02-24 21:06:03 UTC) #39
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/185230)
4 years, 10 months ago (2016-02-24 22:45:55 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1648293003/300001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1648293003/300001
4 years, 10 months ago (2016-02-25 01:02:53 UTC) #44
commit-bot: I haz the power
Committed patchset #16 (id:300001)
4 years, 10 months ago (2016-02-25 02:44:35 UTC) #46
commit-bot: I haz the power
4 years, 10 months ago (2016-02-25 02:45:27 UTC) #48
Message was sent while issue was closed.
Patchset 16 (id:??) landed as
https://crrev.com/002b8a254e34de53be24bea77e3e3ad3fd640f29
Cr-Commit-Position: refs/heads/master@{#377476}

Powered by Google App Engine
This is Rietveld 408576698