Title: [199153] trunk
Revision
199153
Author
[email protected]
Date
2016-04-07 03:23:53 -0700 (Thu, 07 Apr 2016)

Log Message

[css-grid] Content box incorrectly used as non-auto min-height
https://bugs.webkit.org/show_bug.cgi?id=155946

Reviewed by Antti Koivisto.

Source/WebCore:

When computing the minimum height value of grid items with
non-auto min-height we used to return the size of the content
box meaning that borders and paddings were incorrectly
ignored.

Note that we're also ignoring margins, but as that is a
problem also for widths it'll be fixed in a follow up patch.

Test: fast/css-grid-layout/min-height-border-box.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::minSizeForChild):

LayoutTests:

* fast/css-grid-layout/min-height-border-box-expected.txt: Added.
* fast/css-grid-layout/min-height-border-box.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (199152 => 199153)


--- trunk/LayoutTests/ChangeLog	2016-04-07 10:21:25 UTC (rev 199152)
+++ trunk/LayoutTests/ChangeLog	2016-04-07 10:23:53 UTC (rev 199153)
@@ -1,3 +1,13 @@
+2016-04-07  Sergio Villar Senin  <[email protected]>
+
+        [css-grid] Content box incorrectly used as non-auto min-height
+        https://bugs.webkit.org/show_bug.cgi?id=155946
+
+        Reviewed by Antti Koivisto.
+
+        * fast/css-grid-layout/min-height-border-box-expected.txt: Added.
+        * fast/css-grid-layout/min-height-border-box.html: Added.
+
 2016-04-07  Antti Koivisto  <[email protected]>
 
         Reverting previous due to bad LayoutTest ChangeLog.

Added: trunk/LayoutTests/fast/css-grid-layout/min-height-border-box-expected.txt (0 => 199153)


--- trunk/LayoutTests/fast/css-grid-layout/min-height-border-box-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/min-height-border-box-expected.txt	2016-04-07 10:23:53 UTC (rev 199153)
@@ -0,0 +1,42 @@
+min-height: auto. grid height: auto
+
+XXXX
+PASS
+XXX
+PASS
+min-height: 0px. grid height: auto
+
+XXXX
+PASS
+XXX
+PASS
+NO STRETCH min-height: 0px. grid height: auto
+
+XXXX
+PASS
+XXX
+PASS
+min-height: 0px. grid height: 15px
+
+XXXX
+PASS
+XXX
+PASS
+NO STRETCH min-height: 0px. grid height: 15px
+
+XXXX
+PASS
+XXX
+PASS
+min-height: 30px. grid height: auto
+
+XXXX
+PASS
+XXX
+PASS
+NO STRETCH min-height: 30px. grid height: auto
+
+XXXX
+PASS
+XXX
+PASS

Added: trunk/LayoutTests/fast/css-grid-layout/min-height-border-box.html (0 => 199153)


