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

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

Issue 645033004: Move rolling back badly parsed property to CSSPropertyParser::parseValue (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « Source/core/css/parser/CSSGrammar.y ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/parser/CSSPropertyParser.cpp
diff --git a/Source/core/css/parser/CSSPropertyParser.cpp b/Source/core/css/parser/CSSPropertyParser.cpp
index ce1cf8d1247902b8c16b7aaf9267437e21f48118..7c87e4d8ff0113e5722eadc072bd2242467b5014 100644
--- a/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/Source/core/css/parser/CSSPropertyParser.cpp
@@ -120,6 +120,8 @@ bool CSSPropertyParser::parseValue(CSSPropertyID property, bool important,
CSSParserValueList* valueList, const CSSParserContext& context, bool inViewport,
WillBeHeapVector<CSSProperty, 256>& parsedProperties, CSSRuleSourceData::Type ruleType)
{
+ int parsedPropertiesSize = parsedProperties.size();
+
CSSPropertyParser parser(valueList, context, inViewport, parsedProperties, ruleType);
bool parseSuccess = parser.parseValue(property, important);
@@ -127,6 +129,9 @@ bool CSSPropertyParser::parseValue(CSSPropertyID property, bool important,
if (parseSuccess && context.useCounter())
context.useCounter()->count(context, property);
+ if (!parseSuccess)
+ parser.rollbackLastProperties(parsedProperties.size() - parsedPropertiesSize);
+
return parseSuccess;
}
« no previous file with comments | « Source/core/css/parser/CSSGrammar.y ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698