DescriptionPromote 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 : #Messages
Total messages: 10 (3 generated)
|