2009-02-02 Darin Adler <darin@apple.com>
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Feb 2009 00:07:22 +0000 (00:07 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Feb 2009 00:07:22 +0000 (00:07 +0000)
        Reviewed by Anders Carlsson.

        Bug 23694: REGRESSION: Running svg/custom tests crashes, randomly, depending on the order of tests
        https://bugs.webkit.org/show_bug.cgi?id=23694

        * dom/ContainerNode.cpp:
        (WebCore::ContainerNode::insertedIntoDocument): Added back the call through to EventTargetNode.
        (WebCore::ContainerNode::removedFromDocument): Ditto.
        * dom/EventTargetNode.cpp:
        (WebCore::EventTargetNode::insertedIntoDocument): Changed this to not call through to Node.
        (WebCore::EventTargetNode::removedFromDocument): Ditto.
        * dom/Node.cpp:
        (WebCore::Node::insertedIntoDocument): Updated comment.
        (WebCore::Node::removedFromDocument): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@40499 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/dom/ContainerNode.cpp
WebCore/dom/EventTargetNode.cpp
WebCore/dom/Node.cpp

index b68dba0..4ef6eb4 100644 (file)
@@ -1,3 +1,20 @@
+2009-02-02  Darin Adler  <darin@apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        Bug 23694: REGRESSION: Running svg/custom tests crashes, randomly, depending on the order of tests
+        https://bugs.webkit.org/show_bug.cgi?id=23694
+
+        * dom/ContainerNode.cpp:
+        (WebCore::ContainerNode::insertedIntoDocument): Added back the call through to EventTargetNode.
+        (WebCore::ContainerNode::removedFromDocument): Ditto.
+        * dom/EventTargetNode.cpp:
+        (WebCore::EventTargetNode::insertedIntoDocument): Changed this to not call through to Node.
+        (WebCore::EventTargetNode::removedFromDocument): Ditto.
+        * dom/Node.cpp:
+        (WebCore::Node::insertedIntoDocument): Updated comment.
+        (WebCore::Node::removedFromDocument): Ditto.
+
 2009-02-02  Anders Carlsson  <andersca@apple.com>
 
         Reviewed by Dan Bernstein.
index 7afc18d..3c5935a 100644 (file)
@@ -587,7 +587,7 @@ void ContainerNode::detach()
 
 void ContainerNode::insertedIntoDocument()
 {
-    setInDocument(true);
+    EventTargetNode::insertedIntoDocument();
     insertedIntoTree(false);
     for (Node* child = m_firstChild; child; child = child->nextSibling())
         child->insertedIntoDocument();
@@ -595,8 +595,7 @@ void ContainerNode::insertedIntoDocument()
 
 void ContainerNode::removedFromDocument()
 {
-    if (document()->cssTarget() == this)
-        document()->setCSSTarget(0);
+    EventTargetNode::removedFromDocument();
     setInDocument(false);
     removedFromTree(false);
     for (Node* child = m_firstChild; child; child = child->nextSibling())
index ff0994e..c129ee2 100644 (file)
@@ -87,7 +87,7 @@ void EventTargetNode::insertedIntoDocument()
     if (!eventListeners().isEmpty())
         document()->unregisterDisconnectedNodeWithEventListeners(this);
 
-    Node::insertedIntoDocument();
+    setInDocument(true);
 }
 
 void EventTargetNode::removedFromDocument()
@@ -95,7 +95,7 @@ void EventTargetNode::removedFromDocument()
     if (!eventListeners().isEmpty())
         document()->registerDisconnectedNodeWithEventListeners(this);
 
-    Node::removedFromDocument();
+    setInDocument(false);
 }
 
 void EventTargetNode::willMoveToNewOwnerDocument()
index 28a043a..dd435c9 100644 (file)
@@ -1078,14 +1078,14 @@ void Node::detach()
 
 void Node::insertedIntoDocument()
 {
-    // Note: ContainerNode::insertedIntoDocument does not call through here, so if you
+    // Note: EventTargetNode::insertedIntoDocument does not call through here, so if you
     // change this function, change that one as well.
     setInDocument(true);
 }
 
 void Node::removedFromDocument()
 {
-    // Note: ContainerNode::insertedIntoDocument does not call through here, so if you
+    // Note: EventTargetNode::insertedIntoDocument does not call through here, so if you
     // change this function, change that one as well.
     setInDocument(false);
 }