--- trunk/LayoutTests/fast/css-grid-layout/min-height-border-box.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/min-height-border-box.html	2016-04-07 10:23:53 UTC (rev 199153)
@@ -0,0 +1,120 @@
+<!DOCTYPE html>
+<link href="" rel="stylesheet">
+<link href="" rel="stylesheet">
+<style>
+.grid {
+    border: 5px solid magenta;
+    margin-bottom: 25px;
+    -webkit-grid-template-rows: minmax(auto, 0px);
+}
+
+.item {
+    font: 25px/1 Ahem;
+}
+
+.container { width: 150px; }
+.borderPadding {
+    border-width: 2px 3px 5px 9px;
+    border-color: blue;
+    border-style: solid;
+    padding: 4px 9px 12px 20px;
+}
+
+</style>
+
+<script src=""
+
+<body _onload_="checkLayout('.grid')">
+
+<h3>min-height: auto. grid height: auto</h3>
+<div class="container">
+    <div class="grid" data-expected-width="150" data-expected-height="35">
+        <div class="item" data-expected-width="140" data-expected-height="25">XXXX</div>
+    </div>
+</div>
+
+<div class="container">
+    <div class="grid" data-expected-width="150" data-expected-height="58">
+        <div class="item borderPadding" data-expected-width="140" data-expected-height="48">XXX</div>
+    </div>
+</div>
+
+<h3>min-height: 0px. grid height: auto</h3>
+<div class="container">
+    <div class="grid" data-expected-width="150" data-expected-height="10">
+        <div class="item" style="min-height: 0px;" data-expected-width="140" data-expected-height="0">XXXX</div>
+    </div>
+</div>
+
+<div class="container">
+    <div class="grid" data-expected-width="150" data-expected-height="33">
+        <div class="item borderPadding" style="min-height: 0px;" data-expected-width="140" data-expected-height="23">XXX</div>
+    </div>
+</div>
+
+<h3>NO STRETCH min-height: 0px. grid height: auto</h3>
+<div class="container">
+    <div class="grid" data-expected-width="150" data-expected-height="10">
+        <div class="item alignSelfStart" style="min-height: 0px;" data-expected-width="140" data-expected-height="25">XXXX</div>
+    </div>
+</div>
+
+<div class="container">
+    <div class="grid" data-expected-width="150" data-expected-height="33">
+        <div class="item alignSelfStart borderPadding" style="min-height: 0px;" data-expected-width="140" data-expected-height="48">XXX</div>
+    </div>
+</div>
+
+<h3>min-height: 0px. grid height: 15px</h3>
+<div class="container">
+    <div class="grid" style="height: 15px;" data-expected-width="150" data-expected-height="25">
+        <div class="item" style="min-height: 0px;" data-expected-width="140" data-expected-height="0">XXXX</div>
+    </div>
+</div>
+
+<div class="container">
+    <div class="grid" style="height: 15px;" data-expected-width="150" data-expected-height="25">
+        <div class="item borderPadding" style="min-height: 0px;" data-expected-width="140" data-expected-height="23">XXX</div>
+    </div>
+</div>
+
+<h3>NO STRETCH min-height: 0px. grid height: 15px</h3>
+<div class="container">
+    <div class="grid" style="height: 15px;" data-expected-width="150" data-expected-height="25">
+        <div class="item alignSelfStart" style="min-height: 0px;" data-expected-width="140" data-expected-height="25">XXXX</div>
+    </div>
+</div>
+
+<div class="container">
+    <div class="grid" style="height: 15px;" data-expected-width="150" data-expected-height="25">
+        <div class="item alignSelfStart borderPadding" style="min-height: 0px;" data-expected-width="140" data-expected-height="48">XXX</div>
+    </div>
+</div>
+
+<h3>min-height: 30px. grid height: auto</h3>
+<div class="container">
+    <div class="grid" data-expected-width="150" data-expected-height="40">
+        <div class="item" style="min-height: 30px;" data-expected-width="140" data-expected-height="30">XXXX</div>
+    </div>
+</div>
+
+<div class="container">
+    <div class="grid" data-expected-width="150" data-expected-height="63">
+        <div class="item borderPadding" style="min-height: 30px;" data-expected-width="140" data-expected-height="53">XXX</div>
+    </div>
+</div>
+
+<h3>NO STRETCH min-height: 30px. grid height: auto</h3>
+<div class="container">
+    <div class="grid" data-expected-width="150" data-expected-height="40">
+        <div class="item alignSelfStart" style="min-height: 30px;" data-expected-width="140" data-expected-height="30">XXXX</div>
+    </div>
+</div>
+
+<div class="container">
+    <div class="grid" data-expected-width="150" data-expected-height="63">
+        <div class="item alignSelfStart borderPadding" style="min-height: 30px;" data-expected-width="140" data-expected-height="53">XXX</div>
+    </div>
+</div>
+
+</body>

Modified: trunk/Source/WebCore/ChangeLog (199152 => 199153)


--- trunk/Source/WebCore/ChangeLog	2016-04-07 10:21:25 UTC (rev 199152)
+++ trunk/Source/WebCore/ChangeLog	2016-04-07 10:23:53 UTC (rev 199153)
@@ -1,3 +1,23 @@
+2016-04-07  Sergio Villar Senin  <[email protected]>
+
+        [css-grid] Content box incorrectly used as non-auto min-height
+        https://bugs.webkit.org/show_bug.cgi?id=155946
+
+        Reviewed by Antti Koivisto.
+
+        When computing the minimum height value of grid items with
+        non-auto min-height we used to return the size of the content
+        box meaning that borders and paddings were incorrectly
+        ignored.
+
+        Note that we're also ignoring margins, but as that is a
+        problem also for widths it'll be fixed in a follow up patch.
+
+        Test: fast/css-grid-layout/min-height-border-box.html
+
+        * rendering/RenderGrid.cpp:
+        (WebCore::RenderGrid::minSizeForChild):
+
 2016-04-07  Antti Koivisto  <[email protected]>
 
         Reverting previous due to bad LayoutTest ChangeLog.

Modified: trunk/Source/WebCore/rendering/RenderGrid.cpp (199152 => 199153)


--- trunk/Source/WebCore/rendering/RenderGrid.cpp	2016-04-07 10:21:25 UTC (rev 199152)
+++ trunk/Source/WebCore/rendering/RenderGrid.cpp	2016-04-07 10:23:53 UTC (rev 199153)
@@ -750,7 +750,7 @@
     if (isRowAxis)
         return child.computeLogicalWidthInRegionUsing(MinSize, childMinSize, contentLogicalWidth(), *this, nullptr);
 
-    return child.computeContentAndScrollbarLogicalHeightUsing(MinSize, childMinSize, child.logicalHeight()).valueOr(0);
+    return child.computeLogicalHeightUsing(MinSize, childMinSize, Nullopt).valueOr(0);
 }
 
 LayoutUnit RenderGrid::minContentForChild(RenderBox& child, GridTrackSizingDirection direction, Vector<GridTrack>& columnTracks)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to