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

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

Issue 1918753002: Improve default value handling for SVGSVGElement.width/height (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 8 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/disallow-non-lengths-in-attrs-expected.txt ('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/SVGSVGElement.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp b/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp
index baec2162f99126295778b149f6823b99d83b9495..736cf1c7c9ea825b78507da511035b7fe3323e93 100644
--- a/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp
@@ -205,6 +205,14 @@ void SVGSVGElement::parseAttribute(const QualifiedName& name, const AtomicString
} else if (name == HTMLNames::onerrorAttr) {
document().setWindowAttributeEventListener(EventTypeNames::error, createAttributeEventListener(document().frame(), name, value, eventParameterName()));
} else if (SVGZoomAndPan::parseAttribute(name, value)) {
+ } else if (name == SVGNames::widthAttr || name == SVGNames::heightAttr) {
+ SVGAnimatedLength* property = name == SVGNames::widthAttr ? m_width : m_height;
+ SVGParsingError parseError;
+ if (!value.isNull())
+ parseError = property->setBaseValueAsString(value);
+ if (parseError != SVGParseStatus::NoError || value.isNull())
+ property->setDefaultValueAsString("100%");
+ reportAttributeParsingError(parseError, name, value);
} else {
SVGElement::parseAttribute(name, oldValue, value);
}
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/custom/disallow-non-lengths-in-attrs-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698