Fix min-height so that when it resolves to auto it does not use the box's intrinsic...
authorhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Apr 2005 20:57:04 +0000 (20:57 +0000)
committerhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Apr 2005 20:57:04 +0000 (20:57 +0000)
        * khtml/rendering/render_box.cpp:
        (RenderBox::calcHeight):
        (RenderBox::calcHeightUsing):

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

WebCore/ChangeLog-2005-08-23
WebCore/khtml/rendering/render_box.cpp

index 569ddc0dac166e84b92d997b7ba7e3edbb07f39a..d78ed7453c67de6db97364eabc326c38c12e225e 100644 (file)
@@ -1,3 +1,11 @@
+2005-04-18  David Hyatt  <hyatt@apple.com>
+
+       Fix min-height so that when it resolves to auto it does not use the box's intrinsic height.
+       
+        * khtml/rendering/render_box.cpp:
+        (RenderBox::calcHeight):
+        (RenderBox::calcHeightUsing):
+
 2005-04-18  David Hyatt  <hyatt@apple.com>
 
         Back out fix for 4032346, since it is causing garbled image content on many sites.
index a2fa0b4f2cf0a83e68aeee91c71a95742e376585..8f9468b5e6ff85c13846e937b515ad84d8445c59 100644 (file)
@@ -988,8 +988,12 @@ void RenderBox::calcHeight()
         int height;
         if (checkMinMaxHeight) {
             height = calcHeightUsing(style()->height());
-            int minH = calcHeightUsing(style()->minHeight());
+            if (height == -1)
+                height = m_height;
+            int minH = calcHeightUsing(style()->minHeight()); // Leave as -1 if unset.
             int maxH = style()->maxHeight().value == UNDEFINED ? height : calcHeightUsing(style()->maxHeight());
+            if (maxH == -1)
+                maxH = height;
             height = kMin(maxH, height);
             height = kMax(minH, height);
         }
@@ -1026,8 +1030,8 @@ void RenderBox::calcHeight()
 
 int RenderBox::calcHeightUsing(const Length& h)
 {
+    int height = -1;
     if (!h.isVariable()) {
-        int height = -1;
         if (h.isFixed())
             height = h.value;
         else if (h.isPercent())
@@ -1037,7 +1041,7 @@ int RenderBox::calcHeightUsing(const Length& h)
             return height;
         }
     }
-    return m_height;
+    return height;
 }
 
 int RenderBox::calcPercentageHeight(const Length& height)