[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 06:59:47 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit c6ead7fe37830267f61a5879041d9fa38db34030
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Nov 13 23:01:44 2002 +0000

    	Fix for floats. Force relayout if collapsing margins
    	have to adjust the position of an object.
    
            * khtml/rendering/render_flow.cpp:
            (RenderFlow::layoutBlockChildren):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2659 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index d468bac..85cf8d5 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,5 +1,13 @@
 2002-11-13  David Hyatt  <hyatt at apple.com>
 
+	Fix for floats. Force relayout if collapsing margins
+	have to adjust the position of an object.
+	
+        * khtml/rendering/render_flow.cpp:
+        (RenderFlow::layoutBlockChildren):
+
+2002-11-13  David Hyatt  <hyatt at apple.com>
+
 	Rewrite cellpadding to not use the style system at all and
 	to make table cells just get the padding from the table
 	itself (overriding style).
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index d468bac..85cf8d5 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,5 +1,13 @@
 2002-11-13  David Hyatt  <hyatt at apple.com>
 
+	Fix for floats. Force relayout if collapsing margins
+	have to adjust the position of an object.
+	
+        * khtml/rendering/render_flow.cpp:
+        (RenderFlow::layoutBlockChildren):
+
+2002-11-13  David Hyatt  <hyatt at apple.com>
+
 	Rewrite cellpadding to not use the style system at all and
 	to make table cells just get the padding from the table
 	itself (overriding style).
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index d468bac..85cf8d5 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,13 @@
 2002-11-13  David Hyatt  <hyatt at apple.com>
 
+	Fix for floats. Force relayout if collapsing margins
+	have to adjust the position of an object.
+	
+        * khtml/rendering/render_flow.cpp:
+        (RenderFlow::layoutBlockChildren):
+
+2002-11-13  David Hyatt  <hyatt at apple.com>
+
 	Rewrite cellpadding to not use the style system at all and
 	to make table cells just get the padding from the table
 	itself (overriding style).
diff --git a/WebCore/khtml/rendering/render_flow.cpp b/WebCore/khtml/rendering/render_flow.cpp
index 16cdb1e..2be7615 100644
--- a/WebCore/khtml/rendering/render_flow.cpp
+++ b/WebCore/khtml/rendering/render_flow.cpp
@@ -453,7 +453,17 @@ void RenderFlow::layoutBlockChildren( bool relayoutChildren )
                 child->layout();
         } else if ( child->isFloating() ) {
             insertSpecialObject( child );
+            
+            // The float should be positioned taking into account the bottom margin
+            // of the previous flow.  We add that margin into the height, get the
+            // float positioned properly, and then subtract the margin out of the
+            // height again. -dwh
+            if (prevFlow)
+                m_height += prevFlow->collapsedMarginBottom();
             positionNewFloats();
+            if (prevFlow)
+                m_height -= prevFlow->collapsedMarginBottom();
+                
             //kdDebug() << "RenderFlow::layoutBlockChildren inserting float at "<< m_height <<" prevMargin="<<prevMargin << endl;
             child = child->nextSibling();
             continue;
@@ -463,15 +473,23 @@ void RenderFlow::layoutBlockChildren( bool relayoutChildren )
 
         //kdDebug(0) << "margin = " << margin << " yPos = " << m_height << endl;
 
-        if(prevFlow)
+        // Try to guess our correct y position.  In most cases this guess will
+        // be correct.  Only if we're wrong (when we compute the real y position)
+        // will we have to relayout.
+        int yPosEstimate = m_height;
+        if (prevFlow)
         {
-            if (prevFlow->yPos()+prevFlow->floatBottom() > m_height)
+            yPosEstimate += QMAX(prevFlow->collapsedMarginBottom(), child->marginTop());
+            if (prevFlow->yPos()+prevFlow->floatBottom() > yPosEstimate)
                 child->setLayouted(false);
             else
                 prevFlow=0;
         }
+        else if (!canCollapseWithChildren || !topMarginContributor)
+            yPosEstimate += child->marginTop();
 
-        child->setPos(child->xPos(), m_height);
+        // Go ahead and position the child as though it didn't collapse with the top.
+        child->setPos(child->xPos(), yPosEstimate);
         if ( !child->layouted() )
             child->layout();
 
@@ -555,6 +573,13 @@ void RenderFlow::layoutBlockChildren( bool relayoutChildren )
                     bottomChildQuirk = child->isBottomMarginQuirk();
             }
             child->setPos(child->xPos(), ypos);
+            if (ypos != yPosEstimate) {
+                // 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->setLayouted(false);
+                child->layout();
+            }
         }
 
         // Now check for clear.

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list