[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:26:26 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 2f6b84a87614a890f662a787ef841c6ae2d19bb5
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Feb 12 01:33:51 2004 +0000

    	Add some more polish to ensure the ypos estimate is right.  Correct the clearing of images so that
    	their top margins do not get added in when they clear the float because of having a large width.
    
            Reviewed by kocienda
    
            * khtml/rendering/render_block.cpp:
            (khtml::RenderBlock::layoutBlockChildren):
            * layout-tests/fast/block/margin-collapse/101-expected.txt: Added.
            * layout-tests/fast/block/margin-collapse/101.html: Added.
            * layout-tests/fast/block/margin-collapse/102-expected.txt: Added.
            * layout-tests/fast/block/margin-collapse/102.html: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6078 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/fast/block/margin-collapse/101-expected.txt b/LayoutTests/fast/block/margin-collapse/101-expected.txt
new file mode 100644
index 0000000..1c68d6b
--- /dev/null
+++ b/LayoutTests/fast/block/margin-collapse/101-expected.txt
@@ -0,0 +1,12 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x363
+  RenderBlock {HTML} at (0,0) size 800x363
+    RenderBody {BODY} at (8,8) size 784x347
+      RenderBlock {DIV} at (0,0) size 385x347
+        RenderBlock {P} at (0,0) size 385x40 [border: (2px solid #0000FF)]
+          RenderText {TEXT} at (2,2) size 365x36
+            text run at (2,2) width 146: "There should be only 2"
+            text run at (148,2) width 219: "em between this paragraph and the"
+            text run at (2,20) width 85: "image below."
+        RenderImage {IMG} at (0,72) size 395x275
diff --git a/LayoutTests/fast/block/margin-collapse/100.html b/LayoutTests/fast/block/margin-collapse/101.html
similarity index 52%
copy from LayoutTests/fast/block/margin-collapse/100.html
copy to LayoutTests/fast/block/margin-collapse/101.html
index b519595..900650a 100644
--- a/LayoutTests/fast/block/margin-collapse/100.html
+++ b/LayoutTests/fast/block/margin-collapse/101.html
@@ -9,11 +9,12 @@
 	width: 385px;
 }
 
-h2 { margin-top: 40px; }
-
 img {
     display: block;
+    margin-top: 1em;
 }
+
+p { border: 2px solid blue; margin-bottom: 2em; }
 </style>
 
 
@@ -22,15 +23,10 @@ img {
 
 <body>
 <div id="bravefourhundred">
-<img width="395" height="275" border="0">
-
-<h2>This text should be on line one.</h2>
-
-This text should be on the following lines.  These lines should not overlap.
 
-<h2>Here's what's weird.</h2>
+<p>There should be only 2em between this paragraph and the
+image below.</p>
 
-The problem persists!
-</div>
+<img width="395" height="275" border="0"></div>
 </body>
 </html>
diff --git a/LayoutTests/fast/block/margin-collapse/102-expected.txt b/LayoutTests/fast/block/margin-collapse/102-expected.txt
new file mode 100644
index 0000000..6f97ea7
--- /dev/null
+++ b/LayoutTests/fast/block/margin-collapse/102-expected.txt
@@ -0,0 +1,12 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x427
+  RenderBlock {HTML} at (0,0) size 800x427
+    RenderBody {BODY} at (8,8) size 784x411
+      RenderBlock {DIV} at (0,0) size 385x411
+        RenderBlock {DIV} at (0,0) size 385x36
+          RenderText {TEXT} at (0,0) size 364x36
+            text run at (0,0) width 364: "There should be no vertical space between the two blocks"
+            text run at (0,18) width 43: "below."
+        RenderBlock (floating) {DIV} at (0,36) size 100x100 [bgcolor=#008000]
+        RenderImage {IMG} at (0,136) size 395x275 [bgcolor=#FFFF00]
diff --git a/LayoutTests/fast/block/margin-collapse/100.html b/LayoutTests/fast/block/margin-collapse/102.html
similarity index 52%
copy from LayoutTests/fast/block/margin-collapse/100.html
copy to LayoutTests/fast/block/margin-collapse/102.html
index b519595..03a8e12 100644
--- a/LayoutTests/fast/block/margin-collapse/100.html
+++ b/LayoutTests/fast/block/margin-collapse/102.html
@@ -9,11 +9,14 @@
 	width: 385px;
 }
 
-h2 { margin-top: 40px; }
-
 img {
+    margin-top:1em;
     display: block;
+    background-color:yellow;
 }
+
+.foo { float:left;width:100px; height:100px;background-color:green }
+
 </style>
 
 
@@ -22,15 +25,8 @@ img {
 
 <body>
 <div id="bravefourhundred">
-<img width="395" height="275" border="0">
-
-<h2>This text should be on line one.</h2>
-
-This text should be on the following lines.  These lines should not overlap.
-
-<h2>Here's what's weird.</h2>
-
-The problem persists!
+<div>There should be no vertical space between the two blocks below.</div>
+<div class="foo"></div><img width="395" height="275" border="0">
 </div>
 </body>
 </html>
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 7e94546..a87efeb 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,19 @@
 2004-02-11  David Hyatt  <hyatt at apple.com>
 
+	Add some more polish to ensure the ypos estimate is right.  Correct the clearing of images so that
+	their top margins do not get added in when they clear the float because of having a large width.
+	
+        Reviewed by kocienda
+
+        * khtml/rendering/render_block.cpp:
+        (khtml::RenderBlock::layoutBlockChildren):
+        * layout-tests/fast/block/margin-collapse/101-expected.txt: Added.
+        * layout-tests/fast/block/margin-collapse/101.html: Added.
+        * layout-tests/fast/block/margin-collapse/102-expected.txt: Added.
+        * layout-tests/fast/block/margin-collapse/102.html: Added.
+
+2004-02-11  David Hyatt  <hyatt at apple.com>
+
 	Fix for 3556702, margin collapsing gets disabled when images spill out of the containing block.
 	
         Reviewed by kocienda
diff --git a/WebCore/khtml/rendering/render_block.cpp b/WebCore/khtml/rendering/render_block.cpp
index 17d9266..9fab63b 100644
--- a/WebCore/khtml/rendering/render_block.cpp
+++ b/WebCore/khtml/rendering/render_block.cpp
@@ -743,26 +743,8 @@ void RenderBlock::layoutBlockChildren( bool relayoutChildren )
             }
         }
         
-        // Note this occurs after the test for positioning and floating above, since
-        // we want to ensure that we don't artificially increase our height because of
-        // a positioned or floating child.
-        if (child->avoidsFloats() && style()->width().isFixed() && child->minWidth() > lineWidth(m_height)) {
-            m_height = kMax(m_height, floatBottom());
-            shouldCollapseChild = false;
-            clearOccurred = true;
-        }
-
-        // take care in case we inherited floats
-        if (child && floatBottom() > m_height)
-            child->setChildNeedsLayout(true);
-        
         child->calcVerticalMargins();
 
-        //kdDebug(0) << "margin = " << margin << " yPos = " << m_height << endl;
-
-        int oldChildX = child->xPos();
-        int oldChildY = child->yPos();
-        
         // 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.
@@ -778,7 +760,30 @@ void RenderBlock::layoutBlockChildren( bool relayoutChildren )
         }
         else if (!canCollapseTopWithChildren || !topMarginContributor)
             yPosEstimate += child->marginTop();
+        
+        // Note this occurs after the test for positioning and floating above, since
+        // we want to ensure that we don't artificially increase our height because of
+        // a positioned or floating child.
+        int fb = floatBottom();
+        if (child->avoidsFloats() && style()->width().isFixed() && child->minWidth() > lineWidth(m_height)) {
+            if (fb > m_height) {
+                m_height = yPosEstimate = fb;
+                shouldCollapseChild = false;
+                clearOccurred = true;
+                prevFlow = 0;
+                prevBlock = 0;
+            }
+        }
 
+        // take care in case we inherited floats
+        if (fb > m_height)
+            child->setChildNeedsLayout(true);
+
+        //kdDebug(0) << "margin = " << margin << " yPos = " << m_height << endl;
+
+        int oldChildX = child->xPos();
+        int oldChildY = child->yPos();
+        
         // Go ahead and position the child as though it didn't collapse with the top.
         child->setPos(child->xPos(), yPosEstimate);
         child->layoutIfNeeded();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list