[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

hyatt hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:11:17 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit a9e91e45373622d383a77c1f538aecaf4ed1a3c7
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Nov 12 23:37:05 2003 +0000

    	Fix for 3482132, incremental repainting for layout, i.e., only repaint areas that change when
    	doing a layout.
    
            Reviewed by kocienda
    
            * khtml/khtmlview.h:
            * khtml/rendering/render_canvas.cpp:
            (RenderCanvas::repaintViewRectangle):
            * khtml/rendering/render_layer.h:
            * khtml/rendering/render_object.cpp:
            (RenderObject::setNeedsLayout):
            (RenderObject::setChildNeedsLayout):
            * khtml/rendering/render_object.h:
            * khtml/rendering/render_table.cpp:
            (RenderTableSection::layoutRows):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5470 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 05ae355..994f429 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,21 @@
+2003-11-12  David Hyatt  <hyatt at apple.com>
+
+	Fix for 3482132, incremental repainting for layout, i.e., only repaint areas that change when
+	doing a layout.
+	
+        Reviewed by kocienda
+
+        * khtml/khtmlview.h:
+        * khtml/rendering/render_canvas.cpp:
+        (RenderCanvas::repaintViewRectangle):
+        * khtml/rendering/render_layer.h:
+        * khtml/rendering/render_object.cpp:
+        (RenderObject::setNeedsLayout):
+        (RenderObject::setChildNeedsLayout):
+        * khtml/rendering/render_object.h:
+        * khtml/rendering/render_table.cpp:
+        (RenderTableSection::layoutRows):
+
 2003-11-12  Ken Kocienda  <kocienda at apple.com>
 
         Reviewed by me
diff --git a/WebCore/khtml/khtmlview.h b/WebCore/khtml/khtmlview.h
index 7eca5e4..9da0419 100644
--- a/WebCore/khtml/khtmlview.h
+++ b/WebCore/khtml/khtmlview.h
@@ -33,7 +33,7 @@ class QPainter;
 class QRect;
 
 // Uncomment to enable INCREMENTAL_REPAINTING
-//#define INCREMENTAL_REPAINTING
+#define INCREMENTAL_REPAINTING
 
 namespace DOM {
     class HTMLDocumentImpl;
diff --git a/WebCore/khtml/rendering/render_canvas.cpp b/WebCore/khtml/rendering/render_canvas.cpp
index 7bb12bc..4b3aafd 100644
--- a/WebCore/khtml/rendering/render_canvas.cpp
+++ b/WebCore/khtml/rendering/render_canvas.cpp
@@ -268,8 +268,26 @@ void RenderCanvas::repaintViewRectangle(const QRect& ur, bool immediate)
     if (m_printingMode || ur.width() == 0 || ur.height() == 0) return;
 
     QRect vr = viewRect();
-    if (m_view && ur.intersects(vr))
-        m_view->repaintRectangle(ur.intersect(vr), immediate);
+    if (m_view && ur.intersects(vr)) {
+        // We always just invalidate the root view, since we could be an iframe that is clipped out
+        // or even invisible.
+        QRect r = ur.intersect(vr);
+        DOM::ElementImpl* elt = element()->getDocument()->ownerElement();
+        if (!elt)
+            m_view->repaintRectangle(r, immediate);
+        else {
+            // Subtract out the contentsX and contentsY offsets to get our coords within the viewing
+            // rectangle.
+            r.setX(r.x() - m_view->contentsX());
+            r.setY(r.y() - m_view->contentsY());
+            
+            RenderObject* obj = elt->renderer();
+            int frameOffset = (m_view->frameStyle() != QFrame::NoFrame) ? 2 : 0;
+            r.setX(r.x() + obj->borderLeft()+obj->paddingLeft() + frameOffset);
+            r.setY(r.y() + obj->borderTop()+obj->paddingTop() + frameOffset);
+            obj->repaintRectangle(r, immediate);
+        }
+    }
 }
 
 QRect RenderCanvas::getAbsoluteRepaintRect()
diff --git a/WebCore/khtml/rendering/render_layer.h b/WebCore/khtml/rendering/render_layer.h
index 2d3564f..6cd2ea1 100644
--- a/WebCore/khtml/rendering/render_layer.h
+++ b/WebCore/khtml/rendering/render_layer.h
@@ -54,7 +54,7 @@ class QScrollBar;
 template <class T> class QPtrVector;
 
 // Uncomment to enable incremental painting
-//#define INCREMENTAL_REPAINTING 1
+#define INCREMENTAL_REPAINTING 1
 
 namespace khtml {
     class RenderStyle;
diff --git a/WebCore/khtml/rendering/render_object.cpp b/WebCore/khtml/rendering/render_object.cpp
index df7ab0b..2f67c88 100644
--- a/WebCore/khtml/rendering/render_object.cpp
+++ b/WebCore/khtml/rendering/render_object.cpp
@@ -437,7 +437,7 @@ void RenderObject::markAllDescendantsWithFloatsForLayout(RenderObject*)
 {
 }
 
-void RenderObject::setNeedsLayout(bool b) 
+void RenderObject::setNeedsLayout(bool b, bool markParents) 
 {
 #ifdef INCREMENTAL_REPAINTING
     bool alreadyNeededLayout = m_needsLayout;
@@ -446,7 +446,7 @@ void RenderObject::setNeedsLayout(bool b)
 #endif
     m_needsLayout = b;
     if (b) {
-        if (!alreadyNeededLayout)
+        if (!alreadyNeededLayout && markParents)
             markContainingBlocksForLayout();
     }
     else {
@@ -455,7 +455,7 @@ void RenderObject::setNeedsLayout(bool b)
     }
 }
 
-void RenderObject::setChildNeedsLayout(bool b)
+void RenderObject::setChildNeedsLayout(bool b, bool markParents)
 {
 #ifdef INCREMENTAL_REPAINTING
     bool alreadyNeededLayout = m_normalChildNeedsLayout;
@@ -464,7 +464,7 @@ void RenderObject::setChildNeedsLayout(bool b)
 #endif
     m_normalChildNeedsLayout = b;
     if (b) {
-        if (!alreadyNeededLayout)
+        if (!alreadyNeededLayout && markParents)
             markContainingBlocksForLayout();
     }
     else {
diff --git a/WebCore/khtml/rendering/render_object.h b/WebCore/khtml/rendering/render_object.h
index ebfbfa5..934d83b 100644
--- a/WebCore/khtml/rendering/render_object.h
+++ b/WebCore/khtml/rendering/render_object.h
@@ -37,7 +37,7 @@
 #include "xml/dom_nodeimpl.h"
 
 // Uncomment to turn on incremental repainting.
-// #define INCREMENTAL_REPAINTING 1
+#define INCREMENTAL_REPAINTING 1
 
 class QPainter;
 class QTextStream;
@@ -280,8 +280,8 @@ public:
 
     virtual void markAllDescendantsWithFloatsForLayout(RenderObject* floatToRemove = 0);
     void markContainingBlocksForLayout();
-    void setNeedsLayout(bool b);
-    void setChildNeedsLayout(bool b);
+    void setNeedsLayout(bool b, bool markParents = true);
+    void setChildNeedsLayout(bool b, bool markParents = true);
     void setMinMaxKnown(bool b=true) {
 	m_minMaxKnown = b;
 	if ( !b ) {
diff --git a/WebCore/khtml/rendering/render_table.cpp b/WebCore/khtml/rendering/render_table.cpp
index afecd6d..8c95e7d 100644
--- a/WebCore/khtml/rendering/render_table.cpp
+++ b/WebCore/khtml/rendering/render_table.cpp
@@ -1136,6 +1136,12 @@ void RenderTableSection::calcRowHeight()
 	    if ( ( indx = r - cell->rowSpan() + 1 ) < 0 )
 		indx = 0;
 
+            if (cell->getCellPercentageHeight()) {
+                cell->setCellPercentageHeight(0);
+                cell->setChildNeedsLayout(true, false);
+                cell->layoutIfNeeded();
+            }
+            
             // Explicit heights use the border box in quirks mode.  In strict mode do the right
             // thing and actually add in the border and padding.
 	    ch = cell->style()->height().width(0) + 
@@ -1283,7 +1289,8 @@ int RenderTableSection::layoutRows( int toAdd )
             RenderObject* o = cell->firstChild();
             while (o) {
                 if (o->style()->height().isPercent()) {
-                    o->setNeedsLayout(true);
+                    o->setNeedsLayout(true, false);
+                    cell->setChildNeedsLayout(true, false);
                     cellChildrenFlex = true;
                 }
                 o = o->nextSibling();
@@ -1554,11 +1561,6 @@ void RenderTableRow::layout()
     while( child ) {
         if (child->isTableCell()) {
             RenderTableCell *cell = static_cast<RenderTableCell *>(child);
-            if (cell->getCellPercentageHeight()) {
-                cell->setCellPercentageHeight(0);
-                if (!cell->needsLayout())
-                    cell->setChildNeedsLayout(true);
-            }
             if (child->needsLayout()) {
                 cell->calcVerticalMargins();
                 cell->layout();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list