Reviewed by Ken Kocienda and Dave Hyatt (OOPS!).
authorharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Dec 2004 00:45:22 +0000 (00:45 +0000)
committerharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Dec 2004 00:45:22 +0000 (00:45 +0000)
<rdar://problem/3849947> Typing after pasting line does not appear until after window resize.

        * khtml/rendering/render_flow.cpp:
        (RenderFlow::dirtyLinesFromChangedChild):
Dirty the line above because new child can inval the cached line break position of previous line.

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

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

index e9bf0893444adbbd77ee45ef1abf9d3f950b4c61..c7a6fdb185ea6df385c70b9ad0e7f56cf2c874da 100644 (file)
@@ -1,3 +1,14 @@
+2004-12-06  David Harrison  <harrison@apple.com>
+
+        Reviewed by Ken Kocienda and Dave Hyatt (OOPS!).
+
+               <rdar://problem/3849947> Typing after pasting line does not appear until after window resize.
+               
+               
+        * khtml/rendering/render_flow.cpp:
+        (RenderFlow::dirtyLinesFromChangedChild):
+               Dirty the line above because new child can inval the cached line break position of previous line.
+
 2004-12-06  David Hyatt  <hyatt@apple.com>
 
        Fix for 3254464, radio buttons do not work for quiz on netscape.com.  Left/top overflow needed to be implemented.
index 0f388e5ffb7f53b102031fd442d01335c9fb833d..01b90bade27b892b096dac134b42b3cbcff51436 100644 (file)
@@ -267,11 +267,23 @@ void RenderFlow::dirtyLinesFromChangedChild(RenderObject* child, bool adding)
 
     // If we found a line box, then dirty it.
     if (box) {
+        RootInlineBox* adjacentBox;
         box->markDirty();
+        
+        // dirty the adjacent lines that might be affected
+        // NOTE: we dirty the previous line because RootInlineBox objects cache
+        // the address of the first object on the next line after a BR, which we may be
+        // invalidating here.  For more info, see how RenderBlock::layoutInlineChildren
+        // calls setLineBreakInfo with the result of findNextLineBreak.  findNextLineBreak,
+        // despite the name, actually returns the first RenderObject after the BR.
+        // <rdar://problem/3849947> "Typing after pasting line does not appear until after window resize."
+        adjacentBox = box->prevRootBox();
+        if (adjacentBox)
+            adjacentBox->markDirty();
         if (child->isBR()) {
-            RootInlineBox* next = box->nextRootBox();
-            if (next)
-                next->markDirty();
+            adjacentBox = box->nextRootBox();
+            if (adjacentBox)
+                adjacentBox->markDirty();
         }
     }
 }