Chromium Code Reviews| Index: third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp |
| diff --git a/third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp b/third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp |
| index 82e384900049f2ed5302ff2879a437543655413b..5f43f38d000fee6dc21bbcaeec3830c3966388fa 100644 |
| --- a/third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp |
| +++ b/third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp |
| @@ -60,6 +60,7 @@ StringToUnitTable createStringToUnitTable() |
| table.set(String("in"), CSSPrimitiveValue::UnitType::Inches); |
| table.set(String("pt"), CSSPrimitiveValue::UnitType::Points); |
| table.set(String("pc"), CSSPrimitiveValue::UnitType::Picas); |
| + table.set(String(""), CSSPrimitiveValue::UnitType::UserCoordinates); |
| table.set(String("deg"), CSSPrimitiveValue::UnitType::Degrees); |
| table.set(String("rad"), CSSPrimitiveValue::UnitType::Radians); |
| table.set(String("grad"), CSSPrimitiveValue::UnitType::Gradians); |
| @@ -120,6 +121,7 @@ CSSPrimitiveValue::UnitCategory CSSPrimitiveValue::unitCategory(UnitType type) |
| case UnitType::Inches: |
| case UnitType::Points: |
| case UnitType::Picas: |
| + case UnitType::UserCoordinates: |
| return CSSPrimitiveValue::ULength; |
| case UnitType::Milliseconds: |
| case UnitType::Seconds: |
| @@ -328,6 +330,7 @@ void CSSPrimitiveValue::cleanup() |
| case UnitType::Inches: |
| case UnitType::Points: |
| case UnitType::Picas: |
| + case UnitType::UserCoordinates: |
| case UnitType::Degrees: |
| case UnitType::Radians: |
| case UnitType::Gradians: |
| @@ -459,6 +462,7 @@ double CSSPrimitiveValue::conversionToCanonicalUnitsScaleFactor(UnitType unitTyp |
| switch (unitType) { |
| // These are "canonical" units in their respective categories. |
| case UnitType::Pixels: |
| + case UnitType::UserCoordinates: |
| case UnitType::Degrees: |
| case UnitType::Milliseconds: |
| case UnitType::Hertz: |
| @@ -510,7 +514,6 @@ Length CSSPrimitiveValue::convertToLength(const CSSToLengthConversionData& conve |
| return computeLength<Length>(conversionData); |
| if (isPercentage()) |
| return Length(getDoubleValue(), Percent); |
| - ASSERT(isCalculated()); |
|
fs
2015/10/28 20:14:34
I guess this should be restored (I think this impl
Stephen Chennney
2015/10/30 18:00:55
I removed it because the exact same assertion is t
|
| return Length(cssCalcValue()->toCalcValue(conversionData)); |
| } |
| @@ -646,6 +649,7 @@ const char* CSSPrimitiveValue::unitTypeToString(UnitType type) |
| switch (type) { |
| case UnitType::Number: |
| case UnitType::Integer: |
| + case UnitType::UserCoordinates: |
| return ""; |
| case UnitType::Percentage: |
| return "%"; |
| @@ -744,6 +748,7 @@ String CSSPrimitiveValue::customCSSText() const |
| case UnitType::Inches: |
| case UnitType::Points: |
| case UnitType::Picas: |
| + case UnitType::UserCoordinates: |
| case UnitType::Degrees: |
| case UnitType::Radians: |
| case UnitType::Gradians: |
| @@ -799,6 +804,7 @@ bool CSSPrimitiveValue::equals(const CSSPrimitiveValue& other) const |
| case UnitType::Inches: |
| case UnitType::Points: |
| case UnitType::Picas: |
| + case UnitType::UserCoordinates: |
| case UnitType::Degrees: |
| case UnitType::Radians: |
| case UnitType::Gradians: |