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

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

Issue 1578363007: Re-instate geometry sharing optimization for 'd' on <use>'d <path>s (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « third_party/WebKit/Source/core/svg/SVGPathElement.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGPathElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698