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

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

Issue 1645043002: Don't give 'order' semantic errors special treatment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/SVGFEConvolveMatrixElement.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGFEConvolveMatrixElement.cpp b/third_party/WebKit/Source/core/svg/SVGFEConvolveMatrixElement.cpp
index f683bf252738671db19072a694ed6a88896dd02b..7a8e678b85b01bfc2e1d47ac4eaacbf25b23f678 100644
--- a/third_party/WebKit/Source/core/svg/SVGFEConvolveMatrixElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGFEConvolveMatrixElement.cpp
@@ -21,8 +21,6 @@
#include "core/SVGNames.h"
#include "core/dom/Document.h"
-#include "core/svg/SVGDocumentExtensions.h"
-#include "core/svg/SVGParserUtilities.h"
#include "core/svg/graphics/filters/SVGFilterBuilder.h"
#include "platform/geometry/FloatPoint.h"
#include "platform/geometry/IntPoint.h"
@@ -56,17 +54,25 @@ protected:
: SVGAnimatedIntegerOptionalInteger(contextElement, SVGNames::orderAttr, 0, 0)
{
}
+
+ static SVGParsingError checkValue(SVGParsingError parseStatus, int value)
+ {
+ if (parseStatus != SVGParseStatus::NoError)
+ return parseStatus;
+ if (value < 0)
+ return SVGParseStatus::NegativeValue;
+ if (value == 0)
+ return SVGParseStatus::ZeroValue;
+ return SVGParseStatus::NoError;
+ }
};
SVGParsingError SVGAnimatedOrder::setBaseValueAsString(const String& value)
{
SVGParsingError parseStatus = SVGAnimatedIntegerOptionalInteger::setBaseValueAsString(value);
-
- ASSERT(contextElement());
- if (parseStatus == SVGParseStatus::NoError && (firstInteger()->baseValue()->value() < 1 || secondInteger()->baseValue()->value() < 1)) {
- contextElement()->document().accessSVGExtensions().reportWarning(
- "feConvolveMatrix: problem parsing order=\"" + value + "\".");
- }
+ // Check for semantic errors.
+ parseStatus = checkValue(parseStatus, firstInteger()->baseValue()->value());
+ parseStatus = checkValue(parseStatus, secondInteger()->baseValue()->value());
return parseStatus;
}
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGDocumentExtensions.cpp ('k') | third_party/WebKit/Source/core/svg/SVGParsingError.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698