Reviewed by Hyatt
authorkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Feb 2005 00:35:54 +0000 (00:35 +0000)
committerkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Feb 2005 00:35:54 +0000 (00:35 +0000)
        Fix for this bug:

        <rdar://problem/3992092> 8A374: Mail crash while pasting - RemoveNodeCommand

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplaceSelectionCommand::doApply): Code tried to remove a node that was no longer in
        the document. We try to do a good job of detecting all these cases, and generally do. This
        one was missed. Fixed.

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

WebCore/ChangeLog-2005-08-23
WebCore/khtml/editing/htmlediting.cpp

index 5c50301f329cac52590f2cf4f8a323092168c5a1..506a201332d9d296428e01be05af22a6174b2334 100644 (file)
@@ -1,3 +1,16 @@
+2005-02-10  Ken Kocienda  <kocienda@apple.com>
+
+        Reviewed by Hyatt
+
+        Fix for this bug:
+        
+        <rdar://problem/3992092> 8A374: Mail crash while pasting - RemoveNodeCommand
+
+        * khtml/editing/htmlediting.cpp:
+        (khtml::ReplaceSelectionCommand::doApply): Code tried to remove a node that was no longer in 
+        the document. We try to do a good job of detecting all these cases, and generally do. This
+        one was missed. Fixed.
+
 2005-02-10  Darin Adler  <darin@apple.com>
 
         Reviewed by Harrison.
 2005-02-10  Darin Adler  <darin@apple.com>
 
         Reviewed by Harrison.
index 4672abeb19ff252f22185f1821e47fd3662c5227..570bf1f99bee1bc6a86a417a94a546b07104a5f1 100644 (file)
@@ -4481,7 +4481,7 @@ void ReplaceSelectionCommand::doApply()
     // step 5 : mop up
     if (placeholderBlock) {
         document()->updateLayout();
     // step 5 : mop up
     if (placeholderBlock) {
         document()->updateLayout();
-        if (!placeholderBlock->renderer() || placeholderBlock->renderer()->height() == 0)
+        if (placeholderBlock->inDocument() && (!placeholderBlock->renderer() || placeholderBlock->renderer()->height() == 0))
             removeNode(placeholderBlock);
     }
 }
             removeNode(placeholderBlock);
     }
 }