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

Issue 1772853002: Block the HTML parser on external stylesheets (Closed)

Created:
4 years, 9 months ago by Pat Meenan
Modified:
4 years, 7 months ago
CC:
blink-reviews, blink-reviews-dom_chromium.org, blink-reviews-html_chromium.org, chromium-reviews, dglazkov+blink, eae+blinkwatch, kinuko+watch, rwlbuis, sof
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Block the HTML parser on external stylesheets **** Not yet ready for commit - Initial/experimental test **** Closed in favor of https://codereview.chromium.org/1903803002/ By blocking the main parser on external stylesheets Chrome can allow rendering to continue for styles and the part of the DOM tree that has already been built without needing to worry about content referenced after the style. This mirror's The Edge/IE behavior. Behind an experimental blink feature flag: - Pending CSS will not block render - Background parser breaks chunks after style/link tags so the main parser can cleanly pause parsing if either triggered a stylesheet to load. - Main parser pauses parsing while blocking stylesheets are pending (keeping the existing logic for tracking pending blocking stylesheets). - Parsing is resumed when the pending sheet(s) have loaded. BUG=481122

Patch Set 1 #

Total comments: 4

Patch Set 2 : Block on import as well #

Patch Set 3 : Layout test fixes (some) #

Patch Set 4 : Fixed webkit_unit_tests #

Patch Set 5 : Layout test fixes #

Patch Set 6 : Simplified parser blocking logic #

Unified diffs Side-by-side diffs Delta from patch set Stats (+136 lines, -71 lines) Patch
M third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/link-onerror-stylesheet-with-existent-and-non-existent-import.html View 1 2 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/link-onerror-stylesheet-with-non-existent-import.html View 1 2 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/link-onload.html View 1 2 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/link-onload-before-page-load.html View 1 2 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/link-onload-stylesheet-with-import.html View 1 2 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/fast/events/hit-test-cache-expected.txt View 1 2 3 4 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/events/hit-test-counts-expected.txt View 1 2 3 4 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/html/imports/import-events-inline.html View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/html/imports/import-ignore-document-write.html View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/html/imports/import-script.html View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/html/imports/import-style-link.html View 1 2 3 4 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/html/imports/import-style-link-block.html View 1 2 3 4 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/html/imports/resources/script-prototype-test.html View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/html/imports/sub-imports-onload.html View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/htmlimports/import-blocking-child-blocks-child.html View 1 2 3 4 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/htmlimports/import-blocking-nested-child-blocks-child.html View 1 2 3 4 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/htmlimports/import-blocking-nested-child-blocks-nested-child.html View 1 2 3 4 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/resources/js-test.js View 1 2 3 4 3 chunks +15 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Document.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/dom/Document.cpp View 1 2 3 4 1 chunk +8 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.cpp View 1 chunk +4 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.h View 1 2 3 4 5 3 chunks +6 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp View 1 2 3 4 5 18 chunks +62 lines, -37 lines 0 comments Download
M third_party/WebKit/Source/core/html/parser/HTMLTreeBuilderSimulator.h View 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/parser/HTMLTreeBuilderSimulator.cpp View 2 chunks +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/web/tests/DocumentLoadingRenderingTest.cpp View 1 2 3 4 5 chunks +7 lines, -11 lines 0 comments Download

Messages

Total messages: 24 (10 generated)
Pat Meenan
esprehn@ could you take a quick peek and see if this is what you had ...
4 years, 9 months ago (2016-03-07 19:44:35 UTC) #2
esprehn
https://codereview.chromium.org/1772853002/diff/1/third_party/WebKit/Source/core/dom/Document.cpp File third_party/WebKit/Source/core/dom/Document.cpp (right): https://codereview.chromium.org/1772853002/diff/1/third_party/WebKit/Source/core/dom/Document.cpp#newcode2100 third_party/WebKit/Source/core/dom/Document.cpp:2100: return haveImportsLoaded() && (RuntimeEnabledFeatures::htmlParserBlocksOnCSSEnabled() || haveStylesheetsLoaded()); I don't think ...
4 years, 9 months ago (2016-03-07 21:35:51 UTC) #3
Pat Meenan
https://codereview.chromium.org/1772853002/diff/1/third_party/WebKit/Source/core/dom/Document.cpp File third_party/WebKit/Source/core/dom/Document.cpp (right): https://codereview.chromium.org/1772853002/diff/1/third_party/WebKit/Source/core/dom/Document.cpp#newcode2100 third_party/WebKit/Source/core/dom/Document.cpp:2100: return haveImportsLoaded() && (RuntimeEnabledFeatures::htmlParserBlocksOnCSSEnabled() || haveStylesheetsLoaded()); On 2016/03/07 21:35:50, ...
4 years, 9 months ago (2016-03-07 21:49:53 UTC) #4
Pat Meenan
It now blocks on HTML5 imports as well. There are a collection of test pages ...
4 years, 9 months ago (2016-03-08 15:34:54 UTC) #5
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1772853002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1772853002/40001
4 years, 9 months ago (2016-03-10 16:17:23 UTC) #7
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/194618)
4 years, 9 months ago (2016-03-10 17:01:52 UTC) #9
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1772853002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1772853002/60001
4 years, 9 months ago (2016-03-14 15:01:37 UTC) #11
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/181062)
4 years, 9 months ago (2016-03-14 15:43:14 UTC) #13
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1772853002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1772853002/80001
4 years, 9 months ago (2016-03-15 17:50:31 UTC) #15
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/196875)
4 years, 9 months ago (2016-03-15 18:32:09 UTC) #17
esprehn
On 2016/03/08 at 15:34:54, pmeenan wrote: > It now blocks on HTML5 imports as well. ...
4 years, 9 months ago (2016-03-18 05:08:08 UTC) #18
esprehn
kouhei@ Can you look this over?
4 years, 8 months ago (2016-04-06 21:51:13 UTC) #20
kouhei (in TOK)
pmeenan: Would you tell me the status of this CL?
4 years, 8 months ago (2016-04-26 23:56:35 UTC) #21
Pat Meenan
4 years, 8 months ago (2016-04-27 00:55:00 UTC) #22
On 2016/04/26 23:56:35, kouhei wrote:
> pmeenan: Would you tell me the status of this CL?

I'm in the process of replacing it with this one which only pauses when in the
body and is somewhat cleaner: https://codereview.chromium.org/1903803002/

That said, I'm super-sketchy about the pausing and resuming of the parser and
getting the edge cases working. If it is too hairy I will fall back to just not
blocking paints but letting the parser continue. 

I was going to get the unit/layout tests working and then send it around but if
you have time to peek at it and let me know if it's a good idea to do or not it
would be appreciated.

Powered by Google App Engine
This is Rietveld 408576698