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

Issue 2315923002: Lazy Parse CSS (Closed)

Created:
4 years, 3 months ago by Charlie Harrison
Modified:
4 years, 1 month ago
CC:
darktears, apavlov+blink_chromium.org, auto-bisect-reviews_chromium.org, blink-reviews, blink-reviews-css, blink-reviews-style_chromium.org, chromium-reviews, dglazkov+blink, rwlbuis
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

This CL adds an experimental runtime enabled feature to defer parsing style rule properties until they are accessed. This patch adds two important classes: CSSLazyParsingState: This class holds all global knowledge required for parsing. This includes the parsing context, any allocated escaped strings, and the decoded sheet text. CSSLazyPropertyParserImpl: this class holds all local information needed for parsing a single declaration list for a single StyleRule. It holds a Vector of tokens and a reference to the CSSLazyparsingState. This is owned by the StyleRule. See the (slightly stale) design doc at https://goo.gl/ujMdJM BUG=642722 Committed: https://crrev.com/a0b2f70553233e7e96d3060d2c8d42c0c6fc0ade Cr-Commit-Position: refs/heads/master@{#427677}

Patch Set 1 #

Patch Set 2 : CL for src perf tryjob to run page_cycler_v2.typical_25 benchmark on all-android platform(s) #

Patch Set 3 : Respond to points brought up by rune@ #

Patch Set 4 : make sure we only parse author ones #

Patch Set 5 : [hack] give StyleSheetContents a Member<CSSStyleSheetResource> #

Patch Set 6 : plug leaks #

Total comments: 15

Patch Set 7 : Respond to comments, -attr() checking, +before/after checking #

Patch Set 8 : CL for src perf tryjob to run page_cycler_v2.typical_25 benchmark on all-android platform(s) #

Total comments: 14

Patch Set 9 : respond to comments, update ElementRuleCollector #

Patch Set 10 : s/->/. #

Total comments: 1

Patch Set 11 : respond to comments #

Patch Set 12 : Remove the closure and refactor logic into a separate file #

Total comments: 14

Patch Set 13 : esprehn review #

