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

Issue 1397713004: Don't bother layout until first navigation is done.

Created:
5 years, 2 months ago by kouhei (in TOK)
Modified:
4 years, 9 months ago
Reviewers:
tkent, esprehn, tzik
CC:
blink-reviews, chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Don't bother layout until first navigation is done. Before this CL, null layout was triggered before new navigation is started, which delayed main resource request dispatch. This CL avoids triggering those null layout synchronously against the blank document loaded before navigations. BUG=540988

Patch Set 1 #

Patch Set 2 : upd #

Patch Set 3 : patch FrameView::layout instead / add test #

Patch Set 4 : use PS2 approach #

Patch Set 5 : hadFirstLayout #

Patch Set 6 : rebased #

Patch Set 7 : rebased #

Patch Set 8 : rebased #

Patch Set 9 : fix ParameterizedWebFrameTest_CompositedSelectionBoundsCleared #

Patch Set 10 : Document::isInitialEmptyDocument() #

Total comments: 2

Patch Set 11 : move the check to Document::updateLayoutTree #

Total comments: 1

Patch Set 12 : allow clean cycle #

Patch Set 13 : trytest #

Patch Set 14 : fix browser_tests #

Patch Set 15 : only skip layout on main frame #

Patch Set 16 : rebased #

Patch Set 17 : another attempt to fix tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+87 lines, -6 lines) Patch
M content/renderer/render_view_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +6 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Document.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Document.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +21 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/dom/StyleEngine.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp View 1 2 3 4 5 6 7 8 9 10 2 chunks +4 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/testing/DummyPageHolder.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/WebFrameContentDumper.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/web/WebLocalFrameImpl.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +2 lines, -0 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 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/web/tests/DocumentLoadingRenderingTest.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +18 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/tests/TextFinderTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +4 lines, -1 line 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 3 chunks +7 lines, -1 line 0 comments Download
M third_party/WebKit/Source/web/tests/WebViewTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/tests/sim/SimTest.h View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/tests/sim/SimWebViewClient.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +4 lines, -0 lines 0 comments Download

Messages

