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

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

Issue 2051313002: Encapsulate the CSSPrimitiveValue UnitType trie bethind a method that takes a StringView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « third_party/WebKit/Source/core/css/cssom/CSSLengthValue.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/CSSParserToken.cpp
diff --git a/third_party/WebKit/Source/core/css/parser/CSSParserToken.cpp b/third_party/WebKit/Source/core/css/parser/CSSParserToken.cpp
index 308dc302f4b17af5da5328068c42f990a5fbe28f..a1a6abe301818192c21b88bbb10dad9bf0417820 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSParserToken.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSParserToken.cpp
@@ -5,7 +5,7 @@
#include "core/css/parser/CSSParserToken.h"
#include "core/css/CSSMarkup.h"
-#include "core/css/CSSPrimitiveValueUnitTrie.h"
+#include "core/css/CSSPrimitiveValue.h"
#include "core/css/parser/CSSPropertyParser.h"
#include "wtf/HashMap.h"
#include "wtf/text/StringBuilder.h"
@@ -69,11 +69,7 @@ void CSSParserToken::convertToDimensionWithUnit(StringView unit)
ASSERT(m_type == NumberToken);
m_type = DimensionToken;
initValueFromStringView(unit);
-
- if (unit.is8Bit())
- m_unit = static_cast<unsigned>(lookupCSSPrimitiveValueUnit(unit.characters8(), unit.length()));
- else
- m_unit = static_cast<unsigned>(lookupCSSPrimitiveValueUnit(unit.characters16(), unit.length()));
+ m_unit = static_cast<unsigned>(CSSPrimitiveValue::stringToUnitType(unit));
}
void CSSParserToken::convertToPercentage()
« no previous file with comments | « third_party/WebKit/Source/core/css/cssom/CSSLengthValue.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698