| Index: third_party/WebKit/Source/core/css/cssom/CSSLengthValue.cpp
|
| diff --git a/third_party/WebKit/Source/core/css/cssom/CSSLengthValue.cpp b/third_party/WebKit/Source/core/css/cssom/CSSLengthValue.cpp
|
| index 7f08b13aa7464a32d6e698418b3b209bd1cb2aee..cbd38040557d09043d693327e72a6975c761a324 100644
|
| --- a/third_party/WebKit/Source/core/css/cssom/CSSLengthValue.cpp
|
| +++ b/third_party/WebKit/Source/core/css/cssom/CSSLengthValue.cpp
|
| @@ -13,6 +13,21 @@
|
|
|
| namespace blink {
|
|
|
| +CSSLengthValue* CSSLengthValue::fromCSSValue(const CSSValue& value)
|
| +{
|
| + if (!value.isPrimitiveValue())
|
| + return nullptr;
|
| +
|
| + const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value);
|
| + if (!primitiveValue.isLength())
|
| + return nullptr;
|
| +
|
| + if (!primitiveValue.isCalculated())
|
| + return CSSSimpleLength::create(primitiveValue.getDoubleValue(), primitiveValue.typeWithCalcResolved());
|
| +
|
| + return CSSCalcLength::fromCSSValue(value);
|
| +}
|
| +
|
| CSSPrimitiveValue::UnitType CSSLengthValue::unitFromName(const String& name)
|
| {
|
| if (equalIgnoringASCIICase(name, "percent") || name == "%") {
|
| @@ -57,14 +72,14 @@ CSSLengthValue* CSSLengthValue::subtract(const CSSLengthValue* other, ExceptionS
|
| return result->subtract(other, exceptionState);
|
| }
|
|
|
| -CSSLengthValue* CSSLengthValue::multiply(double x, ExceptionState& exceptionState)
|
| +CSSLengthValue* CSSLengthValue::multiply(double x, ExceptionState&)
|
| {
|
| - return multiplyInternal(x, exceptionState);
|
| + return multiplyInternal(x);
|
| }
|
|
|
| -CSSLengthValue* CSSLengthValue::divide(double x, ExceptionState& exceptionState)
|
| +CSSLengthValue* CSSLengthValue::divide(double x, ExceptionState&)
|
| {
|
| - return divideInternal(x, exceptionState);
|
| + return divideInternal(x);
|
| }
|
|
|
| CSSLengthValue* CSSLengthValue::addInternal(const CSSLengthValue*, ExceptionState&)
|
| @@ -79,13 +94,13 @@ CSSLengthValue* CSSLengthValue::subtractInternal(const CSSLengthValue*, Exceptio
|
| return nullptr;
|
| }
|
|
|
| -CSSLengthValue* CSSLengthValue::multiplyInternal(double, ExceptionState&)
|
| +CSSLengthValue* CSSLengthValue::multiplyInternal(double)
|
| {
|
| NOTREACHED();
|
| return nullptr;
|
| }
|
|
|
| -CSSLengthValue* CSSLengthValue::divideInternal(double, ExceptionState&)
|
| +CSSLengthValue* CSSLengthValue::divideInternal(double)
|
| {
|
| NOTREACHED();
|
| return nullptr;
|
|
|