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

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

Issue 1901673003: Improve default value handling for SVGSVGElement.width/height (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tweak old test. 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
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 02cf93023e5964c7648ed33075fa3e7c88e1c4aa..422cf6379a4d95ba676e793322d360dbe3b0c950 100644
--- a/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp
@@ -64,15 +64,15 @@ inline SVGSVGElement::SVGSVGElement(Document& doc)
, SVGFitToViewBox(this)
, m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(SVGLengthMode::Width)))
, m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(SVGLengthMode::Height)))
- , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::create(SVGLengthMode::Width)))
- , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::create(SVGLengthMode::Height)))
+ , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::create(SVGLengthMode::Width), "100%"))
+ , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::create(SVGLengthMode::Height), "100%"))
, m_useCurrentView(false)
, m_timeContainer(SMILTimeContainer::create(*this))
, m_translation(SVGPoint::create())
, m_currentScale(1)
{
- m_width->setDefaultValueAsString("100%");
- m_height->setDefaultValueAsString("100%");
+ m_width->setDefaultValue();
+ m_height->setDefaultValue();
addToPropertyMap(m_x);
addToPropertyMap(m_y);

Powered by Google App Engine
This is Rietveld 408576698