2009-02-02 Darin Adler <darin@apple.com>
[WebKit-https.git] / WebCore / dom / ContainerNode.cpp
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())