Title: [121508] trunk/Source/WebCore
Revision
121508
Author
[email protected]
Date
2012-06-28 19:36:06 -0700 (Thu, 28 Jun 2012)

Log Message

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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (121507 => 121508)


--- trunk/Source/WebCore/ChangeLog	2012-06-29 02:13:39 UTC (rev 121507)
+++ trunk/Source/WebCore/ChangeLog	2012-06-29 02:36:06 UTC (rev 121508)
@@ -1,3 +1,22 @@
+2012-06-28  Philip Rogers  <[email protected]>
+
+        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  <[email protected]>
 
         [Qt] Remove unnecessary AffineTransform calls

Modified: trunk/Source/WebCore/svg/SVGTRefElement.cpp (121507 => 121508)


--- trunk/Source/WebCore/svg/SVGTRefElement.cpp	2012-06-29 02:13:39 UTC (rev 121507)
+++ trunk/Source/WebCore/svg/SVGTRefElement.cpp	2012-06-29 02:36:06 UTC (rev 121508)
@@ -185,6 +185,8 @@
     if (container)
         container->setTextContent(emptyContent, ignore);
 
+    ASSERT(inDocument());
+
     // Mark the referenced ID as pending.
     String id;
     SVGURIReference::targetElementFromIRIString(href(), document(), &id);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to