[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 07:32:06 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 521a084ec5d7e4ecc34c4fbced2cddf086392778
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Mar 27 23:05:52 2003 +0000

    	Fix for 3166374.  When a float is removed, crawl up and down the
    	tree looking for blocks that contain the float and dirty them all.
    
            Reviewed by darin
    
            * ChangeLog:
            * khtml/rendering/render_block.cpp:
            * khtml/rendering/render_block.h:
            * khtml/rendering/render_object.cpp:
            (RenderObject::markAllDescendantsWithFloatsForLayout):
            (RenderObject::removeFromObjectLists):
            * khtml/rendering/render_object.h:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3949 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 273a904..33a22e4 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,18 @@
+2003-03-27  David Hyatt  <hyatt at apple.com>
+
+	Fix for 3166374.  When a float is removed, crawl up and down the
+	tree looking for blocks that contain the float and dirty them all.
+	
+        Reviewed by darin
+
+        * ChangeLog:
+        * khtml/rendering/render_block.cpp:
+        * khtml/rendering/render_block.h:
+        * khtml/rendering/render_object.cpp:
+        (RenderObject::markAllDescendantsWithFloatsForLayout):
+        (RenderObject::removeFromObjectLists):
+        * khtml/rendering/render_object.h:
+
 2003-03-27  Maciej Stachowiak  <mjs at apple.com>
 
         Reviewed by Darin.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 273a904..33a22e4 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,18 @@
+2003-03-27  David Hyatt  <hyatt at apple.com>
+
+	Fix for 3166374.  When a float is removed, crawl up and down the
+	tree looking for blocks that contain the float and dirty them all.
+	
+        Reviewed by darin
+
+        * ChangeLog:
+        * khtml/rendering/render_block.cpp:
+        * khtml/rendering/render_block.h:
+        * khtml/rendering/render_object.cpp:
+        (RenderObject::markAllDescendantsWithFloatsForLayout):
+        (RenderObject::removeFromObjectLists):
+        * khtml/rendering/render_object.h:
+
 2003-03-27  Maciej Stachowiak  <mjs at apple.com>
 
         Reviewed by Darin.
diff --git a/WebCore/khtml/rendering/render_block.cpp b/WebCore/khtml/rendering/render_block.cpp
index 5f556cb..3e16436 100644
--- a/WebCore/khtml/rendering/render_block.cpp
+++ b/WebCore/khtml/rendering/render_block.cpp
@@ -845,11 +845,20 @@ void RenderBlock::layoutBlockChildren( bool relayoutChildren )
             }
 
             child->setPos(child->xPos(), ypos);
-            if (ypos != yPosEstimate && (child->containsFloats() || containsFloats())) {
+            if (ypos != yPosEstimate) {
+                if (child->style()->htmlHacks() && child->style()->flowAroundFloats() &&
+                    child->style()->width().isPercent())
+                    // The child's width can be a percentage width and if it has the
+                    // quirky flowAroundFloats
+                    // property set, when the child shifts to clear an item, its width can
+                    // change (because it has more available line width).
+                    // So go ahead an mark the item as dirty.
+                    child->setLayouted(false);
+
+                if (child->containsFloats() || containsFloats())
+                    child->markAllDescendantsWithFloatsForLayout();
+
                 // Our guess was wrong. Make the child lay itself out again.
-                // XXXdwh some debugging code for this.
-                // printf("WE WERE WRONG for object %d (%d, %d)!\n", (int)child, yPosEstimate, ypos);
-                child->markAllDescendantsWithFloatsForLayout();
                 if (!child->layouted())
                     child->layout();
             }
@@ -872,9 +881,18 @@ void RenderBlock::layoutBlockChildren( bool relayoutChildren )
             }
 
             // If our value of clear caused us to be repositioned vertically to be
-            // underneath a float, we have to do another layout to take into account
+            // underneath a float, we might have to do another layout to take into account
             // the extra space we now have available.
-            child->markAllDescendantsWithFloatsForLayout();
+            if (child->style()->htmlHacks() && child->style()->flowAroundFloats() &&
+                child->style()->width().isPercent())
+                // The child's width can be a percentage width and if it has the
+                // quirky flowAroundFloats
+                // property set, when the child shifts to clear an item, its width can
+                // change (because it has more available line width).
+                // So go ahead an mark the item as dirty.
+                child->setLayouted(false);
+            if (child->containsFloats())
+                child->markAllDescendantsWithFloatsForLayout();
             if (!child->layouted())
                 child->layout();
         }
@@ -1702,23 +1720,34 @@ void RenderBlock::addOverHangingFloats( RenderBlock *flow, int xoff, int offset,
     }
 }
 
