Commit 10d25b18 authored by Darren Shen's avatar Darren Shen Committed by Commit Bot

Revert "[CSSParser] Reject properties that cannot use the fast path."

This reverts commit 1fb83262.

Reason for revert: Doesn't seem to improve performance.

Original change's description:
> [CSSParser] Reject properties that cannot use the fast path.
> 
> When parsing CSS property values, we first do a quick scan to see if the
> value is simple enough to avoid tokenizing. This works well for things
> like lengths, where the values have predictable structure. If the scan
> failed, we do tokenization and parsing as fallback. Hence, for properties
> that don't use the fast path, we do some extra work.
> 
> This patch adds an early exit for the fast path code for properties that
> we know will almost never use the fast path.
> 
> Bug: 605792
> Change-Id: Iba211c844d5faa2c7272d10fd02b127d5c6abe1b
> Reviewed-on: https://chromium-review.googlesource.com/701957
> Reviewed-by: nainar <nainar@chromium.org>
> Commit-Queue: Darren Shen <shend@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#511324}

TBR=nainar@chromium.org,shend@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 605792
Change-Id: If73e39e891c892aef1b745b95f45df8ba242af8c
Reviewed-on: https://chromium-review.googlesource.com/746421Reviewed-by: default avatarDarren Shen <shend@chromium.org>
Commit-Queue: Darren Shen <shend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#512772}
parent 09d231c7
...@@ -1227,24 +1227,9 @@ static CSSValue* ParseSimpleTransform(CSSPropertyID property_id, ...@@ -1227,24 +1227,9 @@ static CSSValue* ParseSimpleTransform(CSSPropertyID property_id,
return ParseSimpleTransformList(string.Characters16(), string.length()); return ParseSimpleTransformList(string.Characters16(), string.length());
} }
// This is a blacklist for common properties that require fast parsing but
// cannot be parsed via a fast path. Blacklisting them will reduce extra
// work when their values are not suitable for the fast paths.
static bool IsFastPathPossibleForProperty(CSSPropertyID property_id) {
switch (property_id) {
case CSSPropertyTransitionDuration:
case CSSPropertyFilter:
return false;
default:
return true;
}
}
CSSValue* CSSParserFastPaths::MaybeParseValue(CSSPropertyID property_id, CSSValue* CSSParserFastPaths::MaybeParseValue(CSSPropertyID property_id,
const String& string, const String& string,
CSSParserMode parser_mode) { CSSParserMode parser_mode) {
if (!IsFastPathPossibleForProperty(property_id))
return nullptr;
if (CSSValue* length = if (CSSValue* length =
ParseSimpleLengthValue(property_id, string, parser_mode)) ParseSimpleLengthValue(property_id, string, parser_mode))
return length; return length;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment