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

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

Issue 1544673003: Refactor propagation of parsing errors for SVG attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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/SVGFitToViewBox.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGFitToViewBox.cpp b/third_party/WebKit/Source/core/svg/SVGFitToViewBox.cpp
index 0de541a33c87301a1faed584c03f3ed88916d20e..9346b9825e98700a5b243b97c5cbc44e26b226d5 100644
--- a/third_party/WebKit/Source/core/svg/SVGFitToViewBox.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGFitToViewBox.cpp
@@ -38,7 +38,7 @@ public:
return adoptRefWillBeNoop(new SVGAnimatedViewBoxRect(contextElement));
}
- void setBaseValueAsString(const String&, SVGParsingError&) override;
+ SVGParsingError setBaseValueAsString(const String&) override;
protected:
SVGAnimatedViewBoxRect(SVGElement* contextElement)
@@ -47,21 +47,15 @@ protected:
}
};
-void SVGAnimatedViewBoxRect::setBaseValueAsString(const String& value, SVGParsingError& parseError)
+SVGParsingError SVGAnimatedViewBoxRect::setBaseValueAsString(const String& value)
{
- TrackExceptionState es;
+ SVGParsingError parseStatus = baseValue()->setValueAsString(value);
- baseValue()->setValueAsString(value, es);
-
- if (es.hadException()) {
- parseError = ParsingAttributeFailedError;
- return;
- }
-
- if (baseValue()->width() < 0 || baseValue()->height() < 0) {
- parseError = NegativeValueForbiddenError;
+ if (parseStatus == NoError && (baseValue()->width() < 0 || baseValue()->height() < 0)) {
+ parseStatus = NegativeValueForbiddenError;
baseValue()->setInvalid();
}
+ return parseStatus;
}
SVGFitToViewBox::SVGFitToViewBox(SVGElement* element, PropertyMapPolicy propertyMapPolicy)

Powered by Google App Engine
This is Rietveld 408576698