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

Unified Diff: WebCore/svg/SVGUseElement.cpp

Issue 6186003: Merge 75014 - Merge 74636 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/597/
Patch Set: Created 9 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 | « WebCore/svg/SVGUseElement.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/svg/SVGUseElement.cpp
===================================================================
--- WebCore/svg/SVGUseElement.cpp (revision 75429)
+++ WebCore/svg/SVGUseElement.cpp (working copy)
@@ -130,7 +130,7 @@
void SVGUseElement::removedFromDocument()
{
SVGStyledTransformableElement::removedFromDocument();
- m_targetElementInstance = 0;
+ detachInstance();
}
void SVGUseElement::svgAttributeChanged(const QualifiedName& attrName)
@@ -496,8 +496,7 @@
if (targetElement && targetElement->isSVGElement())
target = static_cast<SVGElement*>(targetElement);
- if (m_targetElementInstance)
- m_targetElementInstance = 0;
+ detachInstance();
// Do not allow self-referencing.
// 'target' may be null, if it's a non SVG namespaced element.
@@ -523,7 +522,7 @@
// SVG specification does not say a word about <use> & cycles. My view on this is: just ignore it!
// Non-appearing <use> content is easier to debug, then half-appearing content.
if (foundProblem) {
- m_targetElementInstance = 0;
+ detachInstance();
return;
}
@@ -556,7 +555,7 @@
// Do NOT leave an inconsistent instance tree around, instead destruct it.
if (!m_targetElementInstance->shadowTreeElement()) {
shadowRoot->removeAllChildren();
- m_targetElementInstance = 0;
+ detachInstance();
return;
}
@@ -595,6 +594,14 @@
updateRelativeLengthsInformation();
}
+void SVGUseElement::detachInstance()
+{
+ if (!m_targetElementInstance)
+ return;
+ m_targetElementInstance->clearUseElement();
+ m_targetElementInstance = 0;
+}
+
RenderObject* SVGUseElement::createRenderer(RenderArena* arena, RenderStyle*)
{
return new (arena) RenderSVGShadowTreeRootContainer(this);
@@ -617,7 +624,7 @@
void SVGUseElement::detach()
{
SVGStyledTransformableElement::detach();
- m_targetElementInstance = 0;
+ detachInstance();
}
static bool isDirectReference(Node* n)
« no previous file with comments | « WebCore/svg/SVGUseElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698