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

Unified Diff: third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp

Issue 2891973004: WIP Add memory optimisation option to ConsumeCommaSeparatedList (Closed)
Patch Set: fixed dcheck bug Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
index e29b3bc6b9d72f12275fb08782efe52e328bda78..aa81ff2e8cc30b7851b338f6f944e47ba0f765dc 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -58,6 +58,8 @@ namespace blink {
using namespace CSSPropertyParserHelpers;
+const bool kNoOptimisation = false;
+
CSSPropertyParser::CSSPropertyParser(
const CSSParserTokenRange& range,
const CSSParserContext* context,
@@ -1655,40 +1657,47 @@ const CSSValue* CSSPropertyParser::ParseSingleValue(
return ConsumeLocale(range_);
case CSSPropertyAnimationDelay:
case CSSPropertyTransitionDelay:
- return ConsumeCommaSeparatedList(ConsumeTime, range_, kValueRangeAll);
+ return ConsumeCommaSeparatedList(kNoOptimisation, ConsumeTime, range_,
+ kValueRangeAll);
case CSSPropertyAnimationDirection:
return ConsumeCommaSeparatedList(
+ kNoOptimisation,
ConsumeIdent<CSSValueNormal, CSSValueAlternate, CSSValueReverse,
CSSValueAlternateReverse>,
range_);
case CSSPropertyAnimationDuration:
case CSSPropertyTransitionDuration:
- return ConsumeCommaSeparatedList(ConsumeTime, range_,
+ return ConsumeCommaSeparatedList(kNoOptimisation, ConsumeTime, range_,
kValueRangeNonNegative);
case CSSPropertyAnimationFillMode:
return ConsumeCommaSeparatedList(
+ kNoOptimisation,
ConsumeIdent<CSSValueNone, CSSValueForwards, CSSValueBackwards,
CSSValueBoth>,
range_);
case CSSPropertyAnimationIterationCount:
- return ConsumeCommaSeparatedList(ConsumeAnimationIterationCount, range_);
+ return ConsumeCommaSeparatedList(kNoOptimisation,
+ ConsumeAnimationIterationCount, range_);
case CSSPropertyAnimationName:
return ConsumeCommaSeparatedList(
- ConsumeAnimationName, range_, context_,
+ kNoOptimisation, ConsumeAnimationName, range_, context_,
unresolved_property == CSSPropertyAliasWebkitAnimationName);
case CSSPropertyAnimationPlayState:
return ConsumeCommaSeparatedList(
- ConsumeIdent<CSSValueRunning, CSSValuePaused>, range_);
+ kNoOptimisation, ConsumeIdent<CSSValueRunning, CSSValuePaused>,
+ range_);
case CSSPropertyTransitionProperty: {
- CSSValueList* list =
- ConsumeCommaSeparatedList(ConsumeTransitionProperty, range_);
- if (!list || !IsValidAnimationPropertyList(*list))
+ CSSValue* list = ConsumeCommaSeparatedList(
+ kNoOptimisation, ConsumeTransitionProperty, range_);
+ DCHECK(!list || list->IsBaseValueList());
+ if (!list || !IsValidAnimationPropertyList(*ToCSSValueList(list)))
return nullptr;
return list;
}
case CSSPropertyAnimationTimingFunction:
case CSSPropertyTransitionTimingFunction:
- return ConsumeCommaSeparatedList(ConsumeAnimationTimingFunction, range_);
+ return ConsumeCommaSeparatedList(kNoOptimisation,
+ ConsumeAnimationTimingFunction, range_);
case CSSPropertyGridColumnGap:
case CSSPropertyGridRowGap:
return ConsumeLengthOrPercent(range_, context_->Mode(),

Powered by Google App Engine
This is Rietveld 408576698