| 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 ebff1f65177f326445c48f10344a3d3bf6ab2c7d..54756245713394f0e8dcdbf7fe4d3b0fc15572da 100644
|
| --- a/third_party/WebKit/Source/core/svg/SVGLengthTearOff.cpp
|
| +++ b/third_party/WebKit/Source/core/svg/SVGLengthTearOff.cpp
|
| @@ -104,6 +104,9 @@ inline SVGLengthType toSVGLengthType(CSSPrimitiveValue::UnitType type)
|
|
|
| bool SVGLengthTearOff::hasExposedLengthUnit()
|
| {
|
| + if (target()->isCalculated())
|
| + return false;
|
| +
|
| CSSPrimitiveValue::UnitType unit = target()->typeWithCalcResolved();
|
| return isValidLengthUnit(unit)
|
| || unit == CSSPrimitiveValue::UnitType::Unknown
|
| @@ -144,12 +147,19 @@ void SVGLengthTearOff::setValue(float value, ExceptionState& exceptionState)
|
| }
|
|
|
| SVGLengthContext lengthContext(contextElement());
|
| - target()->setValue(value, lengthContext);
|
| + if (target()->isCalculated())
|
| + target()->setValueAsNumber(value);
|
| + else
|
| + target()->setValue(value, lengthContext);
|
| +
|
| commitChange();
|
| }
|
|
|
| float SVGLengthTearOff::valueInSpecifiedUnits()
|
| {
|
| + if (target()->isCalculated())
|
| + return 0;
|
| +
|
| return target()->valueInSpecifiedUnits();
|
| }
|
|
|
| @@ -159,7 +169,12 @@ void SVGLengthTearOff::setValueInSpecifiedUnits(float value, ExceptionState& exc
|
| exceptionState.throwDOMException(NoModificationAllowedError, "The attribute is read-only.");
|
| return;
|
| }
|
| - target()->setValueInSpecifiedUnits(value);
|
| +
|
| + if (target()->isCalculated())
|
| + target()->setValueAsNumber(value);
|
| + else
|
| + target()->setValueInSpecifiedUnits(value);
|
| +
|
| commitChange();
|
| }
|
|
|
|
|