Make sure to skip the RenderMultiColumnFlowThread when resolving percentage heights...
authorhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Apr 2014 17:36:56 +0000 (17:36 +0000)
committerhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Apr 2014 17:36:56 +0000 (17:36 +0000)
containing blocks. The flow thread's auto height should not interfere if a fixed height is specified on
an ancestor.

https://bugs.webkit.org/show_bug.cgi?id=131741

Reviewed by Simon Fraser.

Source/WebCore:
Added fast/multicol/percent-height.html.

* rendering/RenderBox.cpp:
(WebCore::RenderBox::skipContainingBlockForPercentHeightCalculation):
Add an isInFlowRenderFlowThread check so that we skip those blocks and don't consider them at all
when resolving percentage heights.

LayoutTests:
* fast/multicol/percent-height-expected.html: Added.
* fast/multicol/percent-height.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/multicol/percent-height-expected.html [new file with mode: 0644]
LayoutTests/fast/multicol/percent-height.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBox.cpp

index 1ace563..60885a7 100644 (file)
@@ -1,3 +1,16 @@
+2014-04-16  David Hyatt  <hyatt@apple.com>
+
+        Make sure to skip the RenderMultiColumnFlowThread when resolving percentage heights inside columns against
+        containing blocks. The flow thread's auto height should not interfere if a fixed height is specified on
+        an ancestor.
+
+        https://bugs.webkit.org/show_bug.cgi?id=131741
+
+        Reviewed by Simon Fraser.
+
+        * fast/multicol/percent-height-expected.html: Added.
+        * fast/multicol/percent-height.html: Added.
+
 2014-04-16  Martin Hodovan  <mhodovan@inf.u-szeged.hu>
 
         ASSERTION FAILED: x2 >= x1 in WebCore::RenderObject::drawLineForBoxSide
diff --git a/LayoutTests/fast/multicol/percent-height-expected.html b/LayoutTests/fast/multicol/percent-height-expected.html
new file mode 100644 (file)
index 0000000..7404e22
--- /dev/null
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+      <head>
+            <title>Resolving percent height inside multicol</title>
+        </head>
+      <body>
+            <p>There should be a blue square below.</p>
+            <div style="width:99px; height:99px; background:blue;"></div>
+        </body>
+  </html>
diff --git a/LayoutTests/fast/multicol/percent-height.html b/LayoutTests/fast/multicol/percent-height.html
new file mode 100644 (file)
index 0000000..fd7c62f
--- /dev/null
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+      <head>
+            <title>Resolving percent height inside multicol</title>
+            <script>
+                  if (window.internals)
+                      internals.settings.setRegionBasedColumnsEnabled(true);
+              </script>
+        </head>
+      <body>
+            <p>There should be a blue square below.</p>
+            <div style="-webkit-columns:3; columns:3; -webkit-column-gap:0; column-gap:0; width:99px; height:99px;">
+                  <div style="height:300%; background:blue;"></div>
+              </div>
+        </body>
+  </html>
index 446259a..d617319 100644 (file)
@@ -1,3 +1,20 @@
+2014-04-16  David Hyatt  <hyatt@apple.com>
+
+        Make sure to skip the RenderMultiColumnFlowThread when resolving percentage heights inside columns against
+        containing blocks. The flow thread's auto height should not interfere if a fixed height is specified on
+        an ancestor.
+
+        https://bugs.webkit.org/show_bug.cgi?id=131741
+
+        Reviewed by Simon Fraser.
+
+        Added fast/multicol/percent-height.html.
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::skipContainingBlockForPercentHeightCalculation):
+        Add an isInFlowRenderFlowThread check so that we skip those blocks and don't consider them at all
+        when resolving percentage heights.
+
 2014-04-16  Daewoong Jang  <daewoong.jang@navercorp.com>
 
         [WinCairo][cURL] Build fix for WinCairo build with USE(CURL).
index 4bf4891..4b4c27e 100644 (file)
@@ -2713,6 +2713,11 @@ LayoutUnit RenderBox::computeContentAndScrollbarLogicalHeightUsing(const Length&
 
 bool RenderBox::skipContainingBlockForPercentHeightCalculation(const RenderBox* containingBlock) const
 {
+    // Flow threads for multicol or paged overflow should be skipped. They are invisible to the DOM,
+    // and percent heights of children should be resolved against the multicol or paged container.
+    if (containingBlock->isInFlowRenderFlowThread())
+        return true;
+
     // For quirks mode and anonymous blocks, we skip auto-height containingBlocks when computing percentages.
     // For standards mode, we treat the percentage as auto if it has an auto-height containing block.
     if (!document().inQuirksMode() && !containingBlock->isAnonymousBlock())