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

Issue 1844013002: Fix main thread top controls scrolling to mirror CC. (Closed)

Created:
4 years, 8 months ago by bokan
Modified:
4 years, 7 months ago
CC:
blink-reviews, cc-bugs_chromium.org, chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@propertyTreesBoundsDelta
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix main thread top controls scrolling to mirror CC. There's a couple of issues I found where our behavior on the main thread is divergent from the compositor. The major one is that we don't anchor the viewport when top controls change the viewport bounds. At the document extents, the changing bounds can cause the viewport's scroll offset to be clamped causing unwanted scrolling. I've added an anchoring in didUpdateTopControls that should match CC's anchoring down to the sub-pixel level. This also required some rearranging of operations in applyViewportDeltas. Now that we anchor the top control resizes on main thread as well, we can't have a separate calls to change the "shrinks_blink_layout_size" flag and resize the Blink size so I've added an overload of resize() in WebWidget that does both at the same time. In addition, there were other minor issues that I found but weren't causing an obvoius noticable effect. CC's MaxScrollOffset method |ceil|s the top controls adjustment so I made the main thread do this too. CC's anchoring logic still scrolled the outer viewport first. This was changed a while back in viewport.cc so I changed it here too. BUG=600507 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Committed: https://crrev.com/c63441cc9941c223e2f2d311085903c00da85938 Cr-Commit-Position: refs/heads/master@{#390085}

Patch Set 1 #

Patch Set 2 : Whitespace #

Total comments: 18

Patch Set 3 : Rebase #

Patch Set 4 : Addressed Majid's feedback #

Patch Set 5 : Rebase #

Patch Set 6 : Merged top controls change into resize() #

Patch Set 7 : Cleaned up test for scrolling down but showing top controls #

Patch Set 8 : Don't update top controls unless they actually changed #

Patch Set 9 : Rebase #

Patch Set 10 : Rebase #

Patch Set 11 : Override top controls resize() in classes that override resize() #

Total comments: 5

Patch Set 12 : Fixed anchoring to check width too #

Total comments: 3

Patch Set 13 : aelias@ review: moved combined resize into WebView #

Total comments: 4

Patch Set 14 : sievers@ review #

Total comments: 3

Patch Set 15 : Let ResizeWebWidget decide whether to resize #

Total comments: 7

Patch Set 16 : Addressing sievers@'s comments #

Patch Set 17 : Rebase #

Patch Set 18 : Rebase #

Patch Set 19 : Rebase #

Patch Set 20 : Build fix after rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+422 lines, -150 lines) Patch
M cc/trees/layer_tree_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +2 lines, -2 lines 0 comments Download
M content/renderer/render_view_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +8 lines, -0 lines 0 comments Download
M content/renderer/render_view_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +11 lines, -0 lines 0 comments Download
M content/renderer/render_widget.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +3 lines, -8 lines 0 comments Download
M content/renderer/render_widget.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 7 chunks +17 lines, -23 lines 0 comments Download
M third_party/WebKit/Source/core/frame/FrameView.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/frame/VisualViewport.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/web/ResizeViewportAnchor.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +43 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/web/WebViewFrameWidget.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/web/WebViewFrameWidget.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +0 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/web/WebViewImpl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +5 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/web/WebViewImpl.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 7 chunks +54 lines, -25 lines 0 comments Download
M third_party/WebKit/Source/web/tests/TopControlsTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 22 chunks +113 lines, -30 lines 0 comments Download
M third_party/WebKit/Source/web/tests/VisualViewportTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 12 chunks +152 lines, -39 lines 0 comments Download
M third_party/WebKit/Source/web/tests/WebFrameTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +3 lines, -6 lines 0 comments Download
M third_party/WebKit/public/web/WebView.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +8 lines, -0 lines 0 comments Download
M third_party/WebKit/public/web/WebWidget.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +0 lines, -4 lines 0 comments Download

Messages

