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

Unified Diff: Source/core/css/CSSPrimitiveValue.cpp

Issue 209443003: Refactor unitTable access (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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.h ('k') | Source/core/css/parser/MediaQueryToken.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSPrimitiveValue.cpp
diff --git a/Source/core/css/CSSPrimitiveValue.cpp b/Source/core/css/CSSPrimitiveValue.cpp
index f909052ffff057a59f5a6a94a023d17ad237455b..86229694bf49001ccc6bb3d16556a2a923191e86 100644
--- a/Source/core/css/CSSPrimitiveValue.cpp
+++ b/Source/core/css/CSSPrimitiveValue.cpp
@@ -140,10 +140,10 @@ CSSPrimitiveValue::UnitTable createUnitTable()
return table;
}
-CSSPrimitiveValue::UnitTable& CSSPrimitiveValue::getUnitTable()
+CSSPrimitiveValue::UnitTypes CSSPrimitiveValue::fromName(const String& unit)
{
DEFINE_STATIC_LOCAL(UnitTable, unitTable, (createUnitTable()));
- return unitTable;
+ return unitTable.get(unit.lower());
}
CSSPrimitiveValue::UnitCategory CSSPrimitiveValue::unitCategory(CSSPrimitiveValue::UnitTypes type)
« no previous file with comments | « Source/core/css/CSSPrimitiveValue.h ('k') | Source/core/css/parser/MediaQueryToken.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698