Fix for 3663644, repaints don't occur when the .innerHTML of a positioned element...
authorhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 May 2004 22:17:10 +0000 (22:17 +0000)
committerhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 May 2004 22:17:10 +0000 (22:17 +0000)
        Reviewed by john

        * khtml/rendering/bidi.cpp:
        (khtml::RenderBlock::layoutInlineChildren):
        * khtml/rendering/render_layer.h:
        (khtml::RenderLayer::repaintRect):

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

WebCore/ChangeLog-2005-08-23
WebCore/khtml/rendering/bidi.cpp
WebCore/khtml/rendering/render_layer.h

index 17182d4893008a86a3f5ea29b5dea89f09ea825d..09f3615e5c620c4a12a252d9cd7ba0dcea2d6651 100644 (file)
@@ -1,3 +1,14 @@
+2004-05-21  David Hyatt  <hyatt@apple.com>
+
+       Fix for 3663644, repaints don't occur when the .innerHTML of a positioned element is changed.
+       
+        Reviewed by john
+
+        * khtml/rendering/bidi.cpp:
+        (khtml::RenderBlock::layoutInlineChildren):
+        * khtml/rendering/render_layer.h:
+        (khtml::RenderLayer::repaintRect):
+
 === Safari-141 ===
 
 2004-05-21  Darin Adler  <darin@apple.com>
index 300589c2ec5b880bf4e95983e0b74ad0a1211588..d5490cb55d51fc6063ceabcc075a05962cda9659 100644 (file)
@@ -25,6 +25,8 @@
 #include "render_block.h"
 #include "render_text.h"
 #include "render_arena.h"
+#include "render_canvas.h"
+#include "khtmlview.h"
 #include "xml/dom_docimpl.h"
 
 #include "kdebug.h"
@@ -1362,9 +1364,19 @@ QRect RenderBlock::layoutInlineChildren(bool relayoutChildren)
         if (hasFloat)
             fullLayout = true; // FIXME: Will need to find a way to optimize floats some day.
         
-        if (fullLayout && !selfNeedsLayout())
+        if (fullLayout && !selfNeedsLayout()) {
             setNeedsLayout(true, false);  // Mark ourselves as needing a full layout. This way we'll repaint like
                                           // we're supposed to.
+            if (!document()->view()->needsFullRepaint() && m_layer) {
+                // Because we waited until we were already inside layout to discover
+                // that the block really needed a full layout, we missed our chance to repaint the layer
+                // before layout started.  Luckily the layer has cached the repaint rect for its original
+                // position and size, and so we can use that to make a repaint happen now.
+                RenderCanvas* c = canvas();
+                if (c && !c->printingMode())
+                    c->repaintViewRectangle(m_layer->repaintRect());
+            }
+        }
 
         BidiContext *startEmbed;
         if( style()->direction() == LTR ) {
index 652cc6588410123c5918a3b47417e0ab45f7b885..df40d29796af60dff70c33bad93f4b83bd5a8775 100644 (file)
@@ -248,6 +248,8 @@ public:
     
     void updateHoverActiveState(RenderObject::NodeInfo& info);
     
+    QRect repaintRect() const { return m_repaintRect; }
+
     void detach(RenderArena* renderArena);
 
      // Overloaded new operator.  Derived classes must override operator new