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

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

Issue 2037573002: Empty SVG viewbox should be treated invalid (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/custom/empty-viewbox-attr-expected.svg ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5bef19eccb81e09dd67be87104abf3417fd24626..cf7628a84843a237f1b5a769c0b939b40d030775 100644
--- a/third_party/WebKit/Source/core/svg/SVGFitToViewBox.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGFitToViewBox.cpp
@@ -49,6 +49,12 @@ protected:
SVGParsingError SVGAnimatedViewBoxRect::setBaseValueAsString(const String& value)
{
+ // Empty string should be treated as invalid viewBox
+ if (value.isEmpty()) {
fs 2016/06/03 08:58:03 Should probably fix this down in SVGRect instead.
Shanmuga Pandi 2016/06/03 10:20:53 Done.
+ baseValue()->setInvalid();
+ return SVGParseStatus::NoError;
+ }
+
SVGParsingError parseStatus = SVGAnimatedRect::setBaseValueAsString(value);
if (parseStatus == SVGParseStatus::NoError && (baseValue()->width() < 0 || baseValue()->height() < 0)) {
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/custom/empty-viewbox-attr-expected.svg ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698