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

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: 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/SVGElement.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGElement.cpp b/third_party/WebKit/Source/core/svg/SVGElement.cpp
index c7f4aec535e431fb8df84b0da38f06d7ed66e0a8..c3bfb18a157157dc6715c9849f211686fd5bc07e 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 == SVGParseStatus::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
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGBoolean.cpp ('k') | third_party/WebKit/Source/core/svg/SVGEnumeration.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698