-void RenderBlock::markAllDescendantsWithFloatsForLayout()
+bool RenderBlock::containsFloat(RenderObject* o)
 {
-    if (style()->htmlHacks() && style()->flowAroundFloats() && style()->width().isPercent())
-        // The child's width can be a percentage width and if it has the quirky flowAroundFloats
-        // property set, when the child shifts to clear an item, its width can change (because it
-        // has more available line width.
-        // So go ahead an mark these items as dirty.
-        setLayouted(false);
-
-    if (isTable() || isFloatingOrPositioned() || !containsFloats())
-        return;
+    if (m_floatingObjects) {
+        QPtrListIterator<FloatingObject> it(*m_floatingObjects);
+        while (it.current()) {
+            if (it.current()->node == o)
+                return true;
+            ++it;
+        }
+    }
+    return false;
+}
 
+void RenderBlock::markAllDescendantsWithFloatsForLayout(RenderObject* floatToRemove)
+{
     setLayouted(false);
-    
+
+    if (floatToRemove)
+        removeFloatingObject(floatToRemove);
+
     // Iterate over our children and mark them as needed.
-    for (RenderObject* child = firstChild(); child; child = child->nextSibling())
-        child->markAllDescendantsWithFloatsForLayout();
+    if (!childrenInline()) {
+        for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
+            if (isBlockFlow() && !child->isFloatingOrPositioned() &&
+                (floatToRemove ? child->containsFloat(floatToRemove) : child->containsFloats()))
+                child->markAllDescendantsWithFloatsForLayout();
+        }
+    }
 }
 
 bool RenderBlock::checkClear(RenderObject *child)
diff --git a/WebCore/khtml/rendering/render_block.h b/WebCore/khtml/rendering/render_block.h
index ed9a592..a306772 100644
--- a/WebCore/khtml/rendering/render_block.h
+++ b/WebCore/khtml/rendering/render_block.h
@@ -119,9 +119,11 @@ public:
     void positionNewFloats();
     void clearFloats();
     bool checkClear(RenderObject *child);
-    virtual void markAllDescendantsWithFloatsForLayout();
+    virtual void markAllDescendantsWithFloatsForLayout(RenderObject* floatToRemove = 0);
     
     virtual bool containsFloats() { return m_floatingObjects!=0; }
+    virtual bool containsFloat(RenderObject* o);
+
     virtual bool hasOverhangingFloats() { return floatBottom() > m_height; }
     void addOverHangingFloats( RenderBlock *block, int xoffset, int yoffset, bool child = false );
     
diff --git a/WebCore/khtml/rendering/render_object.cpp b/WebCore/khtml/rendering/render_object.cpp
index 0c8a205..fba54aa 100644
--- a/WebCore/khtml/rendering/render_object.cpp
+++ b/WebCore/khtml/rendering/render_object.cpp
@@ -351,7 +351,7 @@ RenderObject* RenderObject::offsetParent() const
     return curr;
 }
 
-void RenderObject::markAllDescendantsWithFloatsForLayout()
+void RenderObject::markAllDescendantsWithFloatsForLayout(RenderObject*)
 {
 }
 
@@ -1111,11 +1111,15 @@ void RenderObject::invalidateLayout()
 void RenderObject::removeFromObjectLists()
 {
     if (isFloating()) {
-	RenderObject *p;
-	for (p = parent(); p; p = p->parent()) {
-            if (p->isRenderBlock()) 
-		static_cast<RenderBlock*>(p)->removeFloatingObject(this);
+        RenderBlock* outermostBlock = 0;
+        for (RenderObject* p = parent(); p; p = p->parent()) {
+            if (p->isRenderBlock())
+                outermostBlock = static_cast<RenderBlock*>(p);
+            if (!p->isRenderBlock() || !p->containsFloat(this) || p->isFloatingOrPositioned())
+                break;
 	}
+        if (outermostBlock)
+            outermostBlock->markAllDescendantsWithFloatsForLayout(this);
     }
 
     if (isPositioned()) {
diff --git a/WebCore/khtml/rendering/render_object.h b/WebCore/khtml/rendering/render_object.h
index 9e7deeb..8237e82 100644
--- a/WebCore/khtml/rendering/render_object.h
+++ b/WebCore/khtml/rendering/render_object.h
@@ -229,7 +229,7 @@ public:
 
     void setOverhangingContents(bool p=true);
 
-    virtual void markAllDescendantsWithFloatsForLayout();
+    virtual void markAllDescendantsWithFloatsForLayout(RenderObject* floatToRemove = 0);
     void setLayouted(bool b=true);
 
     void setMinMaxKnown(bool b=true) {
@@ -516,6 +516,7 @@ public:
 
     bool isFloatingOrPositioned() const { return (isFloating() || isPositioned()); };
     virtual bool containsFloats() { return false; }
+    virtual bool containsFloat(RenderObject* o) { return false; }
     virtual bool hasOverhangingFloats() { return false; }
 
     // positioning of inline childs (bidi)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list