Chromium Code Reviews

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

Issue 1588993005: Extended error reporting for SVG attribute parsing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: TestExpectations Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: third_party/WebKit/Source/core/svg/SVGElement.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGElement.cpp b/third_party/WebKit/Source/core/svg/SVGElement.cpp
index c7f4aec535e431fb8df84b0da38f06d7ed66e0a8..ddc796f4b71fb214b16c8d6f090b583b08aa39f0 100644
--- a/third_party/WebKit/Source/core/svg/SVGElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGElement.cpp
@@ -53,7 +53,6 @@
#include "core/svg/SVGTitleElement.h"
#include "core/svg/SVGUseElement.h"
#include "core/svg/properties/SVGProperty.h"
-#include "platform/JSONValues.h"
#include "wtf/TemporaryChange.h"
#include "wtf/Threading.h"
@@ -189,23 +188,9 @@ bool SVGElement::isOutermostSVGSVGElement() const
void SVGElement::reportAttributeParsingError(SVGParsingError error, const QualifiedName& name, const AtomicString& value)
{
- if (error == NoError)
+ if (error == SVGStatus::NoError)
return;
-
- String errorString = "<" + tagName() + "> attribute " + name.toString() + "=" + JSONValue::quoteString(value);
- SVGDocumentExtensions& extensions = document().accessSVGExtensions();
-
- if (error == NegativeValueForbiddenError) {
- extensions.reportError("Invalid negative value for " + errorString);
- return;
- }
-
- if (error == ParsingAttributeFailedError) {
- extensions.reportError("Invalid value for " + errorString);
- return;
- }
-
- ASSERT_NOT_REACHED();
+ document().accessSVGExtensions().reportError(error.format(tagName(), name, value));
}
String SVGElement::title() const

Powered by Google App Engine