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

Issue 18601002: Add infrastructure for partial layouts (Closed)

Created:
7 years, 5 months ago by pdr.
Modified:
7 years, 3 months ago
Reviewers:
achicu, eseidel, esprehn, ojan
CC:
blink-reviews, kenneth.christiansen, eae+blinkwatch, leviw+renderwatch, dglazkov+blink, adamk+blink_chromium.org, jchaffraix+rendering
Visibility:
Public.

Description

Only do partial layouts when possible. This patch changes offsetWidth, offsetHeight, offsetLeft, and offsetTop to only layout a portion of the render tree, up to the target renderer. Partial layout leaves the root needing layout so a full layout must happen before painting. An example of the benefit of this patch is wikipedia where the following pattern is common: 1) page load 2) javascript calls offsetWidth, forcing a full layout 3) javascript injects style into the page, invalidating layout 4) a full layout is performed for painting With this patch, the offsetWidth call in #2 is significantly improved. Text autosizing currently removes most of the benefit of this patch, this will be addressed in a followup patch. Similarly, non-overlay scrollbars reduce the benefit from this patch. This is currently implemented behind the PartialLayout runtime enabled feature flag. BUG=283623 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=157252

Patch Set 1 #

Patch Set 2 : Fix a bug where siblings were still laid out #

Patch Set 3 : Work in progress v2 #

Total comments: 1

Patch Set 4 : Switch to opt-in for partial layout (RO::supportsPartialLayout) and add asserts #

Patch Set 5 : Fix release compile, minor cleanups #

Total comments: 1

Patch Set 6 : Rebase patch, fix SubtreeLayoutScope crash #

Patch Set 7 : If text autosizing is enabled, only partial layout for the second of two layouts #

Total comments: 28

Patch Set 8 : Address reviewer comments #

Total comments: 34

Patch Set 9 : Address reviewer comments. Add PartialLayoutState and PartialLayoutDisabler #

Total comments: 3

Patch Set 10 : Rebase, address Ojan's comments, fix usesOverlayScrollbars bug #

Patch Set 11 : Put behind PartialLayout runtime flag #

Total comments: 38

Patch Set 12 : Address reviewer comments #

Patch Set 13 : Address esprehns postLayoutTasks bug #

Patch Set 14 : Rebase, add skipped test #

Patch Set 15 : Add checks for view() #

Patch Set 16 : Change how reentrant scrollbar code works, change test to prove it works #

Total comments: 1

Patch Set 17 : define RenderObject::frameView in the header #