Total messages: 73 (29 generated)
bokan
PTAL, thanks!
4 years, 8 months ago (2016-03-30 17:53:06 UTC) #4
bokan
friendly ping :)
4 years, 8 months ago (2016-04-01 13:57:45 UTC) #5
majidvp
https://codereview.chromium.org/1844013002/diff/20001/third_party/WebKit/Source/core/frame/VisualViewport.cpp File third_party/WebKit/Source/core/frame/VisualViewport.cpp (right): https://codereview.chromium.org/1844013002/diff/20001/third_party/WebKit/Source/core/frame/VisualViewport.cpp#newcode477 third_party/WebKit/Source/core/frame/VisualViewport.cpp:477: // FIXME: We probably shouldn't be storing the bounds ...
4 years, 8 months ago (2016-04-01 17:09:36 UTC) #6
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1844013002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1844013002/120001
4 years, 8 months ago (2016-04-04 22:36:40 UTC) #10
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_blink_oilpan_rel on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_blink_oilpan_rel/builds/26114)
4 years, 8 months ago (2016-04-04 23:05:28 UTC) #12
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1844013002/150001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1844013002/150001
4 years, 8 months ago (2016-04-05 00:12:27 UTC) #14
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: android_chromium_gn_compile_dbg on tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_chromium_gn_compile_dbg/builds/45403) android_chromium_gn_compile_rel on ...
4 years, 8 months ago (2016-04-05 00:19:13 UTC) #16
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1844013002/170001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1844013002/170001
4 years, 8 months ago (2016-04-05 01:49:33 UTC) #18
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_blink_oilpan_rel on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_blink_oilpan_rel/builds/26291)
4 years, 8 months ago (2016-04-05 02:15:48 UTC) #20
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1844013002/210001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1844013002/210001
4 years, 8 months ago (2016-04-05 15:37:06 UTC) #22
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 8 months ago (2016-04-05 16:49:54 UTC) #24
bokan
I had to expand the scope a bit since I found a problem with the ...
4 years, 8 months ago (2016-04-05 17:11:41 UTC) #25
majidvp
https://codereview.chromium.org/1844013002/diff/210001/content/renderer/render_widget.cc File content/renderer/render_widget.cc (right): https://codereview.chromium.org/1844013002/diff/210001/content/renderer/render_widget.cc#newcode1151 content/renderer/render_widget.cc:1151: top_controls_shrink_blink_size_); I think for the top control anchoring to ...
4 years, 8 months ago (2016-04-06 18:07:30 UTC) #26
bokan
https://codereview.chromium.org/1844013002/diff/210001/content/renderer/render_widget.cc File content/renderer/render_widget.cc (right): https://codereview.chromium.org/1844013002/diff/210001/content/renderer/render_widget.cc#newcode1151 content/renderer/render_widget.cc:1151: top_controls_shrink_blink_size_); On 2016/04/06 18:07:30, majidvp wrote: > I think ...
4 years, 8 months ago (2016-04-06 19:23:35 UTC) #27
majidvp
On 2016/04/06 at 19:23:35, bokan wrote: > https://codereview.chromium.org/1844013002/diff/210001/content/renderer/render_widget.cc > File content/renderer/render_widget.cc (right): > > https://codereview.chromium.org/1844013002/diff/210001/content/renderer/render_widget.cc#newcode1151 ...
4 years, 8 months ago (2016-04-06 21:23:16 UTC) #28
bokan
On 2016/04/06 21:23:16, majidvp wrote: > On 2016/04/06 at 19:23:35, bokan wrote: > > > ...
4 years, 8 months ago (2016-04-07 00:47:54 UTC) #29
majidvp
On 2016/04/07 at 00:47:54, bokan wrote: > On 2016/04/06 21:23:16, majidvp wrote: > > On ...
4 years, 8 months ago (2016-04-07 02:05:52 UTC) #30
bokan
Alexandre, --disable-threaded-scrolling causes issues with top control scrolling that have been solved on CC. We ...
4 years, 8 months ago (2016-04-07 02:11:24 UTC) #33
aelias_OOO_until_Jul13
https://codereview.chromium.org/1844013002/diff/230001/third_party/WebKit/Source/web/WebViewImpl.cpp File third_party/WebKit/Source/web/WebViewImpl.cpp (right): https://codereview.chromium.org/1844013002/diff/230001/third_party/WebKit/Source/web/WebViewImpl.cpp#newcode1943 third_party/WebKit/Source/web/WebViewImpl.cpp:1943: void WebViewImpl::resize(const WebSize& newSize) Does this still need to ...
4 years, 8 months ago (2016-04-07 02:39:54 UTC) #34
bokan
https://codereview.chromium.org/1844013002/diff/230001/third_party/WebKit/Source/web/WebViewImpl.cpp File third_party/WebKit/Source/web/WebViewImpl.cpp (right): https://codereview.chromium.org/1844013002/diff/230001/third_party/WebKit/Source/web/WebViewImpl.cpp#newcode1943 third_party/WebKit/Source/web/WebViewImpl.cpp:1943: void WebViewImpl::resize(const WebSize& newSize) On 2016/04/07 02:39:54, aelias wrote: ...
4 years, 8 months ago (2016-04-07 02:42:37 UTC) #35
aelias_OOO_until_Jul13
https://codereview.chromium.org/1844013002/diff/230001/third_party/WebKit/Source/web/WebViewImpl.cpp File third_party/WebKit/Source/web/WebViewImpl.cpp (right): https://codereview.chromium.org/1844013002/diff/230001/third_party/WebKit/Source/web/WebViewImpl.cpp#newcode1943 third_party/WebKit/Source/web/WebViewImpl.cpp:1943: void WebViewImpl::resize(const WebSize& newSize) On 2016/04/07 at 02:42:37, bokan ...
4 years, 8 months ago (2016-04-07 02:50:23 UTC) #36
bokan
On 2016/04/07 02:50:23, aelias wrote: > https://codereview.chromium.org/1844013002/diff/230001/third_party/WebKit/Source/web/WebViewImpl.cpp > File third_party/WebKit/Source/web/WebViewImpl.cpp (right): > > https://codereview.chromium.org/1844013002/diff/230001/third_party/WebKit/Source/web/WebViewImpl.cpp#newcode1943 > ...
4 years, 8 months ago (2016-04-07 23:11:08 UTC) #37
aelias_OOO_until_Jul13
On 2016/04/07 at 23:11:08, bokan wrote: > One other issue I forgot to mention: there's ...
4 years, 8 months ago (2016-04-07 23:24:15 UTC) #38
bokan
On 2016/04/07 23:24:15, aelias wrote: > On 2016/04/07 at 23:11:08, bokan wrote: > > One ...
4 years, 8 months ago (2016-04-07 23:39:59 UTC) #39
aelias_OOO_until_Jul13
lgtm
4 years, 8 months ago (2016-04-07 23:55:55 UTC) #40
bokan
+sievers@ for content/renderer
4 years, 8 months ago (2016-04-07 23:56:59 UTC) #42
no sievers
https://codereview.chromium.org/1844013002/diff/250001/content/renderer/render_view_impl.cc File content/renderer/render_view_impl.cc (right): https://codereview.chromium.org/1844013002/diff/250001/content/renderer/render_view_impl.cc#newcode2631 content/renderer/render_view_impl.cc:2631: webview()->resizeWithTopControls(new_view_size, webview() is null-checked everywhere else in OnResize() here ...
4 years, 8 months ago (2016-04-08 19:26:02 UTC) #43
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1844013002/270001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1844013002/270001
4 years, 8 months ago (2016-04-11 18:33:15 UTC) #45
bokan
sievers@, ptal. https://codereview.chromium.org/1844013002/diff/250001/content/renderer/render_view_impl.cc File content/renderer/render_view_impl.cc (right): https://codereview.chromium.org/1844013002/diff/250001/content/renderer/render_view_impl.cc#newcode2631 content/renderer/render_view_impl.cc:2631: webview()->resizeWithTopControls(new_view_size, On 2016/04/08 19:26:02, sievers wrote: > ...
4 years, 8 months ago (2016-04-11 19:54:15 UTC) #46
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 8 months ago (2016-04-11 20:21:58 UTC) #48
no sievers
just one nit https://codereview.chromium.org/1844013002/diff/270001/content/renderer/render_widget.cc File content/renderer/render_widget.cc (right): https://codereview.chromium.org/1844013002/diff/270001/content/renderer/render_widget.cc#newcode1095 content/renderer/render_widget.cc:1095: if (resized) Hmm, weird pattern with ...
4 years, 8 months ago (2016-04-12 22:44:12 UTC) #49
bokan
https://codereview.chromium.org/1844013002/diff/270001/content/renderer/render_widget.cc File content/renderer/render_widget.cc (right): https://codereview.chromium.org/1844013002/diff/270001/content/renderer/render_widget.cc#newcode1095 content/renderer/render_widget.cc:1095: if (resized) On 2016/04/12 22:44:12, sievers wrote: > Hmm, ...
4 years, 8 months ago (2016-04-13 17:25:40 UTC) #50
no sievers
thanks for your patience :) https://codereview.chromium.org/1844013002/diff/290001/content/renderer/render_widget.cc File content/renderer/render_widget.cc (right): https://codereview.chromium.org/1844013002/diff/290001/content/renderer/render_widget.cc#newcode1096 content/renderer/render_widget.cc:1096: physical_backing_size_ != params.physical_backing_size; I'm ...
4 years, 8 months ago (2016-04-13 18:40:24 UTC) #51
bokan
https://codereview.chromium.org/1844013002/diff/290001/content/renderer/render_widget.cc File content/renderer/render_widget.cc (right): https://codereview.chromium.org/1844013002/diff/290001/content/renderer/render_widget.cc#newcode1096 content/renderer/render_widget.cc:1096: physical_backing_size_ != params.physical_backing_size; On 2016/04/13 18:40:24, sievers wrote: > ...
4 years, 8 months ago (2016-04-13 20:29:25 UTC) #52
no sievers
https://codereview.chromium.org/1844013002/diff/290001/content/renderer/render_widget.cc File content/renderer/render_widget.cc (right): https://codereview.chromium.org/1844013002/diff/290001/content/renderer/render_widget.cc#newcode1096 content/renderer/render_widget.cc:1096: physical_backing_size_ != params.physical_backing_size; On 2016/04/13 20:29:25, bokan wrote: > ...
4 years, 8 months ago (2016-04-13 23:04:31 UTC) #53
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1844013002/330001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1844013002/330001
4 years, 8 months ago (2016-04-20 01:45:27 UTC) #55
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_asan_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/148702)
4 years, 8 months ago (2016-04-20 02:36:37 UTC) #57
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1844013002/350001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1844013002/350001
4 years, 8 months ago (2016-04-21 22:09:17 UTC) #59
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 8 months ago (2016-04-22 01:53:47 UTC) #61
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1844013002/370001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1844013002/370001
4 years, 7 months ago (2016-04-27 12:38:27 UTC) #64
commit-bot: I haz the power
Try jobs failed on following builders: android_chromium_gn_compile_dbg on tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_chromium_gn_compile_dbg/builds/57559)
4 years, 7 months ago (2016-04-27 12:56:06 UTC) #66
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1844013002/390001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1844013002/390001
4 years, 7 months ago (2016-04-27 14:10:58 UTC) #69
commit-bot: I haz the power
Committed patchset #20 (id:390001)
4 years, 7 months ago (2016-04-27 15:49:23 UTC) #71
commit-bot: I haz the power
4 years, 7 months ago (2016-04-30 17:10:08 UTC) #72
Message was sent while issue was closed.
Patchset 20 (id:??) landed as
https://crrev.com/c63441cc9941c223e2f2d311085903c00da85938
Cr-Commit-Position: refs/heads/master@{#390085}

Powered by Google App Engine
This is Rietveld 408576698