Unified diffs Side-by-side diffs Delta from patch set Stats (+251 lines, -20 lines) Patch
M third_party/WebKit/Source/core/css/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/ElementRuleCollector.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -2 lines 0 comments Download
M third_party/WebKit/Source/core/css/StylePropertySet.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +12 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/StylePropertySet.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/StyleRule.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +12 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/css/StyleRule.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +33 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/css/StyleSheetContents.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +5 lines, -2 lines 0 comments Download
A third_party/WebKit/Source/core/css/parser/CSSLazyParsingState.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +41 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/core/css/parser/CSSLazyParsingState.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +35 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/core/css/parser/CSSLazyPropertyParserImpl.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +37 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/core/css/parser/CSSLazyPropertyParserImpl.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +26 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/parser/CSSParser.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/css/parser/CSSParser.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/css/parser/CSSParserImpl.h View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +9 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +25 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/css/parser/CSSTokenizer.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 89 (53 generated)
Charlie Harrison
CL for src perf tryjob to run page_cycler_v2.typical_25 benchmark on all-android platform(s)
4 years, 3 months ago (2016-09-07 03:46:49 UTC) #1
Charlie Harrison
hiroshige, could you take a pass at this? PS 4 has a failing layout test ...
4 years, 3 months ago (2016-09-16 19:58:42 UTC) #20
hiroshige
On 2016/09/16 19:58:42, Charlie Harrison wrote: > hiroshige, could you take a pass at this? ...
4 years, 3 months ago (2016-09-21 08:14:17 UTC) #21
Charlie Harrison
On 2016/09/21 08:14:17, hiroshige wrote: > On 2016/09/16 19:58:42, Charlie Harrison wrote: > > hiroshige, ...
4 years, 3 months ago (2016-09-21 12:37:07 UTC) #22
Charlie Harrison
This might be still be problematic in the case where the m_referencedFromResource is cleared but ...
4 years, 3 months ago (2016-09-21 12:43:26 UTC) #23
Charlie Harrison
rune@, would you be able to help out on CSSStyleSheetResource lifetime issues? I was under ...
4 years, 3 months ago (2016-09-21 13:03:46 UTC) #25
rune
On 2016/09/21 at 13:03:46, csharrison wrote: > rune@, would you be able to help out ...
4 years, 3 months ago (2016-09-21 13:44:51 UTC) #26
Charlie Harrison
Yeah, I am slightly preferring (1) with the stipulation that we are careful about analyzing ...
4 years, 3 months ago (2016-09-21 20:07:47 UTC) #27
Charlie Harrison
LSAN doesn't complain about the newest PS. Rune would you mind giving a review pass?
4 years, 3 months ago (2016-09-22 18:06:01 UTC) #32
Charlie Harrison
(patch errors are due to kouhei's dependent patch)
4 years, 3 months ago (2016-09-22 18:06:35 UTC) #33
rune
Since this is mostly changing the parser, timloh@ should review it.
4 years, 3 months ago (2016-09-23 08:04:10 UTC) #35
Timothy Loh
Looks fine overall but I haven't thought hard about object lifetimse and memory usage yet ...
4 years, 2 months ago (2016-09-26 05:18:01 UTC) #36
Charlie Harrison
CL for src perf tryjob to run page_cycler_v2.typical_25 benchmark on all-android platform(s)
4 years, 2 months ago (2016-09-26 19:29:18 UTC) #38
Charlie Harrison
Thanks for the review! I've changed a few things in the current PS - No ...
4 years, 2 months ago (2016-09-26 22:14:45 UTC) #42
Charlie Harrison
https://codereview.chromium.org/2315923002/diff/140001/third_party/WebKit/Source/core/css/parser/CSSParser.h File third_party/WebKit/Source/core/css/parser/CSSParser.h (right): https://codereview.chromium.org/2315923002/diff/140001/third_party/WebKit/Source/core/css/parser/CSSParser.h#newcode14 third_party/WebKit/Source/core/css/parser/CSSParser.h:14: #include "wtf/Functional.h" These includes can be removed
4 years, 2 months ago (2016-09-26 22:16:59 UTC) #43
Timothy Loh
https://codereview.chromium.org/2315923002/diff/100001/third_party/WebKit/Source/core/css/StyleRule.cpp File third_party/WebKit/Source/core/css/StyleRule.cpp (right): https://codereview.chromium.org/2315923002/diff/100001/third_party/WebKit/Source/core/css/StyleRule.cpp#newcode230 third_party/WebKit/Source/core/css/StyleRule.cpp:230: m_properties = (*m_deferred)(); On 2016/09/26 22:14:45, Charlie Harrison wrote: ...
4 years, 2 months ago (2016-09-27 05:15:45 UTC) #46
Timothy Loh
Looks good so far, one more thing I'm not sure about: StyleSheetContents has a copy() ...
4 years, 2 months ago (2016-09-27 05:18:45 UTC) #47
Charlie Harrison
On 2016/09/27 05:18:45, Timothy Loh wrote: > Looks good so far, one more thing I'm ...
4 years, 2 months ago (2016-09-27 13:17:22 UTC) #48
Charlie Harrison
https://codereview.chromium.org/2315923002/diff/140001/third_party/WebKit/Source/core/css/StyleRule.cpp File third_party/WebKit/Source/core/css/StyleRule.cpp (right): https://codereview.chromium.org/2315923002/diff/140001/third_party/WebKit/Source/core/css/StyleRule.cpp#newcode250 third_party/WebKit/Source/core/css/StyleRule.cpp:250: const StylePropertySet& props = properties(); On 2016/09/27 05:15:45, Timothy ...
4 years, 2 months ago (2016-09-27 13:22:01 UTC) #51
Timothy Loh
lgtm :D https://codereview.chromium.org/2315923002/diff/180001/third_party/WebKit/Source/core/css/parser/CSSParserImpl.h File third_party/WebKit/Source/core/css/parser/CSSParserImpl.h (right): https://codereview.chromium.org/2315923002/diff/180001/third_party/WebKit/Source/core/css/parser/CSSParserImpl.h#newcode130 third_party/WebKit/Source/core/css/parser/CSSParserImpl.h:130: bool m_deferPropertyParsing = false; Not sure "= ...
4 years, 2 months ago (2016-09-28 02:01:44 UTC) #58
Charlie Harrison
Thanks! +esprehn for RuntimeEnabledFeatures, and any other things you'd like to look at :)
4 years, 2 months ago (2016-09-30 18:20:14 UTC) #60
Charlie Harrison
Note: I am still planning on landing this, after kouehi@ lands the patch to cache ...
4 years, 2 months ago (2016-10-10 18:53:02 UTC) #61
Timothy Loh
This needs a crbug btw
4 years, 2 months ago (2016-10-12 04:20:12 UTC) #62
Charlie Harrison
Added a BUG=. esprehn, ping for platform/ OWNERS, thanks! Note that kouhei's patch landed here: ...
4 years, 2 months ago (2016-10-13 12:58:13 UTC) #64
esprehn
At a high level I'd prefer if we used a class with methods instead of ...
4 years, 2 months ago (2016-10-13 16:38:18 UTC) #65
Charlie Harrison
On 2016/10/13 16:38:18, esprehn wrote: > At a high level I'd prefer if we used ...
4 years, 2 months ago (2016-10-13 16:42:15 UTC) #66
Charlie Harrison
I've refactored the code is avoid a closure. Instead, I've replaced it with two objects ...
4 years, 2 months ago (2016-10-14 12:11:28 UTC) #72
Timothy Loh
On 2016/10/14 12:11:28, Charlie Harrison wrote: > I've refactored the code is avoid a closure. ...
4 years, 2 months ago (2016-10-17 04:55:26 UTC) #73
Charlie Harrison
Thanks! esprehn@, friendly ping.
4 years, 2 months ago (2016-10-19 18:17:35 UTC) #74
esprehn
I'd like to avoid passing the boolean if possible and just check internally to the ...
4 years, 1 month ago (2016-10-24 21:20:21 UTC) #75
Charlie Harrison
Tried to address all comments except passing the boolean, which I will try to address ...
4 years, 1 month ago (2016-10-25 15:56:55 UTC) #78
Timothy Loh
https://codereview.chromium.org/2315923002/diff/220001/third_party/WebKit/Source/core/css/parser/CSSLazyPropertyParserImpl.h File third_party/WebKit/Source/core/css/parser/CSSLazyPropertyParserImpl.h (right): https://codereview.chromium.org/2315923002/diff/220001/third_party/WebKit/Source/core/css/parser/CSSLazyPropertyParserImpl.h#newcode26 third_party/WebKit/Source/core/css/parser/CSSLazyPropertyParserImpl.h:26: std::unique_ptr<Vector<String>> escapedStrings, On 2016/10/25 15:56:55, Charlie Harrison wrote: > ...
4 years, 1 month ago (2016-10-25 23:47:31 UTC) #81
Charlie Harrison
Right you are. Thanks again for the reviews everyone
4 years, 1 month ago (2016-10-26 13:40:18 UTC) #82
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2315923002/240001
4 years, 1 month ago (2016-10-26 13:40:44 UTC) #85
commit-bot: I haz the power
Committed patchset #13 (id:240001)
4 years, 1 month ago (2016-10-26 13:44:54 UTC) #87
commit-bot: I haz the power
4 years, 1 month ago (2016-10-26 13:46:36 UTC) #89
Message was sent while issue was closed.
Patchset 13 (id:??) landed as
https://crrev.com/a0b2f70553233e7e96d3060d2c8d42c0c6fc0ade
Cr-Commit-Position: refs/heads/master@{#427677}

Powered by Google App Engine
This is Rietveld 408576698