Index: third_party/WebKit/Source/core/svg/SVGPathElement.cpp |
diff --git a/third_party/WebKit/Source/core/svg/SVGPathElement.cpp b/third_party/WebKit/Source/core/svg/SVGPathElement.cpp |
index fb1f808cb01ee5362a7ac594d89bdee6e909736d..c0a5e54abb40b744d9e5d45ad2bbe5a52211d9e1 100644 |
--- a/third_party/WebKit/Source/core/svg/SVGPathElement.cpp |
+++ b/third_party/WebKit/Source/core/svg/SVGPathElement.cpp |
@@ -152,10 +152,15 @@ void SVGPathElement::svgAttributeChanged(const QualifiedName& attrName) |
void SVGPathElement::collectStyleForPresentationAttribute(const QualifiedName& name, const AtomicString& value, MutableStylePropertySet* style) |
{ |
SVGAnimatedPropertyBase* property = propertyFromAttribute(name); |
- if (property == m_path) |
- addPropertyToPresentationAttributeStyle(style, CSSPropertyD, m_path->currentValue()->pathValue()); |
- else |
- SVGGeometryElement::collectStyleForPresentationAttribute(name, value, style); |
+ if (property == m_path) { |
+ SVGAnimatedPath* path = this->path(); |
+ // If this is a <use> instance, return the referenced path to maximize geometry sharing. |
+ if (const SVGElement* element = correspondingElement()) |
+ path = toSVGPathElement(element)->path(); |
+ addPropertyToPresentationAttributeStyle(style, CSSPropertyD, path->currentValue()->pathValue()); |
+ return; |
+ } |
+ SVGGeometryElement::collectStyleForPresentationAttribute(name, value, style); |
} |
void SVGPathElement::invalidateMPathDependencies() |