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

Unified Diff: Source/core/svg/SVGPatternElement.cpp

Issue 132233010: [SVG] SVGAnimatedRect migration to new SVG property impl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebsaed Created 6 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
« no previous file with comments | « Source/core/svg/SVGPatternElement.h ('k') | Source/core/svg/SVGRect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGPatternElement.cpp
diff --git a/Source/core/svg/SVGPatternElement.cpp b/Source/core/svg/SVGPatternElement.cpp
index dcbd782f14f1640f82469243bb983aef19a49a31..d54cf96a043896603070ad34d5e7789f64f42d45 100644
--- a/Source/core/svg/SVGPatternElement.cpp
+++ b/Source/core/svg/SVGPatternElement.cpp
@@ -36,7 +36,6 @@ DEFINE_ANIMATED_ENUMERATION(SVGPatternElement, SVGNames::patternUnitsAttr, Patte
DEFINE_ANIMATED_ENUMERATION(SVGPatternElement, SVGNames::patternContentUnitsAttr, PatternContentUnits, patternContentUnits, SVGUnitTypes::SVGUnitType)
DEFINE_ANIMATED_TRANSFORM_LIST(SVGPatternElement, SVGNames::patternTransformAttr, PatternTransform, patternTransform)
DEFINE_ANIMATED_STRING(SVGPatternElement, XLinkNames::hrefAttr, Href, href)
-DEFINE_ANIMATED_RECT(SVGPatternElement, SVGNames::viewBoxAttr, ViewBox, viewBox)
DEFINE_ANIMATED_PRESERVEASPECTRATIO(SVGPatternElement, SVGNames::preserveAspectRatioAttr, PreserveAspectRatio, preserveAspectRatio)
BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGPatternElement)
@@ -44,7 +43,6 @@ BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGPatternElement)
REGISTER_LOCAL_ANIMATED_PROPERTY(patternContentUnits)
REGISTER_LOCAL_ANIMATED_PROPERTY(patternTransform)
REGISTER_LOCAL_ANIMATED_PROPERTY(href)
- REGISTER_LOCAL_ANIMATED_PROPERTY(viewBox)
REGISTER_LOCAL_ANIMATED_PROPERTY(preserveAspectRatio)
REGISTER_PARENT_ANIMATED_PROPERTIES(SVGElement)
REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
@@ -56,6 +54,7 @@ inline SVGPatternElement::SVGPatternElement(Document& document)
, m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(LengthModeHeight)))
, m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::create(LengthModeWidth)))
, m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::create(LengthModeHeight)))
+ , m_viewBox(SVGAnimatedRect::create(this, SVGNames::viewBoxAttr))
, m_patternUnits(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX)
, m_patternContentUnits(SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE)
{
@@ -65,6 +64,7 @@ inline SVGPatternElement::SVGPatternElement(Document& document)
addToPropertyMap(m_y);
addToPropertyMap(m_width);
addToPropertyMap(m_height);
+ addToPropertyMap(m_viewBox);
registerAnimatedPropertiesForSVGPatternElement();
}
@@ -184,8 +184,8 @@ void SVGPatternElement::collectPatternAttributes(PatternAttributes& attributes)
if (!attributes.hasHeight() && current->hasAttribute(SVGNames::heightAttr))
attributes.setHeight(current->height()->currentValue());
- if (!attributes.hasViewBox() && current->hasAttribute(SVGNames::viewBoxAttr) && current->viewBoxCurrentValue().isValid())
- attributes.setViewBox(current->viewBoxCurrentValue());
+ if (!attributes.hasViewBox() && current->hasAttribute(SVGNames::viewBoxAttr) && current->viewBox()->currentValue()->isValid())
+ attributes.setViewBox(current->viewBox()->currentValue()->value());
if (!attributes.hasPreserveAspectRatio() && current->hasAttribute(SVGNames::preserveAspectRatioAttr))
attributes.setPreserveAspectRatio(current->preserveAspectRatioCurrentValue());
« no previous file with comments | « Source/core/svg/SVGPatternElement.h ('k') | Source/core/svg/SVGRect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698