https://bugs.webkit.org/show_bug.cgi?id=47204
authorhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Oct 2010 20:32:06 +0000 (20:32 +0000)
committerhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Oct 2010 20:32:06 +0000 (20:32 +0000)
Reviewed by Sam Weinig.

Make isSelfCollapsingBlock use logical height instead of height in all its checks.

Added fast/blockflow/self-collapsing-block.html

WebCore:

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

LayoutTests:

* fast/blockflow/self-collapsing-block.html: Added.
* platform/mac/fast/blockflow/self-collapsing-block-expected.checksum: Added.
* platform/mac/fast/blockflow/self-collapsing-block-expected.png: Added.
* platform/mac/fast/blockflow/self-collapsing-block-expected.txt: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/blockflow/self-collapsing-block.html [new file with mode: 0644]
LayoutTests/platform/mac/fast/blockflow/self-collapsing-block-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/fast/blockflow/self-collapsing-block-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/blockflow/self-collapsing-block-expected.txt [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/RenderBlock.cpp

index 4032476..28abf79 100644 (file)
@@ -1,3 +1,18 @@
+2010-10-05  David Hyatt  <hyatt@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        https://bugs.webkit.org/show_bug.cgi?id=47204
+        
+        Make isSelfCollapsingBlock use logical height instead of height in all its checks.
+
+        Added fast/blockflow/self-collapsing-block.html
+
+        * fast/blockflow/self-collapsing-block.html: Added.
+        * platform/mac/fast/blockflow/self-collapsing-block-expected.checksum: Added.
+        * platform/mac/fast/blockflow/self-collapsing-block-expected.png: Added.
+        * platform/mac/fast/blockflow/self-collapsing-block-expected.txt: Added.
+
 2010-10-05  Daniel Cheng  <dcheng@chromium.org>
 
         Reviewed by Tony Chang.
diff --git a/LayoutTests/fast/blockflow/self-collapsing-block.html b/LayoutTests/fast/blockflow/self-collapsing-block.html
new file mode 100644 (file)
index 0000000..aefaea5
--- /dev/null
@@ -0,0 +1,8 @@
+<!doctype html>
+<html>
+<body style="-webkit-writing-mode:tb-lr; writing-mode:tb-lr">
+<div style="width:100px;background-color:green"></div>
+<div style="height:100px;margin-left:100px;margin-right:100px"></div>
+<div style="width:100px;background-color:green"></div>
+</body>
+</html>
diff --git a/LayoutTests/platform/mac/fast/blockflow/self-collapsing-block-expected.checksum b/LayoutTests/platform/mac/fast/blockflow/self-collapsing-block-expected.checksum
new file mode 100644 (file)
index 0000000..e5c3dd0
--- /dev/null
@@ -0,0 +1 @@
+b1340d2fbb19775b259b8d0e308d003e
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/blockflow/self-collapsing-block-expected.png b/LayoutTests/platform/mac/fast/blockflow/self-collapsing-block-expected.png
new file mode 100644 (file)
index 0000000..bbcfc2f
Binary files /dev/null and b/LayoutTests/platform/mac/fast/blockflow/self-collapsing-block-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/blockflow/self-collapsing-block-expected.txt b/LayoutTests/platform/mac/fast/blockflow/self-collapsing-block-expected.txt
new file mode 100644 (file)
index 0000000..e0945a5
--- /dev/null
@@ -0,0 +1,8 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 300x584
+      RenderBlock {DIV} at (0,0) size 100x584 [bgcolor=#008000]
+      RenderBlock {DIV} at (200,0) size 0x100
+      RenderBlock {DIV} at (200,0) size 100x584 [bgcolor=#008000]
index 51dfb61..9ca100c 100644 (file)
@@ -1,3 +1,16 @@
+2010-10-05  David Hyatt  <hyatt@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        https://bugs.webkit.org/show_bug.cgi?id=47204
+        
+        Make isSelfCollapsingBlock use logical height instead of height in all its checks.
+
+        Added fast/blockflow/self-collapsing-block.html
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::isSelfCollapsingBlock):
+
 2010-10-05  Eric Uhrhane  <ericu@chromium.org>
 
         Reviewed by David Levin.
index 5c1111f..ac1b513 100644 (file)
@@ -1019,24 +1019,25 @@ bool RenderBlock::isSelfCollapsingBlock() const
     // (c) have border/padding,
     // (d) have a min-height
     // (e) have specified that one of our margins can't collapse using a CSS extension
-    if (height() > 0
-        || isTable() || borderAndPaddingHeight()
-        || style()->minHeight().isPositive()
+    if (logicalHeight() > 0
+        || isTable() || borderAndPaddingLogicalHeight()
+        || style()->logicalMinHeight().isPositive()
         || style()->marginBeforeCollapse() == MSEPARATE || style()->marginAfterCollapse() == MSEPARATE)
         return false;
 
-    bool hasAutoHeight = style()->height().isAuto();
-    if (style()->height().isPercent() && !document()->inQuirksMode()) {
+    Length logicalHeightLength = style()->logicalHeight();
+    bool hasAutoHeight = logicalHeightLength.isAuto();
+    if (logicalHeightLength.isPercent() && !document()->inQuirksMode()) {
         hasAutoHeight = true;
         for (RenderBlock* cb = containingBlock(); !cb->isRenderView(); cb = cb->containingBlock()) {
-            if (cb->style()->height().isFixed() || cb->isTableCell())
+            if (cb->style()->logicalHeight().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 (hasAutoHeight || ((style()->height().isFixed() || style()->height().isPercent()) && style()->height().isZero())) {
+    if (hasAutoHeight || ((logicalHeightLength.isFixed() || logicalHeightLength.isPercent()) && logicalHeightLength.isZero())) {
         // 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())