Fix the six pixel gap between rows nine and ten of the Acid2 test. Make sure that...
authorhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Apr 2005 10:53:59 +0000 (10:53 +0000)
committerhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Apr 2005 10:53:59 +0000 (10:53 +0000)
resolve to auto are properly treated as though they have auto height by the self-collapsing block check (as per
section 8.3.1, paragraph 7 of the CSS2.1 spec).

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::isSelfCollapsingBlock):

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

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

index 54187c9086f2dc6a408cc15f47528b9ccaa9b7ad..176fd013172fbfe11e3e3508bd0a519dac44343f 100644 (file)
@@ -1,3 +1,12 @@
+2005-04-15  David Hyatt  <hyatt@apple.com>
+
+       Fix the six pixel gap between rows nine and ten of the Acid2 test.  Make sure that percentage heights that
+       resolve to auto are properly treated as though they have auto height by the self-collapsing block check (as per
+       section 8.3.1, paragraph 7 of the CSS2.1 spec).
+       
+        * khtml/rendering/render_block.cpp:
+        (khtml::RenderBlock::isSelfCollapsingBlock):
+
 2005-04-15  David Hyatt  <hyatt@apple.com>
 
        The Acid2 test and the reference rendering both make use of overflow:hidden on the <html> element.  Turns out
index 5753369a00e744744cdd389068c917e488daea86..41ceccd0874eb646ce5bb9cdbd3684c8585c1fc5 100644 (file)
@@ -386,10 +386,18 @@ bool RenderBlock::isSelfCollapsingBlock() const
         style()->marginTopCollapse() == MSEPARATE || style()->marginBottomCollapse() == MSEPARATE)
         return false;
 
+    bool hasAutoHeight = style()->height().isVariable();
+    if (style()->height().isPercent() && !style()->htmlHacks()) {
+        hasAutoHeight = true;
+        for (RenderBlock* cb = containingBlock(); !cb->isCanvas(); cb = cb->containingBlock()) {
+            if (cb->style()->height().isFixed() || cb->isTableCell())
+                hasAutoHeight = false;
+        }
+    }
+
     // If the height is 0 or auto, then whether or not we are a self-collapsing block depends
     // on whether we have content that is all self-collapsing or not.
-    if (style()->height().isVariable() ||
-        (style()->height().isFixed() && style()->height().value == 0)) {
+    if (hasAutoHeight || ((style()->height().isFixed() || style()->height().isPercent()) && style()->height().value == 0)) {
         // If the block has inline children, see if we generated any line boxes.  If we have any
         // line boxes, then we can't be self-collapsing, since we have content.
         if (childrenInline())