Chromium Code Reviews| Index: third_party/WebKit/Source/core/svg/SVGLength.cpp |
| diff --git a/third_party/WebKit/Source/core/svg/SVGLength.cpp b/third_party/WebKit/Source/core/svg/SVGLength.cpp |
| index 8d66d974af40ea2aa6faf4d7a18ca2a7ebf75b5a..9dbc683313247806283dd90fbf5cd47ec7f1259f 100644 |
| --- a/third_party/WebKit/Source/core/svg/SVGLength.cpp |
| +++ b/third_party/WebKit/Source/core/svg/SVGLength.cpp |
| @@ -86,7 +86,7 @@ void SVGLength::setValue(float value, const SVGLengthContext& context) |
| bool isSupportedCSSUnitType(CSSPrimitiveValue::UnitType type) |
| { |
| - return (CSSPrimitiveValue::isLength(type) || type == CSSPrimitiveValue::UnitType::Number || type == CSSPrimitiveValue::UnitType::Percentage) |
| + return (CSSPrimitiveValue::isLength(type) || type == CSSPrimitiveValue::UnitType::Number || type == CSSPrimitiveValue::UnitType::Percentage || (type >= CSSPrimitiveValue::UnitType::Calc && type <= CSSPrimitiveValue::UnitType::CalcPercentageWithLengthAndNumber)) |
|
fs
2016/06/29 09:28:17
Suggest you reformat this function, to maybe make
Shanmuga Pandi
2016/07/15 12:18:22
Done.
|
| && type != CSSPrimitiveValue::UnitType::QuirkyEms; |
| } |
| @@ -139,8 +139,7 @@ SVGParsingError SVGLength::setValueAsString(const String& string) |
| return SVGParseStatus::ExpectedLength; |
| CSSPrimitiveValue* newValue = toCSSPrimitiveValue(parsed); |
| - // TODO(fs): Enable calc for SVG lengths |
| - if (newValue->isCalculated() || !isSupportedCSSUnitType(newValue->typeWithCalcResolved())) |
| + if (!isSupportedCSSUnitType(newValue->typeWithCalcResolved())) |
| return SVGParseStatus::ExpectedLength; |
| m_value = newValue; |