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

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

Issue 1181023004: Move rem handling out of CSSParserValues.cpp (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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/CSSPropertyParser.h ('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 e27fa5ce66af073d3b35c869321c000938253407..cffe32059f73b005caa7b01c061ff38a45a36e6e 100644
--- a/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/Source/core/css/parser/CSSPropertyParser.cpp
@@ -90,12 +90,13 @@ CSSPropertyParser::CSSPropertyParser(CSSParserValueList* valueList,
, m_inParseShorthand(0)
, m_currentShorthand(CSSPropertyInvalid)
, m_implicitShorthand(false)
+ , m_usesRems(false)
{
}
bool CSSPropertyParser::parseValue(CSSPropertyID unresolvedProperty, bool important,
CSSParserValueList* valueList, const CSSParserContext& context,
- WillBeHeapVector<CSSProperty, 256>& parsedProperties, StyleRule::Type ruleType)
+ WillBeHeapVector<CSSProperty, 256>& parsedProperties, StyleRule::Type ruleType, bool &usesRems)
{
int parsedPropertiesSize = parsedProperties.size();
@@ -118,6 +119,8 @@ bool CSSPropertyParser::parseValue(CSSPropertyID unresolvedProperty, bool import
if (!parseSuccess)
parser.rollbackLastProperties(parsedProperties.size() - parsedPropertiesSize);
+ else
+ usesRems = parser.m_usesRems;
return parseSuccess;
}
@@ -382,6 +385,10 @@ inline PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::parseValidPr
return cssValuePool().createIdentifierValue(identifier);
if (value->unit >= CSSPrimitiveValue::CSS_NUMBER && value->unit <= CSSPrimitiveValue::CSS_KHZ)
return createPrimitiveNumericValue(value);
+ if (value->unit == CSSPrimitiveValue::CSS_REMS) {
Timothy Loh 2015/06/17 01:35:18 Probably better in createPrimitiveNumericValue, I
+ m_usesRems = true;
+ return createPrimitiveNumericValue(value);
+ }
if (value->unit >= CSSPrimitiveValue::CSS_TURN && value->unit <= CSSPrimitiveValue::CSS_CHS)
return createPrimitiveNumericValue(value);
if (value->unit >= CSSPrimitiveValue::CSS_VW && value->unit <= CSSPrimitiveValue::CSS_VMAX)
« no previous file with comments | « Source/core/css/parser/CSSPropertyParser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698