From e0b75e1a7df757577b78bcf57cd5f0412dc9bdce Mon Sep 17 00:00:00 2001 From: "pdr@google.com" Date: Fri, 29 Jun 2012 02:36:06 +0000 Subject: [PATCH] Add preventative assert in SVGTRefElement https://bugs.webkit.org/show_bug.cgi?id=90203 Reviewed by Abhishek Arya. SVGTRefElement::detachTarget() adds a pending resource via addPendingResource. Due to some recent bugs in this area, an assert is being added to prevent users from calling detachTarget when not in a document. Doing so would create a bug such as in WK90042. This assert will not fire currently because detachTarget is only called after a DOMNodeRemovedFromDocumentEvent event fires, which only comes from dispatchChildRemovalEvents when the node is in a document. * svg/SVGTRefElement.cpp: (WebCore::SVGTRefElement::detachTarget): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121508 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Source/WebCore/ChangeLog | 19 +++++++++++++++++++ Source/WebCore/svg/SVGTRefElement.cpp | 2 ++ 2 files changed, 21 insertions(+) diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 7dd7f52..52a0b72 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,22 @@ +2012-06-28 Philip Rogers + + Add preventative assert in SVGTRefElement + https://bugs.webkit.org/show_bug.cgi?id=90203 + + Reviewed by Abhishek Arya. + + SVGTRefElement::detachTarget() adds a pending resource via addPendingResource. + Due to some recent bugs in this area, an assert is being added to prevent + users from calling detachTarget when not in a document. Doing + so would create a bug such as in WK90042. + + This assert will not fire currently because detachTarget is only called after + a DOMNodeRemovedFromDocumentEvent event fires, which only comes from + dispatchChildRemovalEvents when the node is in a document. + + * svg/SVGTRefElement.cpp: + (WebCore::SVGTRefElement::detachTarget): + 2012-06-28 Bruno de Oliveira Abinader [Qt] Remove unnecessary AffineTransform calls diff --git a/Source/WebCore/svg/SVGTRefElement.cpp b/Source/WebCore/svg/SVGTRefElement.cpp index 97bc43d..61de7c8 100644 --- a/Source/WebCore/svg/SVGTRefElement.cpp +++ b/Source/WebCore/svg/SVGTRefElement.cpp @@ -185,6 +185,8 @@ void SVGTRefElement::detachTarget() if (container) container->setTextContent(emptyContent, ignore); + ASSERT(inDocument()); + // Mark the referenced ID as pending. String id; SVGURIReference::targetElementFromIRIString(href(), document(), &id); -- 2.7.4