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

Issue 190973007: Reland "Avoid layout/full-repaint on view height change if possible" (Closed)

Created:
6 years, 9 months ago by Xianzhu
Modified:
6 years, 9 months ago
CC:
blink-reviews, krit, bemjb+rendering_chromium.org, dsinclair, zoltan1, eae+blinkwatch, leviw+renderwatch, fs, ed+blinkwatch_opera.com, f(malita), gyuyoung.kim_webkit.org, Julien - ping for review, pdr., Stephen Chennney, rwlbuis, leviw_travelin_and_unemployed
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Reland "Avoid layout/full-repaint on view height change if possible" Original CL is https://codereview.chromium.org/99663004 Previously we always layout/full-repaint of the whole view when the height of the RenderView changes. In many cases this is unnecessary. Especially, this causes unnecessary cost on Android when the top control shows or hides. Avoid repaint if the RenderView doesn't needs full layout. The original CL was reverted because of issues caused. This CL has the following changes compared to the original CL: - Call ChromeClient::layoutUpdated() after the simplified layout. This is needed at least for WebViewImpl to update the page scale factor when the screen rotates on Android; - Combined the simplified layout code in RenderView::viewResized() and RenderView::needsLayoutOnLogicalHeightChange() into Renderview::trySimplifiedLayoutOnHeightChange() because the code are highly dependent (e.g. the new overflow code); - Handle overflow changes (bug 342185): - During a normal layout, overflow may be created or destroyed based on the relationship between the contents size and view size. We need to mimic the logic in simplified layout path; - Fallback to full layout if there is no vertical render overflow (page is not vertically scrollable) and the view height is shrinking, because without a full layout we can't know the new contents size. For Android this case rarely happen because we don't auto-hide the url bar if the page is not vertically scrollable. BUG=258219, 327815, 342185 TEST=WebFrameTest.heightChangeRepaint, WebFrameTest.heightChangeNoFullRepaintOverflowChange TEST=all layout tests still pass

Patch Set 1 : Original CL #

Patch Set 2 : New CL #

Total comments: 17

Patch Set 3 : Viewport media query, comments, etc. #

Total comments: 13