Unified diffs Side-by-side diffs Delta from patch set Stats (+482 lines, -42 lines) Patch
M LayoutTests/NeverFixTests View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +3 lines, -0 lines 0 comments Download
A LayoutTests/fast/dom/partial-layout-block.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +58 lines, -0 lines 0 comments Download
A LayoutTests/fast/dom/partial-layout-block-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -0 lines 0 comments Download
A LayoutTests/fast/dom/partial-layout-non-overlay-scrollbars.html View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +47 lines, -0 lines 0 comments Download
A LayoutTests/fast/dom/partial-layout-non-overlay-scrollbars-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -0 lines 0 comments Download
A LayoutTests/fast/dom/partial-layout-overlay-scrollbars.html View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +42 lines, -0 lines 0 comments Download
A LayoutTests/fast/dom/partial-layout-overlay-scrollbars-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -0 lines 0 comments Download
M Source/core/core.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/dom/Document.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +3 lines, -0 lines 0 comments Download
M Source/core/dom/Document.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +58 lines, -19 lines 0 comments Download
M Source/core/dom/Element.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +4 lines, -4 lines 0 comments Download
M Source/core/html/shadow/SliderThumbElement.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/page/FrameView.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +5 lines, -0 lines 0 comments Download
M Source/core/page/FrameView.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 11 chunks +35 lines, -17 lines 0 comments Download
M Source/core/page/RuntimeEnabledFeatures.in View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -0 lines 0 comments Download
A Source/core/rendering/PartialLayoutState.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +103 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderBlock.h View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderBlock.cpp View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +18 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderBlockLineLayout.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderDeprecatedFlexibleBox.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderDetailsMarker.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/rendering/RenderFieldset.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderFileUploadControl.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderFlexibleBox.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderFlowThread.h View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderFullScreen.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/rendering/RenderFullScreen.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/rendering/RenderGrid.h View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderListBox.h View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderListItem.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderMarquee.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderMediaControlElements.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/rendering/RenderMeter.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderMultiColumnBlock.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderObject.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 6 chunks +13 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderObject.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +6 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderProgress.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/rendering/RenderRegion.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/rendering/RenderRuby.h View 1 2 3 2 chunks +2 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderRubyBase.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderRubyRun.h View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/rendering/RenderRubyText.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderScrollbarPart.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderTable.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/rendering/RenderTableCaption.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderTableCell.h View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderTextControl.h View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -1 line 0 comments Download
M Source/core/rendering/RenderTextTrackCue.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/rendering/RenderView.h View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderView.cpp View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +15 lines, -0 lines 0 comments Download
M Source/core/rendering/SubtreeLayoutScope.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +6 lines, -0 lines 0 comments Download
M Source/core/rendering/svg/RenderSVGBlock.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 23 (0 generated)
achicu
https://codereview.chromium.org/18601002/diff/9001/Source/core/page/FrameView.cpp File Source/core/page/FrameView.cpp (right): https://codereview.chromium.org/18601002/diff/9001/Source/core/page/FrameView.cpp#newcode1082 Source/core/page/FrameView.cpp:1082: performPostLayoutTasks(); I think that the biggest performance improvement comes ...
7 years, 4 months ago (2013-08-15 13:48:21 UTC) #1
pdr.
On 2013/08/15 13:48:21, achicu wrote: > https://codereview.chromium.org/18601002/diff/9001/Source/core/page/FrameView.cpp > File Source/core/page/FrameView.cpp (right): > > https://codereview.chromium.org/18601002/diff/9001/Source/core/page/FrameView.cpp#newcode1082 > ...
7 years, 4 months ago (2013-08-15 23:34:08 UTC) #2
pdr.
On 2013/08/15 23:34:08, pdr wrote: > On 2013/08/15 13:48:21, achicu wrote: > > > https://codereview.chromium.org/18601002/diff/9001/Source/core/page/FrameView.cpp ...
7 years, 4 months ago (2013-08-18 02:29:21 UTC) #3
pdr.
This patch is getting close to needing a real review. We no longer fail any ...
7 years, 4 months ago (2013-08-18 02:45:12 UTC) #4
esprehn
I'll bite! This is very exciting.
7 years, 4 months ago (2013-08-18 03:00:30 UTC) #5
esprehn
Your partial layout method needs to always do a recalc style first, otherwise that loop ...
7 years, 4 months ago (2013-08-18 03:43:15 UTC) #6
pdr.
https://codereview.chromium.org/18601002/diff/23001/Source/core/dom/Document.cpp File Source/core/dom/Document.cpp (right): https://codereview.chromium.org/18601002/diff/23001/Source/core/dom/Document.cpp#newcode1801 Source/core/dom/Document.cpp:1801: void Document::tryPartialUpdateLayoutIgnorePendingStylesheets(RenderObject* stopLayoutAtRenderer) On 2013/08/18 03:43:15, esprehn wrote: > ...
7 years, 4 months ago (2013-08-20 06:19:10 UTC) #7
eseidel
https://codereview.chromium.org/18601002/diff/15001/Source/core/dom/Document.h File Source/core/dom/Document.h (right): https://codereview.chromium.org/18601002/diff/15001/Source/core/dom/Document.h#newcode491 Source/core/dom/Document.h:491: void tryPartialUpdateLayoutIgnorePendingStylesheets(RenderObject*); We really need to create some new ...
7 years, 4 months ago (2013-08-20 21:00:39 UTC) #8
eseidel
As I said to pdr in person: This work is fantastic. I would encourage him ...
7 years, 4 months ago (2013-08-20 21:08:53 UTC) #9
dglazkov
Sorry, just now got to look at it. This is great stuff, pdr!
7 years, 4 months ago (2013-08-23 16:27:15 UTC) #10
esprehn
Don't forget that always true if statement when you submit! :P https://codereview.chromium.org/18601002/diff/33001/Source/core/dom/Document.cpp File Source/core/dom/Document.cpp (right): ...
7 years, 4 months ago (2013-08-23 20:47:26 UTC) #11
pdr.
Thank you for the excellent reviews! This is getting closer. I'd like feedback on the ...
7 years, 4 months ago (2013-08-26 05:50:39 UTC) #12
ojan
No real substantive feedback from me... https://codereview.chromium.org/18601002/diff/50001/Source/core/dom/Document.cpp File Source/core/dom/Document.cpp (right): https://codereview.chromium.org/18601002/diff/50001/Source/core/dom/Document.cpp#newcode1781 Source/core/dom/Document.cpp:1781: } else if ...
7 years, 3 months ago (2013-08-27 01:33:41 UTC) #13
pdr.
OK gang, this has taken long enough :) The latest patch puts this feature behind ...
7 years, 3 months ago (2013-09-02 04:08:17 UTC) #14
esprehn
Your flag doesn't actually disable this feature since you don't early return. You also need ...
7 years, 3 months ago (2013-09-03 18:15:35 UTC) #15
eseidel
https://codereview.chromium.org/18601002/diff/59001/LayoutTests/fast/dom/partial-layout-block-expected.txt File LayoutTests/fast/dom/partial-layout-block-expected.txt (right): https://codereview.chromium.org/18601002/diff/59001/LayoutTests/fast/dom/partial-layout-block-expected.txt#newcode9 LayoutTests/fast/dom/partial-layout-block-expected.txt:9: WARN: shouldBe() expects string arguments Looks wrong. https://codereview.chromium.org/18601002/diff/59001/LayoutTests/fast/dom/partial-layout-block.html File ...
7 years, 3 months ago (2013-09-03 18:16:08 UTC) #16
eseidel
The idea is definitely lgtm. We really need to get this in and iterate. Left ...
7 years, 3 months ago (2013-09-03 19:14:26 UTC) #17
pdr.
Thanks for the comments. I need to figure out how to get linux and win ...
7 years, 3 months ago (2013-09-03 21:37:35 UTC) #18
esprehn
LGTM, Shadowfax show us the meaning of partial layout!
7 years, 3 months ago (2013-09-04 00:40:25 UTC) #19
pdr.
On 2013/09/04 00:40:25, esprehn wrote: > LGTM, Shadowfax show us the meaning of partial layout! ...
7 years, 3 months ago (2013-09-04 06:33:47 UTC) #20
esprehn
one nit, otherwise lgtm. Lets get this in and start iterating. https://codereview.chromium.org/18601002/diff/86001/Source/core/rendering/RenderObject.h File Source/core/rendering/RenderObject.h (right): ...
7 years, 3 months ago (2013-09-04 07:10:12 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pdr@chromium.org/18601002/59002
7 years, 3 months ago (2013-09-04 20:26:34 UTC) #22
commit-bot: I haz the power
7 years, 3 months ago (2013-09-05 01:06:26 UTC) #23
Message was sent while issue was closed.
Change committed as 157252

Powered by Google App Engine
This is Rietveld 408576698