Revise the patch for incorrect caret positions when brs get deleted. It can be...
authorhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 May 2004 00:07:01 +0000 (00:07 +0000)
committerhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 May 2004 00:07:01 +0000 (00:07 +0000)
        Reviewed by kocienda

        * khtml/rendering/render_flow.cpp:
        (RenderFlow::dirtyLinesFromChangedChild):
        * khtml/rendering/render_text.cpp:
        (RenderText::detach):

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

WebCore/ChangeLog-2005-08-23
WebCore/khtml/rendering/render_flow.cpp
WebCore/khtml/rendering/render_text.cpp

index e87771f1535dd04c1c6317493106d909d8585625..a351422570561849ad7d9fa7f51f0296bdeb1191 100644 (file)
@@ -1,3 +1,14 @@
+2004-05-20  David Hyatt  <hyatt@apple.com>
+
+       Revise the patch for incorrect caret positions when brs get deleted.  It can be even simpler.
+       
+        Reviewed by kocienda
+
+        * khtml/rendering/render_flow.cpp:
+        (RenderFlow::dirtyLinesFromChangedChild):
+        * khtml/rendering/render_text.cpp:
+        (RenderText::detach):
+
 2004-05-20  David Hyatt  <hyatt@apple.com>
 
        Fix for 3629816, caret in wrong position when deleting <br>s on lines by themselves or when moving <br>s
index c04e687723a34e46214fcebc7d162111b8916010..317466e83b42af678c4632c966e88fbb00809aec 100644 (file)
@@ -211,7 +211,7 @@ void RenderFlow::dirtyLinesFromChangedChild(RenderObject* child)
     // line box by examining our siblings.  If we didn't find a line box, then use our 
     // parent's first line box.
     RootInlineBox* box = 0;
-    for (RenderObject* curr = child; curr; curr = curr->previousSibling()) {
+    for (RenderObject* curr = child->previousSibling(); curr; curr = curr->previousSibling()) {
         if (curr->isFloatingOrPositioned())
             continue;
         
index 65919774442ea1d299f4b6d0ad24443096eed48b..f57c35e450b0795aef70352de2911f8a9b6b40fa 100644 (file)
@@ -327,11 +327,11 @@ RenderText::~RenderText()
 void RenderText::detach()
 {
     if (!documentBeingDestroyed()) {
-        if (parent() && isBR())
-            parent()->dirtyLinesFromChangedChild(this);
         if (firstTextBox())
             for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox())
                 box->remove();
+        else if (parent() && isBR())
+            parent()->dirtyLinesFromChangedChild(this);
     }
     deleteTextBoxes();
     RenderObject::detach();