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

Issue 1015303002: Promote new CSS parser to experimental (Closed)

Created:
5 years, 9 months ago by Timothy Loh
Modified:
5 years, 9 months ago
CC:
blink-reviews
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Promote new CSS parser to experimental This patch promotes the new CSS parser to experimental, rebaselining the tests with changed behaviour. The new parser will now handle everything except for when the inspector uses a CSSParserObserver, which I'll add support for soon. In tests I ran on a Nexus 7 (2013 model), the new parser performed on average 18% faster than the existing parser (independent of stylesheet size). The only case which which didn't show an improvement were those with extremely large strings ("url(data:font/opentype;base64,..." for example). There are quite a few really small behaviour changes. The following changes affected existing layout tests which have been updated in this patch: - <an+b> serialization now matches the spec instead of just copying the input. http://dev.w3.org/csswg/css-syntax/#serializing-anb - @supports requires whitespace after not/or/and and before or/and. This matches the spec and Firefox. Usage of the invalid syntax is virtually zero. http://dev.w3.org/csswg/css-conditional-3/#at-supports - CSSSupportsRule now serializes the condition instead of just copying the input. - Escapes with value 0 get replaced by U+FFFD http://dev.w3.org/csswg/css-syntax/#consume-escaped-code-point - Namespaces in selectors are only allowed in front of element names. http://dev.w3.org/csswg/selectors-4/#grammar - \r\n is considered a single whitespace (a single whitespace after an escaped character is ignored, so we won't leave an extra whitespace now). http://dev.w3.org/csswg/css-syntax/#input-preprocessing - Escapes are now allowed in dimension types (although it probably never makes sense to write 16\70\78 instead of 16px...) - Strings will now be terminated at a newline (a <bad-string-token> is produced), instead of continuing to look ahead of an ending quote. http://dev.w3.org/csswg/css-syntax/#consume-string-token I also noticed a few more behaviour changes which our layout tests don't cover yet. Most of these are covered by unit tests, but I'll add layout tests for some of these shortly: - Null characters are now replaced by U+FFFD during tokenization. http://dev.w3.org/csswg/css-syntax/#input-preprocessing - We now reject scientific notation of the form "16e-px" - We now reject percentages with extra %s (left: 10%%%) - We now allow :nth-* case insensitively - We now allow idents to start with -- - We now parse <an+b> and <quirky-color> in terms of CSS tokens http://dev.w3.org/csswg/css-syntax/#the-anb-type https://quirks.spec.whatwg.org/#the-hashless-hex-color-quirk BUG=330389 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=192641

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+141 lines, -164 lines) Patch
M LayoutTests/css3/parsing-css3-nthchild.html View 1 1 chunk +6 lines, -8 lines 0 comments Download
M LayoutTests/css3/parsing-css3-nthchild-expected.txt View 1 1 chunk +12 lines, -16 lines 0 comments Download
M LayoutTests/css3/supports.html View 1 2 chunks +5 lines, -5 lines 0 comments Download
M LayoutTests/css3/supports-cssom.html View 1 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/css3/supports-cssom-expected.txt View 1 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/css3/supports-dom-api.html View 1 2 1 chunk +4 lines, -4 lines 0 comments Download
M LayoutTests/css3/supports-dom-api-expected.txt View 1 2 1 chunk +4 lines, -4 lines 0 comments Download
M LayoutTests/css3/supports-expected.txt View 1 1 chunk +4 lines, -4 lines 0 comments Download
M LayoutTests/fast/css/font_property_normal.html View 1 1 chunk +2 lines, -2 lines 0 comments Download
M LayoutTests/fast/css/parsing-css-nth-child.html View 1 1 chunk +15 lines, -21 lines 0 comments Download
M LayoutTests/fast/css/parsing-css-nth-child-expected.txt View 1 1 chunk +30 lines, -42 lines 0 comments Download
M LayoutTests/fast/css/parsing-css-number-types-expected.txt View 1 1 chunk +10 lines, -10 lines 0 comments Download
M LayoutTests/fast/css/parsing-css-wrap-expected.txt View 1 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/css/script-tests/string-quote-binary.js View 1 1 chunk +15 lines, -14 lines 0 comments Download
M LayoutTests/fast/css/string-quote-binary-expected.txt View 1 1 chunk +8 lines, -8 lines 0 comments Download
M LayoutTests/fast/css/unknown-pseudo-element-matching.html View 1 1 chunk +5 lines, -5 lines 0 comments Download
M LayoutTests/fast/css/unknown-pseudo-element-matching-expected.txt View 1 1 chunk +5 lines, -5 lines 0 comments Download
M LayoutTests/fast/dom/css-selectorText-expected.txt View 1 1 chunk +12 lines, -12 lines 0 comments Download
M Source/platform/RuntimeEnabledFeatures.in View 1 2 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 10 (3 generated)
Timothy Loh
This patch depends on https://codereview.chromium.org/1018213004/ getting reviewed and landed first. Aside from that, everything should ...
5 years, 9 months ago (2015-03-20 05:58:50 UTC) #2
alancutter (OOO until 2018)
lgtm
5 years, 9 months ago (2015-03-26 05:38:20 UTC) #4
Timothy Loh
pdr: PTAL for Source/platform/. I'll probably also send out a patch to move this to ...
5 years, 9 months ago (2015-03-26 07:05:02 UTC) #5
Timothy Loh
On 2015/03/26 07:05:02, Timothy Loh wrote: > pdr: PTAL for Source/platform/. I'll probably also send ...
5 years, 9 months ago (2015-03-26 07:07:23 UTC) #6
pdr.
On 2015/03/26 at 07:07:23, timloh wrote: > On 2015/03/26 07:05:02, Timothy Loh wrote: > > ...
5 years, 9 months ago (2015-03-26 18:02:32 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1015303002/60001
5 years, 9 months ago (2015-03-26 23:45:48 UTC) #9
commit-bot: I haz the power
5 years, 9 months ago (2015-03-27 00:33:04 UTC) #10
Message was sent while issue was closed.
Committed patchset #3 (id:60001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=192641

Powered by Google App Engine
This is Rietveld 408576698