Patch Set 4 : computeOverflow, etc. #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+303 lines, -12 lines) Patch
M Source/core/frame/FrameView.h View 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/frame/FrameView.cpp View 1 2 3 1 chunk +35 lines, -1 line 0 comments Download
M Source/core/rendering/RenderBlock.h View 1 chunk +7 lines, -1 line 0 comments Download
M Source/core/rendering/RenderBox.cpp View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
M Source/core/rendering/RenderView.h View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderView.cpp View 1 2 3 1 chunk +76 lines, -0 lines 3 comments Download
M Source/core/rendering/svg/RenderSVGRoot.cpp View 1 chunk +2 lines, -3 lines 0 comments Download
M Source/web/tests/WebFrameTest.cpp View 1 2 2 chunks +94 lines, -4 lines 0 comments Download
A Source/web/tests/data/repaint/height-change-no-full-repaint-overflow-change.html View 1 1 chunk +6 lines, -0 lines 0 comments Download
A Source/web/tests/data/repaint/height-change-no-full-repaint1.html View 1 chunk +3 lines, -0 lines 0 comments Download
A Source/web/tests/data/repaint/height-change-no-full-repaint2.html View 1 chunk +5 lines, -0 lines 0 comments Download
A Source/web/tests/data/repaint/height-change-no-full-repaint3.html View 1 2 1 chunk +17 lines, -0 lines 0 comments Download
A Source/web/tests/data/repaint/height-change-repaint1.html View 1 chunk +4 lines, -0 lines 0 comments Download
A Source/web/tests/data/repaint/height-change-repaint2.html View 1 chunk +5 lines, -0 lines 0 comments Download
A Source/web/tests/data/repaint/height-change-repaint3.html View 1 chunk +7 lines, -0 lines 0 comments Download
A Source/web/tests/data/repaint/height-change-repaint4.html View 1 chunk +3 lines, -0 lines 0 comments Download
A Source/web/tests/data/repaint/height-change-repaint5.html View 1 chunk +3 lines, -0 lines 0 comments Download
A Source/web/tests/data/repaint/height-change-repaint6.html View 1 chunk +3 lines, -0 lines 0 comments Download
A Source/web/tests/data/repaint/height-change-repaint7.html View 1 chunk +17 lines, -0 lines 0 comments Download
A Source/web/tests/data/repaint/height-change-repaint8.html View 1 chunk +10 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
Xianzhu
6 years, 9 months ago (2014-03-08 01:30:03 UTC) #1
ojan
6 years, 9 months ago (2014-03-10 21:05:44 UTC) #2
esprehn
https://codereview.chromium.org/190973007/diff/60001/Source/core/frame/FrameView.cpp File Source/core/frame/FrameView.cpp (right): https://codereview.chromium.org/190973007/diff/60001/Source/core/frame/FrameView.cpp#newcode3193 Source/core/frame/FrameView.cpp:3193: // to avoid hang with resize events in seamless ...
6 years, 9 months ago (2014-03-10 21:32:29 UTC) #3
Xianzhu
Thanks for review! PTAL. https://codereview.chromium.org/190973007/diff/60001/Source/core/frame/FrameView.cpp File Source/core/frame/FrameView.cpp (right): https://codereview.chromium.org/190973007/diff/60001/Source/core/frame/FrameView.cpp#newcode3193 Source/core/frame/FrameView.cpp:3193: // to avoid hang with ...
6 years, 9 months ago (2014-03-11 00:55:13 UTC) #4
Julien - ping for review
https://codereview.chromium.org/190973007/diff/70001/Source/core/frame/FrameView.cpp File Source/core/frame/FrameView.cpp (right): https://codereview.chromium.org/190973007/diff/70001/Source/core/frame/FrameView.cpp#newcode3186 Source/core/frame/FrameView.cpp:3186: ScrollView::contentsResized(); Wouldn't it be possible to remove FrameView::contentsResized? All ...
6 years, 9 months ago (2014-03-11 01:23:36 UTC) #5
Xianzhu
https://codereview.chromium.org/190973007/diff/70001/Source/core/frame/FrameView.cpp File Source/core/frame/FrameView.cpp (right): https://codereview.chromium.org/190973007/diff/70001/Source/core/frame/FrameView.cpp#newcode3186 Source/core/frame/FrameView.cpp:3186: ScrollView::contentsResized(); On 2014/03/11 01:23:37, Julien Chaffraix - PST wrote: ...
6 years, 9 months ago (2014-03-11 19:05:13 UTC) #6
Xianzhu
6 years, 9 months ago (2014-03-13 16:12:58 UTC) #7
Xianzhu
More comments?
6 years, 9 months ago (2014-03-14 16:33:06 UTC) #8
eseidel
This seems really hard to get right, another "fast-path". The problem with doing a full ...
6 years, 9 months ago (2014-03-15 00:53:46 UTC) #9
esprehn
I'm not very comfortable with this fast path, especially not when you're doing things like ...
6 years, 9 months ago (2014-03-15 02:19:41 UTC) #10
Xianzhu
On 2014/03/15 00:53:46, eseidel wrote: > This seems really hard to get right, another "fast-path". ...
6 years, 9 months ago (2014-03-17 18:58:18 UTC) #11
eseidel
6 years, 9 months ago (2014-03-17 22:23:14 UTC) #12
I think we should just integrate this code into normal layout.  Mark a block as
needing height-layout, and then when in that mode, not bother to decend into
kids if not needed.

Maybe NeedsHeightOnlyLayout needs to be its own separate flag:
https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit...

Powered by Google App Engine
This is Rietveld 408576698