https://bugs.webkit.org/show_bug.cgi?id=46659
authorhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Sep 2010 22:32:34 +0000 (22:32 +0000)
committerhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Sep 2010 22:32:34 +0000 (22:32 +0000)
Reviewed by Sam Weinig.

Patch the width/height/x/y calls in layoutBlock() to be their logical equivalents instead.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::layoutBlock):

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

WebCore/ChangeLog
WebCore/rendering/RenderBlock.cpp

index 555750a..569cff9 100644 (file)
@@ -2,6 +2,17 @@
 
         Reviewed by Sam Weinig.
 
+        https://bugs.webkit.org/show_bug.cgi?id=46659
+
+        Patch the width/height/x/y calls in layoutBlock() to be their logical equivalents instead.
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::layoutBlock):
+
+2010-09-27  David Hyatt  <hyatt@apple.com>
+
+        Reviewed by Sam Weinig.
+
         https://bugs.webkit.org/show_bug.cgi?id=46649, fix failing layout tests.
 
         The implementation of setting the before/after margins was wrong and poking the wrong margin values.
index 299ab2d..c1ee2ea 100644 (file)
@@ -1129,12 +1129,12 @@ void RenderBlock::layoutBlock(bool relayoutChildren, int pageHeight)
 
     m_overflow.clear();
 
-    if (oldWidth != width() || oldColumnWidth != desiredColumnWidth())
+    if (oldWidth != logicalWidth() || oldColumnWidth != desiredColumnWidth())
         relayoutChildren = true;
 
     clearFloats();
 
-    int previousHeight = height();
+    int previousHeight = logicalHeight();
     setLogicalHeight(0);
     bool hasSpecifiedPageHeight = false;
     ColumnInfo* colInfo = columnInfo();
@@ -1143,7 +1143,7 @@ void RenderBlock::layoutBlock(bool relayoutChildren, int pageHeight)
             // We need to go ahead and set our explicit page height if one exists, so that we can
             // avoid doing two layout passes.
             computeLogicalHeight();
-            int columnHeight = contentHeight();
+            int columnHeight = contentLogicalHeight();
             if (columnHeight > 0) {
                 pageHeight = columnHeight;
                 hasSpecifiedPageHeight = true;
@@ -1207,30 +1207,31 @@ void RenderBlock::layoutBlock(bool relayoutChildren, int pageHeight)
         layoutBlockChildren(relayoutChildren, maxFloatBottom);
 
     // Expand our intrinsic height to encompass floats.
-    int toAdd = borderBottom() + paddingBottom() + horizontalScrollbarHeight();
-    if (floatBottom() > (height() - toAdd) && expandsToEncloseOverhangingFloats())
+    int toAdd = borderAfter() + paddingAfter() + horizontalScrollbarHeight(); // FIXME: https://bugs.webkit.org/show_bug.cgi?id=46645, overflow and block-flow.
+    if (floatBottom() > (logicalHeight() - toAdd) && expandsToEncloseOverhangingFloats())
         setLogicalHeight(floatBottom() + toAdd);
     
     if (layoutColumns(hasSpecifiedPageHeight, pageHeight, statePusher))
         return;
  
     // Calculate our new height.
-    int oldHeight = height();
+    int oldHeight = logicalHeight();
     computeLogicalHeight();
-    if (oldHeight != height()) {
-        if (oldHeight > height() && maxFloatBottom > height() && !childrenInline()) {
+    int newHeight = logicalHeight();
+    if (oldHeight != newHeight) {
+        if (oldHeight > newHeight && maxFloatBottom > newHeight && !childrenInline()) {
             // One of our children's floats may have become an overhanging float for us. We need to look for it.
             for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
                 if (child->isBlockFlow() && !child->isFloatingOrPositioned()) {
                     RenderBlock* block = toRenderBlock(child);
-                    if (block->floatBottom() + block->y() > height())
+                    if (block->floatBottom() + block->logicalTop() > newHeight)
                         addOverhangingFloats(block, -block->x(), -block->y(), false);
                 }
             }
         }
     }
 
-    if (previousHeight != height())
+    if (previousHeight != newHeight)
         relayoutChildren = true;
 
     // Add overflow from children (unless we're multi-column, since in that case all our child overflow is clipped anyway).