Reviewed by John
authorkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Jan 2005 22:02:17 +0000 (22:02 +0000)
committerkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Jan 2005 22:02:17 +0000 (22:02 +0000)
        Fix for this bug:

        <rdar://problem/3964646> REGRESSION (179-180): Typing space at end of line makes following paragraph disappear

        * khtml/editing/htmlediting.cpp:
        (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Recent change to block placeholder removal code
        caused this regression. The code became too aggressive in removing block placeholders, and would remove them
        from blocks other than the block containing the selection.
        * layout-tests/editing/inserting/insert-div-023-expected.txt: This file had a spur
        * layout-tests/editing/inserting/insert-div-024-expected.txt:

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

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

index 1551c638acdbf9f6c943a837e0be0303730d00fd..d0038abcee60a57edde6fe85fc84bec65cb04b97 100644 (file)
@@ -1,3 +1,18 @@
+2005-01-20  Ken Kocienda  <kocienda@apple.com>
+
+        Reviewed by John
+
+        Fix for this bug:
+        
+        <rdar://problem/3964646> REGRESSION (179-180): Typing space at end of line makes following paragraph disappear
+
+        * khtml/editing/htmlediting.cpp:
+        (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Recent change to block placeholder removal code 
+        caused this regression. The code became too aggressive in removing block placeholders, and would remove them
+        from blocks other than the block containing the selection.
+        * layout-tests/editing/inserting/insert-div-023-expected.txt: This file had a spur
+        * layout-tests/editing/inserting/insert-div-024-expected.txt:
+
 2005-01-20  David Hyatt  <hyatt@apple.com>
 
        Fix for oddness on albertsons.com.  Make sure not to crash when setting/removing style properties on a node
index d168ec20d36b6a06df6483209206eb6ba0c5595f..a6d5906d7c3916f87daceb5d37c177572e9f28fa 100644 (file)
@@ -1000,7 +1000,8 @@ bool CompositeEditCommand::removeBlockPlaceholderIfNeeded(NodeImpl *node)
     for (NodeImpl *checkMe = node; checkMe; checkMe = checkMe->traverseNextNode(node)) {
         if (checkMe->isElementNode()) {
             ElementImpl *element = static_cast<ElementImpl *>(checkMe);
-            if (element->getAttribute(ATTR_CLASS) == blockPlaceholderClassString()) {
+            if (element->enclosingBlockFlowElement() == node && 
+                element->getAttribute(ATTR_CLASS) == blockPlaceholderClassString()) {
                 removeNode(element);
                 return true;
             }