Fix for 3629816, caret in wrong position when deleting <br>s on lines by themselves...
authorhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 May 2004 00:00:49 +0000 (00:00 +0000)
committerhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 May 2004 00:00:49 +0000 (00:00 +0000)
on lines by themselves.

        Reviewed by kocienda

        * khtml/rendering/render_box.cpp:
        (RenderBox::detach):
        * khtml/rendering/render_br.cpp:
        (RenderBR::setPos):
        * khtml/rendering/render_br.h:
        * khtml/rendering/render_flow.cpp:
        (RenderFlow::dirtyLinesFromChangedChild):

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

WebCore/ChangeLog-2005-08-23
WebCore/khtml/rendering/render_box.cpp
WebCore/khtml/rendering/render_br.cpp
WebCore/khtml/rendering/render_br.h
WebCore/khtml/rendering/render_flow.cpp

index 538eba5d8f4b184fbe59f015c8d2648d8dd844d0..e87771f1535dd04c1c6317493106d909d8585625 100644 (file)
@@ -1,3 +1,18 @@
+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
+       on lines by themselves.
+       
+        Reviewed by kocienda
+
+        * khtml/rendering/render_box.cpp:
+        (RenderBox::detach):
+        * khtml/rendering/render_br.cpp:
+        (RenderBR::setPos):
+        * khtml/rendering/render_br.h:
+        * khtml/rendering/render_flow.cpp:
+        (RenderFlow::dirtyLinesFromChangedChild):
+
 2004-05-20  Ken Kocienda  <kocienda@apple.com>
 
         Reviewed by Hyatt
index 1723f4d7142f95140ffc3ee30cbb3bb5b6707d3a..964055f7b637680f48aaa418404a3cd7671e69f7 100644 (file)
@@ -135,6 +135,7 @@ void RenderBox::detach()
         if (!documentBeingDestroyed())
             m_inlineBoxWrapper->remove();
         m_inlineBoxWrapper->detach(arena);
+        m_inlineBoxWrapper = 0;
     }
 
     RenderContainer::detach();
index 2f993f1f7ad1dfc99e3913e2a433953a89b5e35b..62d908f52e222ae2529cf0763a45a38046ef5cc3 100644 (file)
@@ -35,6 +35,12 @@ RenderBR::~RenderBR()
 {
 }
 
+void RenderBR::setPos(int xPos, int yPos)
+{
+    m_x = xPos;
+    m_y = yPos;
+}
+
 InlineBox* RenderBR::createInlineBox(bool makePlaceholder, bool isRootLineBox, bool isOnlyRun)
 {
     // We only make a box for a <br> if we are on a line by ourself or in strict mode
index f7a0e9d1b8d797b52d6301716854ebd38ccb3f07..077fd2e4c4bd3ef1e0f9102e684e420074deae55 100644 (file)
@@ -60,7 +60,8 @@ public:
     virtual int xPos() const { return m_x; }
     virtual int yPos() const { return m_y; }
     virtual int height() const { return m_height; }
-
+    virtual void setPos(int xPos, int yPos);
+    
     virtual bool isBR() const { return true; }
 
     virtual long caretMinOffset() const;
index 317466e83b42af678c4632c966e88fbb00809aec..c04e687723a34e46214fcebc7d162111b8916010 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->previousSibling(); curr; curr = curr->previousSibling()) {
+    for (RenderObject* curr = child; curr; curr = curr->previousSibling()) {
         if (curr->isFloatingOrPositioned())
             continue;