Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Unified Diff: third_party/WebKit/Source/core/svg/SVGLength.cpp

Issue 1588993005: Extended error reporting for SVG attribute parsing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add PLATFORM_EXPORT Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 28419a44c8db0bfae0d052e4c24c39dbdbe60a0c..98bc6db45a68b731d6af5406d25d35547b74e59c 100644
--- a/third_party/WebKit/Source/core/svg/SVGLength.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGLength.cpp
@@ -63,8 +63,7 @@ PassRefPtrWillBeRawPtr<SVGPropertyBase> SVGLength::cloneForAnimation(const Strin
RefPtrWillBeRawPtr<SVGLength> length = create();
length->m_unitMode = m_unitMode;
- SVGParsingError status = length->setValueAsString(value);
- if (status != NoError)
+ if (length->setValueAsString(value) != SVGParseStatus::NoError)
length->m_value = cssValuePool().createValue(0, CSSPrimitiveValue::UnitType::UserUnits);
return length.release();
@@ -137,21 +136,21 @@ SVGParsingError SVGLength::setValueAsString(const String& string)
{
if (string.isEmpty()) {
m_value = cssValuePool().createValue(0, CSSPrimitiveValue::UnitType::UserUnits);
- return NoError;
+ return SVGParseStatus::NoError;
}
CSSParserContext svgParserContext(SVGAttributeMode, 0);
RefPtrWillBeRawPtr<CSSValue> parsed = CSSParser::parseSingleValue(CSSPropertyX, string, svgParserContext);
if (!parsed || !parsed->isPrimitiveValue())
- return ParsingAttributeFailedError;
+ return SVGParseStatus::ParsingFailed;
CSSPrimitiveValue* newValue = toCSSPrimitiveValue(parsed.get());
// TODO(fs): Enable calc for SVG lengths
if (newValue->isCalculated() || !isSupportedCSSUnitType(newValue->typeWithCalcResolved()))
- return ParsingAttributeFailedError;
+ return SVGParseStatus::ParsingFailed;
m_value = newValue;
- return NoError;
+ return SVGParseStatus::NoError;
}
String SVGLength::valueAsString() const
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGIntegerOptionalInteger.cpp ('k') | third_party/WebKit/Source/core/svg/SVGLengthList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698