Fix for bug 5580, slashdot regression with percentage height
authorhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Nov 2005 00:49:21 +0000 (00:49 +0000)
committerhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Nov 2005 00:49:21 +0000 (00:49 +0000)
blocks.

        Reviewed by darin

Added fast/block/basic/021.html

        * khtml/rendering/render_box.cpp:
        (RenderBox::calcPercentageHeight):

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

WebCore/ChangeLog-2005-12-19
WebCore/khtml/rendering/render_box.cpp

index cf8e0d7..3aaad46 100644 (file)
@@ -1,3 +1,15 @@
+2005-11-01  David Hyatt  <hyatt@apple.com>
+
+       Fix for bug 5580, slashdot regression with percentage height
+       blocks.
+       
+        Reviewed by darin
+
+       Added fast/block/basic/021.html
+       
+        * khtml/rendering/render_box.cpp:
+        (RenderBox::calcPercentageHeight):
+
 2005-11-01  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by harrison
index 58345cf..21bc0e8 100644 (file)
@@ -1198,9 +1198,12 @@ int RenderBox::calcPercentageHeight(const Length& height)
     // height.
     else if (cb->style()->height().isFixed())
         result = cb->calcContentBoxHeight(cb->style()->height().value);
-    else if (cb->style()->height().isPercent())
+    else if (cb->style()->height().isPercent()) {
         // We need to recur and compute the percentage height for our containing block.
-        result = cb->calcContentBoxHeight(cb->calcPercentageHeight(cb->style()->height()));
+        result = cb->calcPercentageHeight(cb->style()->height());
+        if (result != -1)
+            result = cb->calcContentBoxHeight(result);
+    }
     else if (cb->isCanvas() || (cb->isBody() && style()->htmlHacks())) {
         // Don't allow this to affect the block' m_height member variable, since this
         // can get called while the block is still laying out its kids.