[CSS Grid Layout] LayoutBox::hasDefiniteLogicalHeight() should consider abspos boxes...
authorrego@igalia.com <rego@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Apr 2015 05:39:56 +0000 (05:39 +0000)
committerrego@igalia.com <rego@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Apr 2015 05:39:56 +0000 (05:39 +0000)
https://bugs.webkit.org/show_bug.cgi?id=144144

Reviewed by Darin Adler.

Source/WebCore:

Change order in hasDefiniteLogicalHeight() ifs to consider definite
absolutely positioned elements.

Test: fast/css-grid-layout/percent-track-breadths-regarding-container-size.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::hasDefiniteLogicalHeight):

LayoutTests:

Add new test case to check absolutely positioned elements.

* fast/css-grid-layout/percent-track-breadths-regarding-container-size-expected.txt:
* fast/css-grid-layout/percent-track-breadths-regarding-container-size.html:

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

LayoutTests/ChangeLog
LayoutTests/fast/css-grid-layout/percent-track-breadths-regarding-container-size-expected.txt
LayoutTests/fast/css-grid-layout/percent-track-breadths-regarding-container-size.html
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBox.cpp

index 4da9251..bd249d8 100644 (file)
@@ -1,3 +1,15 @@
+2015-04-26  Manuel Rego Casasnovas  <rego@igalia.com>
+
+        [CSS Grid Layout] LayoutBox::hasDefiniteLogicalHeight() should consider abspos boxes as definite
+        https://bugs.webkit.org/show_bug.cgi?id=144144
+
+        Reviewed by Darin Adler.
+
+        Add new test case to check absolutely positioned elements.
+
+        * fast/css-grid-layout/percent-track-breadths-regarding-container-size-expected.txt:
+        * fast/css-grid-layout/percent-track-breadths-regarding-container-size.html:
+
 2015-04-26  Ryosuke Niwa  <rniwa@webkit.org>
 
         Class body ending with a semicolon throws a SyntaxError
index 9ebf457..4df7a65 100644 (file)
     height: 50%;
 }
 
+.absolutelyPositioned {
+    position: absolute;
+}
+
 .indefiniteSize {
     width: -webkit-fit-content;
     height: auto;
     </div>
 
     <div class="indefiniteSize">
+        <div class="grid absolutelyPositioned">
+            <div class="firstRowFirstColumn sizedToGridArea" data-expected-width="0" data-expected-height="0">XX</div>
+            <div class="firstRowSecondColumn sizedToGridArea" data-expected-width="0" data-expected-height="0">XXXXX</div>
+            <div class="firstRowThirdColumn sizedToGridArea" data-expected-width="0" data-expected-height="0">XXX</div>
+        </div>
+    </div>
+
+    <div class="unconstrainedContainer">
+        <div class="grid absolutelyPositioned">
+            <div class="firstRowFirstColumn sizedToGridArea" data-expected-width="0" data-expected-height="0">XX</div>
+            <div class="firstRowSecondColumn sizedToGridArea" data-expected-width="0" data-expected-height="0">XXXXX</div>
+            <div class="firstRowThirdColumn sizedToGridArea" data-expected-width="0" data-expected-height="0">XXX</div>
+        </div>
+    </div>
+
+    <div class="indefiniteSize">
         <div class="grid indefiniteSize">
             <div class="firstRowFirstColumn sizedToGridArea" data-expected-width="20" data-expected-height="10">XX</div>
             <div class="firstRowSecondColumn sizedToGridArea" data-expected-width="50" data-expected-height="10">XXXXX</div>
index 3dbc780..3913edd 100644 (file)
@@ -1,3 +1,18 @@
+2015-04-26  Manuel Rego Casasnovas  <rego@igalia.com>
+
+        [CSS Grid Layout] LayoutBox::hasDefiniteLogicalHeight() should consider abspos boxes as definite
+        https://bugs.webkit.org/show_bug.cgi?id=144144
+
+        Reviewed by Darin Adler.
+
+        Change order in hasDefiniteLogicalHeight() ifs to consider definite
+        absolutely positioned elements.
+
+        Test: fast/css-grid-layout/percent-track-breadths-regarding-container-size.html
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::hasDefiniteLogicalHeight):
+
 2015-04-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
 
         SVGFilterBuilder should drive the builtin sourceAlpha from the passed sourceGraphic
index fa0a7b6..d474c1b 100644 (file)
@@ -4542,8 +4542,6 @@ bool RenderBox::percentageLogicalHeightIsResolvableFromBlock(const RenderBlock*
 bool RenderBox::hasDefiniteLogicalHeight() const
 {
     const Length& logicalHeight = style().logicalHeight();
-    if (logicalHeight.isIntrinsicOrAuto())
-        return false;
     if (logicalHeight.isFixed())
         return true;
     // The size of the containing block of an absolutely positioned element is always definite with respect to that
@@ -4554,6 +4552,8 @@ bool RenderBox::hasDefiniteLogicalHeight() const
     if (hasOverrideContainingBlockLogicalHeight())
         return overrideContainingBlockContentLogicalHeight() != -1;
 #endif
+    if (logicalHeight.isIntrinsicOrAuto())
+        return false;
 
     return percentageLogicalHeightIsResolvable(this);
 }