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

Unified Diff: third_party/WebKit/Source/core/svg/SVGLengthTearOff.cpp

Issue 2354283002: Drop the SVGLengthType enumeration (Closed)
Patch Set: Drop the enum entirely Created 4 years, 3 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/svg/SVGLengthTearOff.h ('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/svg/SVGLengthTearOff.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGLengthTearOff.cpp b/third_party/WebKit/Source/core/svg/SVGLengthTearOff.cpp
index f6f83554953e2f50e774155a7323f7be8867fbf7..4a5d187ba7da844eaa9cde4d26866ef33360be29 100644
--- a/third_party/WebKit/Source/core/svg/SVGLengthTearOff.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGLengthTearOff.cpp
@@ -65,38 +65,38 @@ inline bool canResolveRelativeUnits(const SVGElement* contextElement)
inline CSSPrimitiveValue::UnitType toCSSUnitType(unsigned short type)
{
ASSERT(isValidLengthUnit(type));
- if (type == LengthTypeNumber)
+ if (type == SVGLengthTearOff::kSvgLengthtypeNumber)
return CSSPrimitiveValue::UnitType::UserUnits;
return static_cast<CSSPrimitiveValue::UnitType>(type);
}
-inline SVGLengthType toSVGLengthType(CSSPrimitiveValue::UnitType type)
+inline unsigned short toInterfaceConstant(CSSPrimitiveValue::UnitType type)
{
switch (type) {
case CSSPrimitiveValue::UnitType::Unknown:
- return LengthTypeUnknown;
+ return SVGLengthTearOff::kSvgLengthtypeUnknown;
case CSSPrimitiveValue::UnitType::UserUnits:
- return LengthTypeNumber;
+ return SVGLengthTearOff::kSvgLengthtypeNumber;
case CSSPrimitiveValue::UnitType::Percentage:
- return LengthTypePercentage;
+ return SVGLengthTearOff::kSvgLengthtypePercentage;
case CSSPrimitiveValue::UnitType::Ems:
- return LengthTypeEMS;
+ return SVGLengthTearOff::kSvgLengthtypeEms;
case CSSPrimitiveValue::UnitType::Exs:
- return LengthTypeEXS;
+ return SVGLengthTearOff::kSvgLengthtypeExs;
case CSSPrimitiveValue::UnitType::Pixels:
- return LengthTypePX;
+ return SVGLengthTearOff::kSvgLengthtypePx;
case CSSPrimitiveValue::UnitType::Centimeters:
- return LengthTypeCM;
+ return SVGLengthTearOff::kSvgLengthtypeCm;
case CSSPrimitiveValue::UnitType::Millimeters:
- return LengthTypeMM;
+ return SVGLengthTearOff::kSvgLengthtypeMm;
case CSSPrimitiveValue::UnitType::Inches:
- return LengthTypeIN;
+ return SVGLengthTearOff::kSvgLengthtypeIn;
case CSSPrimitiveValue::UnitType::Points:
- return LengthTypePT;
+ return SVGLengthTearOff::kSvgLengthtypePt;
case CSSPrimitiveValue::UnitType::Picas:
- return LengthTypePC;
+ return SVGLengthTearOff::kSvgLengthtypePc;
default:
- return LengthTypeUnknown;
+ return SVGLengthTearOff::kSvgLengthtypeUnknown;
}
}
@@ -113,9 +113,9 @@ bool SVGLengthTearOff::hasExposedLengthUnit()
|| unit == CSSPrimitiveValue::UnitType::UserUnits;
}
-SVGLengthType SVGLengthTearOff::unitType()
+unsigned short SVGLengthTearOff::unitType()
{
- return hasExposedLengthUnit() ? toSVGLengthType(target()->typeWithCalcResolved()) : LengthTypeUnknown;
+ return hasExposedLengthUnit() ? toInterfaceConstant(target()->typeWithCalcResolved()) : kSvgLengthtypeUnknown;
}
SVGLengthMode SVGLengthTearOff::unitMode()
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGLengthTearOff.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698