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

Issue 1903803002: Do not block painting for in-body CSS (Closed)

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

Description

Do not block painting for in-body CSS This mirrors the Firefox behavior where in-body stylesheets are not render-blocking. Developers can force the parser to block and get Edge/IE behavior by inserting script tags after the stylesheets (they will need to anyway because of Firefox). BUG=481122 Committed: https://crrev.com/ef8540e50d8f1e1cbd8b403b393a90d29985b9c5 Cr-Commit-Position: refs/heads/master@{#393347}

Patch Set 1 #

Patch Set 2 : Added parser-blocking logic #

Patch Set 3 : Fixed initialization order #

Patch Set 4 : Merged with trunk #

Patch Set 5 : Removed parser-blocking logic #

Patch Set 6 : Fixed tracking of created sheets #

Patch Set 7 : Fixed premature script execution #

Total comments: 2

Patch Set 8 : Moved the logic tracking of the before body state to a separate StyleEngineContext class #

Patch Set 9 : Fixed a mis-detected similarity by git cl #

Patch Set 10 : Merge with trunk #

Patch Set 11 : Fixed merge conflict #

Unified diffs Side-by-side diffs Delta from patch set Stats (+72 lines, -20 lines) Patch
M third_party/WebKit/Source/core/dom/Document.h View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Document.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +8 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/dom/ProcessingInstruction.h View 1 2 3 4 5 6 7 2 chunks +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/ProcessingInstruction.cpp View 1 2 3 4 5 6 7 3 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/dom/ScriptLoader.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/dom/StyleElement.h View 1 2 3 4 5 6 7 2 chunks +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/StyleElement.cpp View 1 2 3 4 5 6 7 3 chunks +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/dom/StyleEngine.h View 1 2 3 4 5 6 7 4 chunks +7 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/dom/StyleEngine.cpp View 1 2 3 4 5 6 7 8 9 10 2 chunks +13 lines, -4 lines 0 comments Download
A third_party/WebKit/Source/core/dom/StyleEngineContext.h View 1 2 3 4 5 6 7 8 1 chunk +24 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLLinkElement.h View 1 2 3 4 5 6 7 2 chunks +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLLinkElement.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 31 (12 generated)
Pat Meenan
esprehn@ PTAL This does not block the parser, it just prevents in-body styles from blocking ...
4 years, 7 months ago (2016-04-29 18:29:23 UTC) #5
esprehn
lgtm, but it's unfortunate we need to duplicate this logic in two places. Can we ...
4 years, 7 months ago (2016-05-06 21:50:15 UTC) #6
Pat Meenan
Double-check my understanding but AFAIK we have to attach the state of "before body" to ...
4 years, 7 months ago (2016-05-09 18:51:05 UTC) #7
esprehn
Right, I just mean having this book keeping in all these places seems bad, ideally ...
4 years, 7 months ago (2016-05-09 23:12:39 UTC) #8
esprehn
Ah no, so this has the logic in <link>, <style> and ProcessingInstruction. Ideally they'd add ...
4 years, 7 months ago (2016-05-09 23:13:24 UTC) #9
Pat Meenan
On 2016/05/09 23:13:24, esprehn wrote: > Ah no, so this has the logic in <link>, ...
4 years, 7 months ago (2016-05-10 00:09:07 UTC) #10
Pat Meenan
On 2016/05/10 00:09:07, Pat Meenan wrote: > On 2016/05/09 23:13:24, esprehn wrote: > > Ah ...
4 years, 7 months ago (2016-05-10 16:07:59 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/1903803002/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1903803002/160001
4 years, 7 months ago (2016-05-10 17:05:58 UTC) #13
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 7 months ago (2016-05-10 20:58:09 UTC) #15
esprehn
lgtm
4 years, 7 months ago (2016-05-12 17:17:16 UTC) #16
esprehn
Yeah that's much better. Thanks!
4 years, 7 months ago (2016-05-12 17:18:33 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1903803002/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1903803002/160001
4 years, 7 months ago (2016-05-12 17:37:20 UTC) #19
commit-bot: I haz the power
Try jobs failed on following builders: ios-device-gn on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device-gn/builds/4590) ios-simulator on tryserver.chromium.mac (JOB_FAILED, ...
4 years, 7 months ago (2016-05-12 17:39:21 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1903803002/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1903803002/200001
4 years, 7 months ago (2016-05-12 19:30:08 UTC) #24
commit-bot: I haz the power
Committed patchset #11 (id:200001)
4 years, 7 months ago (2016-05-12 20:53:32 UTC) #26
commit-bot: I haz the power
Patchset 11 (id:??) landed as https://crrev.com/ef8540e50d8f1e1cbd8b403b393a90d29985b9c5 Cr-Commit-Position: refs/heads/master@{#393347}
4 years, 7 months ago (2016-05-12 20:54:56 UTC) #28
rune
On 2016/05/12 20:54:56, commit-bot: I haz the power wrote: > Patchset 11 (id:??) landed as ...
4 years, 7 months ago (2016-05-13 09:15:30 UTC) #29
esprehn
On 2016/05/13 at 09:15:30, rune wrote: > On 2016/05/12 20:54:56, commit-bot: I haz the power ...
4 years, 7 months ago (2016-05-13 18:45:03 UTC) #30
Pat Meenan
4 years, 7 months ago (2016-05-13 19:43:52 UTC) #31
Message was sent while issue was closed.
On 2016/05/13 18:45:03, esprehn wrote:
> On 2016/05/13 at 09:15:30, rune wrote:
> > On 2016/05/12 20:54:56, commit-bot: I haz the power wrote:
> > > Patchset 11 (id:??) landed as
> > > https://crrev.com/ef8540e50d8f1e1cbd8b403b393a90d29985b9c5
> > > Cr-Commit-Position: refs/heads/master@{#393347}
> > 
> > Should we really have landed this without tests?
> 
> Err yeah that was a mistake, This needs some SimTests. Can you write them
> pmeenan@ ? You can look at DocumentLoadingRenderingTest for how to do it.

Sorry, working on it now.  Also taking a look at rune@'s request to unify the
logic for render-blocking and parser-blocking if possible.

Powered by Google App Engine
This is Rietveld 408576698