Index: Source/core/svg/SVGRectElement.cpp |
diff --git a/Source/core/svg/SVGRectElement.cpp b/Source/core/svg/SVGRectElement.cpp |
index 6ae42852ef31f367f695c155417e277b00861076..a065f71d6d688881731b84d6b1bf834870a1f574 100644 |
--- a/Source/core/svg/SVGRectElement.cpp |
+++ b/Source/core/svg/SVGRectElement.cpp |
@@ -75,6 +75,25 @@ void SVGRectElement::parseAttribute(const QualifiedName& name, const AtomicStrin |
parseAttributeNew(name, value); |
} |
+bool SVGRectElement::isPresentationAttribute(const QualifiedName& attrName) const |
+{ |
+ if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr) |
+ return true; |
+ return SVGGeometryElement::isPresentationAttribute(attrName); |
+} |
+ |
+void SVGRectElement::collectStyleForPresentationAttribute(const QualifiedName& name, const AtomicString& value, MutableStylePropertySet* style) |
+{ |
+ RefPtrWillBeRawPtr<SVGAnimatedPropertyBase> property = propertyFromAttribute(name); |
+ if (property == m_x) { |
+ addPropertyToPresentationAttributeStyle(style, CSSPropertyX, m_x->currentValue()->valueInSpecifiedUnits(), m_x->currentValue()->cssUnitTypeQuirk()); |
+ } else if (property == m_y) { |
+ addPropertyToPresentationAttributeStyle(style, CSSPropertyY, m_y->currentValue()->valueInSpecifiedUnits(), m_y->currentValue()->cssUnitTypeQuirk()); |
+ } else if (!property) { |
fs
2015/02/04 13:24:53
Why the condition here?
(Also, could drop the {}'
Erik Dahlström (inactive)
2015/02/05 16:09:02
Just a remnant from early testing, shouldn't be ne
|
+ SVGGeometryElement::collectStyleForPresentationAttribute(name, value, style); |
+ } |
+} |
+ |
void SVGRectElement::svgAttributeChanged(const QualifiedName& attrName) |
{ |
if (!isSupportedAttribute(attrName)) { |
@@ -84,8 +103,16 @@ void SVGRectElement::svgAttributeChanged(const QualifiedName& attrName) |
SVGElement::InvalidationGuard invalidationGuard(this); |
- bool isLengthAttribute = attrName == SVGNames::xAttr |
- || attrName == SVGNames::yAttr |
+ bool isLengthAttributeXY = |
+ attrName == SVGNames::xAttr |
+ || attrName == SVGNames::yAttr; |
+ if (isLengthAttributeXY) { |
+ invalidateSVGPresentationAttributeStyle(); |
+ setNeedsStyleRecalc(LocalStyleChange, |
+ StyleChangeReasonForTracing::fromAttribute(attrName)); |
+ } |
+ |
+ bool isLengthAttribute = isLengthAttributeXY |
|| attrName == SVGNames::widthAttr |
|| attrName == SVGNames::heightAttr |
|| attrName == SVGNames::rxAttr |