Index: Source/core/svg/SVGRectElement.cpp |
diff --git a/Source/core/svg/SVGRectElement.cpp b/Source/core/svg/SVGRectElement.cpp |
index 6954804ef0cd18f632e7d22542172e02abc3b11a..77cb7a35846d871cfd1396c569288e6d9739baee 100644 |
--- a/Source/core/svg/SVGRectElement.cpp |
+++ b/Source/core/svg/SVGRectElement.cpp |
@@ -75,6 +75,31 @@ 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); |
+} |
+ |
+bool SVGRectElement::isPresentationAttributeWithSVGDOM(const QualifiedName& attrName) const |
+{ |
+ if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr) |
+ return true; |
+ return SVGGeometryElement::isPresentationAttributeWithSVGDOM(attrName); |
+} |
+ |
+void SVGRectElement::collectStyleForPresentationAttribute(const QualifiedName& name, const AtomicString& value, MutableStylePropertySet* style) |
+{ |
+ RefPtrWillBeRawPtr<SVGAnimatedPropertyBase> property = propertyFromAttribute(name); |
+ if (property == m_x) |
+ addSVGLengthPropertyToPresentationAttributeStyle(style, CSSPropertyX, *m_x->currentValue()); |
+ else if (property == m_y) |
+ addSVGLengthPropertyToPresentationAttributeStyle(style, CSSPropertyY, *m_y->currentValue()); |
+ else |
+ SVGGeometryElement::collectStyleForPresentationAttribute(name, value, style); |
+} |
+ |
void SVGRectElement::svgAttributeChanged(const QualifiedName& attrName) |
{ |
if (!isSupportedAttribute(attrName)) { |
@@ -84,8 +109,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 |