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

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

Issue 1319453002: Experiment: Switch to code-driven conversion of CSS unit type names. Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: drop redundant namespace prefix Created 5 years, 4 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/CSSPrimitiveValue.cpp ('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/CSSParserToken.cpp
diff --git a/Source/core/css/parser/CSSParserToken.cpp b/Source/core/css/parser/CSSParserToken.cpp
index e1ea4ec979816bdae879841790e2f52d6ae1723b..1bfed08363067abd76985057b713edbdf38e3789 100644
--- a/Source/core/css/parser/CSSParserToken.cpp
+++ b/Source/core/css/parser/CSSParserToken.cpp
@@ -68,7 +68,10 @@ void CSSParserToken::convertToDimensionWithUnit(CSSParserString unit)
ASSERT(m_type == NumberToken);
m_type = DimensionToken;
initValueFromCSSParserString(unit);
- m_unit = static_cast<unsigned>(CSSPrimitiveValue::fromName(unit));
+ if (m_valueIs8Bit)
+ m_unit = static_cast<unsigned>(CSSPrimitiveValue::fromName(reinterpret_cast<const LChar*>(m_valueDataCharRaw), m_valueLength));
+ else
+ m_unit = static_cast<unsigned>(CSSPrimitiveValue::fromName(reinterpret_cast<const UChar*>(m_valueDataCharRaw), m_valueLength));
}
void CSSParserToken::convertToPercentage()
« no previous file with comments | « Source/core/css/CSSPrimitiveValue.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698