Total messages: 35 (10 generated)
kouhei (in TOK)
tzik-san: Would you measure the performance impact of this CL? Thanks.
5 years, 2 months ago (2015-10-13 04:36:12 UTC) #2
tzik
On 2015/10/13 04:36:12, kouhei wrote: > tzik-san: Would you measure the performance impact of this ...
5 years, 2 months ago (2015-10-13 05:26:16 UTC) #3
kouhei (in TOK)
tzik: Thanks! tkent: Would you take a look?
5 years, 2 months ago (2015-10-13 05:43:22 UTC) #5
tkent
Can you make a test?
5 years, 2 months ago (2015-10-13 06:09:34 UTC) #6
esprehn
On 2015/10/13 at 06:09:34, tkent wrote: > Can you make a test? You should write ...
5 years, 2 months ago (2015-10-19 06:11:19 UTC) #7
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1397713004/50001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1397713004/50001
5 years, 2 months ago (2015-10-20 04:19:54 UTC) #9
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_android_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_android_rel_ng/builds/84180)
5 years, 2 months ago (2015-10-20 07:07:54 UTC) #11
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1397713004/70001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1397713004/70001
5 years, 1 month ago (2015-10-26 03:48:49 UTC) #13
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_android_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_android_rel_ng/builds/86689)
5 years, 1 month ago (2015-10-26 06:44:40 UTC) #15
kouhei (in TOK)
On 2015/10/26 06:44:40, commit-bot: I haz the power wrote: > Dry run: Try jobs failed ...
5 years, 1 month ago (2015-10-27 05:31:03 UTC) #16
kouhei (in TOK)
tkent, tzik: Can we revisit this CL? Android issue seems to be now gone.
5 years, 1 month ago (2015-11-20 06:02:40 UTC) #17
tkent
Can we just change the condition of FrameView::shouldThrottleRendering()?
5 years, 1 month ago (2015-11-20 06:22:51 UTC) #18
kouhei (in TOK)
resuming work on this CL. On 2015/11/20 06:22:51, tkent wrote: > Can we just change ...
4 years, 11 months ago (2016-01-20 01:56:13 UTC) #19
tkent
On 2016/01/20 at 01:56:13, kouhei wrote: > > Can we just change the condition of ...
4 years, 11 months ago (2016-01-20 04:19:58 UTC) #20
tkent
On 2016/01/20 at 01:56:13, kouhei wrote: > > Can we just change the condition of ...
4 years, 11 months ago (2016-01-20 04:19:58 UTC) #21
kouhei (in TOK)
On 2016/01/20 04:19:58, tkent wrote: > On 2016/01/20 at 01:56:13, kouhei wrote: > > > ...
4 years, 11 months ago (2016-01-21 02:00:32 UTC) #22
tkent
https://codereview.chromium.org/1397713004/diff/170001/third_party/WebKit/Source/core/editing/FrameSelection.cpp File third_party/WebKit/Source/core/editing/FrameSelection.cpp (right): https://codereview.chromium.org/1397713004/diff/170001/third_party/WebKit/Source/core/editing/FrameSelection.cpp#newcode912 third_party/WebKit/Source/core/editing/FrameSelection.cpp:912: if (!document->isInitialEmptyDocument()) Can you move isInitialEmptyDocument() check to Document::updateLayoutTree(), ...
4 years, 11 months ago (2016-01-21 02:19:32 UTC) #23
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1397713004/190001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1397713004/190001
4 years, 10 months ago (2016-02-18 03:50:24 UTC) #25
kouhei (in TOK)
tkent-san: PTAL https://codereview.chromium.org/1397713004/diff/170001/third_party/WebKit/Source/core/editing/FrameSelection.cpp File third_party/WebKit/Source/core/editing/FrameSelection.cpp (right): https://codereview.chromium.org/1397713004/diff/170001/third_party/WebKit/Source/core/editing/FrameSelection.cpp#newcode912 third_party/WebKit/Source/core/editing/FrameSelection.cpp:912: if (!document->isInitialEmptyDocument()) On 2016/01/21 02:19:32, tkent wrote: ...
4 years, 10 months ago (2016-02-18 03:50:50 UTC) #26
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: cast_shell_linux on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/cast_shell_linux/builds/117521)
4 years, 10 months ago (2016-02-18 04:27:55 UTC) #28
tkent
The approach looks good. Please address test failures. https://codereview.chromium.org/1397713004/diff/190001/third_party/WebKit/Source/web/WebViewImpl.cpp File third_party/WebKit/Source/web/WebViewImpl.cpp (right): https://codereview.chromium.org/1397713004/diff/190001/third_party/WebKit/Source/web/WebViewImpl.cpp#newcode1862 third_party/WebKit/Source/web/WebViewImpl.cpp:1862: if ...
4 years, 10 months ago (2016-02-19 00:43:40 UTC) #29
esprehn
This doesn't seem like a good change, what's the actual improvement, your change doesn't say ...
4 years, 10 months ago (2016-02-26 21:23:54 UTC) #32
esprehn
This doesn't seem like a good change, what's the actual improvement, your change doesn't say ...
4 years, 10 months ago (2016-02-26 21:23:54 UTC) #33
kouhei (in TOK)
On 2016/02/26 21:23:54, esprehn wrote: > This doesn't seem like a good change, what's the ...
4 years, 9 months ago (2016-02-29 21:55:41 UTC) #34
kouhei (in TOK)
4 years, 9 months ago (2016-02-29 21:56:54 UTC) #35
On 2016/02/29 21:55:41, kouhei wrote:
> On 2016/02/26 21:23:54, esprehn wrote:
> > This doesn't seem like a good change, what's the actual improvement, your
> change
> > doesn't say why this is better? Layout on about:blank is super cheap.
> > 
> > We should just avoid pumping frames for the initial document not hack up the
> > lifecycle like this.
> 
> The problem I'm trying to address in this CL is first layout -> StyleEngine
init
> -> parse UA stylesheet blocking resource fetches.
> I'm happy as long as the resource fetches are not blocked by parse UA
> stylesheet.
> 
> PS4 patches WebView{,Impl} initializations which end up triggering the first
> layout on initial empty documents, and
> PS17 is more generic version that avoids forced layout on initial empty
> documents.
> Alternative suggestions are welcomed.

Trace of initial layout triggering UA stylesheet parse:
https://googledrive.com/host/0B5o-0Snm1_rFbTlKcjZkdGN3eEk

Powered by Google App Engine
This is Rietveld 408576698