| Index: third_party/WebKit/Source/core/css/cssom/LengthValue.cpp
|
| diff --git a/third_party/WebKit/Source/core/css/cssom/LengthValue.cpp b/third_party/WebKit/Source/core/css/cssom/LengthValue.cpp
|
| index c08dc9485c1a0803ba69e9ac9c2f3f0a2a254ef7..7b9bc8f165b86bb500cdb2037db8811fd09b0539 100644
|
| --- a/third_party/WebKit/Source/core/css/cssom/LengthValue.cpp
|
| +++ b/third_party/WebKit/Source/core/css/cssom/LengthValue.cpp
|
| @@ -161,6 +161,45 @@ const String& LengthValue::lengthTypeToString(LengthValue::LengthUnit unit)
|
| }
|
| }
|
|
|
| +CSSPrimitiveValue::UnitType LengthValue::lengthTypeToPrimitiveType(LengthValue::LengthUnit unit)
|
| +{
|
| + switch (unit) {
|
| + case Px:
|
| + return CSSPrimitiveValue::UnitType::Pixels;
|
| + case Percent:
|
| + return CSSPrimitiveValue::UnitType::Percentage;
|
| + case Em:
|
| + return CSSPrimitiveValue::UnitType::Ems;
|
| + case Ex:
|
| + return CSSPrimitiveValue::UnitType::Exs;
|
| + case Ch:
|
| + return CSSPrimitiveValue::UnitType::Chs;
|
| + case Rem:
|
| + return CSSPrimitiveValue::UnitType::Rems;
|
| + case Vw:
|
| + return CSSPrimitiveValue::UnitType::ViewportWidth;
|
| + case Vh:
|
| + return CSSPrimitiveValue::UnitType::ViewportHeight;
|
| + case Vmin:
|
| + return CSSPrimitiveValue::UnitType::ViewportMin;
|
| + case Vmax:
|
| + return CSSPrimitiveValue::UnitType::ViewportMax;
|
| + case Cm:
|
| + return CSSPrimitiveValue::UnitType::Centimeters;
|
| + case Mm:
|
| + return CSSPrimitiveValue::UnitType::Millimeters;
|
| + case In:
|
| + return CSSPrimitiveValue::UnitType::Inches;
|
| + case Pc:
|
| + return CSSPrimitiveValue::UnitType::Picas;
|
| + case Pt:
|
| + return CSSPrimitiveValue::UnitType::Points;
|
| + default:
|
| + ASSERT_NOT_REACHED();
|
| + return CSSPrimitiveValue::UnitType::Pixels;
|
| + }
|
| +}
|
| +
|
| LengthValue* LengthValue::addInternal(const LengthValue*, ExceptionState&)
|
| {
|
| ASSERT_NOT_REACHED();
|
|
|