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

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

Issue 2115923002: Improve numeric value handling in CSS Parser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: V2 Created 4 years, 5 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 | « third_party/WebKit/Source/core/css/parser/CSSParserToken.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c97e9a71fbd6107e43b3e073b90c33de58b94e86..c9065ee9f36af8e9d9e427b3ae6709e14fa07a83 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -90,23 +90,10 @@ void CSSPropertyParser::addExpandedPropertyForValue(CSSPropertyID property, cons
addProperty(longhands[i], property, value, important);
}
-static bool hasInvalidNumericValues(const CSSParserTokenRange& range)
-{
- for (const CSSParserToken& token : range) {
- CSSParserTokenType type = token.type();
- if ((type == NumberToken || type == DimensionToken || type == PercentageToken)
- && !token.isValidNumericValue())
- return true;
- }
- return false;
-}
-
bool CSSPropertyParser::parseValue(CSSPropertyID unresolvedProperty, bool important,
const CSSParserTokenRange& range, const CSSParserContext& context,
HeapVector<CSSProperty, 256>& parsedProperties, StyleRule::RuleType ruleType)
{
- if (hasInvalidNumericValues(range))
- return false;
int parsedPropertiesSize = parsedProperties.size();
CSSPropertyParser parser(range, context, &parsedProperties);
@@ -135,8 +122,6 @@ bool CSSPropertyParser::parseValue(CSSPropertyID unresolvedProperty, bool import
const CSSValue* CSSPropertyParser::parseSingleValue(
CSSPropertyID property, const CSSParserTokenRange& range, const CSSParserContext& context)
{
- if (hasInvalidNumericValues(range))
- return nullptr;
CSSPropertyParser parser(range, context, nullptr);
const CSSValue* value = parser.parseSingleValue(property);
if (!value || !parser.m_range.atEnd())
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSParserToken.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698