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

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

Issue 298873003: SVG: SVGAnimateElement should not cache |m_animatedElements| (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove notification from detach Created 6 years, 7 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/SVGElementInstance.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGUseElement.cpp
diff --git a/Source/core/svg/SVGUseElement.cpp b/Source/core/svg/SVGUseElement.cpp
index 36e9abf7495a092f5cc0351e34de6fd3cf63b43b..8045c508da04794d8b4696abc85e9e68d998229a 100644
--- a/Source/core/svg/SVGUseElement.cpp
+++ b/Source/core/svg/SVGUseElement.cpp
@@ -364,6 +364,18 @@ void SVGUseElement::buildPendingResource()
ASSERT(!m_needsShadowTreeRecreation);
}
+namespace {
+
+void rebuildNonUseElementReferencesForTree(SVGElement* shadowTreeTargetElement)
+{
+ shadowTreeTargetElement->document().accessSVGExtensions().rebuildAllElementReferencesForTarget(shadowTreeTargetElement, SVGDocumentExtensions::ExcludeUseElements);
+
+ for (SVGElement* child = Traversal<SVGElement>::firstChild(*shadowTreeTargetElement); child; child = Traversal<SVGElement>::nextSibling(*child))
+ rebuildNonUseElementReferencesForTree(child);
+}
+
+} // namespace
+
void SVGUseElement::buildShadowAndInstanceTree(SVGElement* target)
{
ASSERT(!m_targetElementInstance);
@@ -451,6 +463,10 @@ void SVGUseElement::buildShadowAndInstanceTree(SVGElement* target)
// Update relative length information.
updateRelativeLengthsInformation();
+
+ // Element references need to be rebuilt to include the new shadow tree.
+ // <use> elements are excluded from notification to avoid infinite loop.
+ rebuildNonUseElementReferencesForTree(target);
kouhei (in TOK) 2014/05/26 04:35:45 here.
}
RenderObject* SVGUseElement::createRenderer(RenderStyle*)
« no previous file with comments | « Source/core/svg/SVGElementInstance.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698