No subject


Tue Jan 27 15:54:36 PST 2015


grid items is auto, meaning that in general, grid items won't
shrink bellow their content.

The change is not exactly the same as the one in Blink because
this one takes into account vertical writting modes, something
that was not well handled in the original one.

Tests: fast/css-grid-layout/min-width-height-auto-overflow.html
       fast/css-grid-layout/min-width-height-auto.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeLogicalWidthInRegion):
(WebCore::RenderBox::computeLogicalHeight):

LayoutTests:

Apart from the original tests this includes some extra ones to
verify that we behave correctly with vertical writing modes.

* fast/css-grid-layout/min-width-height-auto-expected.txt: Added.
* fast/css-grid-layout/min-width-height-auto-overflow-expected.html: Added.
* fast/css-grid-layout/min-width-height-auto-overflow.html: Added.
* fast/css-grid-layout/min-width-height-auto.html: Added.
* fast/css/auto-min-size-expected.txt:
* fast/css/auto-min-size.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastcssautominsizeexpectedtxt">trunk/LayoutTests/fast/css/auto-min-size-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssautominsizehtml">trunk/LayoutTests/fast/css/auto-min-size.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBoxcpp">trunk/Source/WebCore/rendering/RenderBox.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcssgridlayoutminwidthheightautoexpectedtxt">trunk/LayoutTests/fast/css-grid-layout/min-width-height-auto-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutminwidthheightautooverflowexpectedhtml">trunk/LayoutTests/fast/css-grid-layout/min-width-height-auto-overflow-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutminwidthheightautooverflowhtml">trunk/LayoutTests/fast/css-grid-layout/min-width-height-auto-overflow.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutminwidthheightautohtml">trunk/LayoutTests/fast/css-grid-layout/min-width-height-auto.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (189707 => 189708)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog	2015-09-14 10:38:47 UTC (rev 189707)
+++ trunk/LayoutTests/ChangeLog	2015-09-14 10:40:55 UTC (rev 189708)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2015-09-09  Sergio Villar Senin  &lt;svillar at igalia.com&gt;
+
+        min-width/height should default to auto for grid items
+        https://bugs.webkit.org/show_bug.cgi?id=146021
+
+        Reviewed by Darin Adler.
+
+        Based on Blink's r194408, r194863 and r194887 by &lt;rego at igalia.com&gt;.
+
+        Apart from the original tests this includes some extra ones to
+        verify that we behave correctly with vertical writing modes.
+
+        * fast/css-grid-layout/min-width-height-auto-expected.txt: Added.
+        * fast/css-grid-layout/min-width-height-auto-overflow-expected.html: Added.
+        * fast/css-grid-layout/min-width-height-auto-overflow.html: Added.
+        * fast/css-grid-layout/min-width-height-auto.html: Added.
+        * fast/css/auto-min-size-expected.txt:
+        * fast/css/auto-min-size.html:
+
</ins><span class="cx"> 2015-09-14  Manuel Rego Casasnovas  &lt;rego at igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [css-grid] Percentage columns should remove scrollbar's width
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssautominsizeexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/auto-min-size-expected.txt (189707 => 189708)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/auto-min-size-expected.txt	2015-09-14 10:38:47 UTC (rev 189707)
+++ trunk/LayoutTests/fast/css/auto-min-size-expected.txt	2015-09-14 10:40:55 UTC (rev 189708)
</span><span class="lines">@@ -26,6 +26,20 @@
</span><span class="cx"> PASS getComputedStyle(flexitem).minHeight is &quot;auto&quot;
</span><span class="cx"> PASS flexitem.style.minHeight is &quot;0px&quot;
</span><span class="cx"> PASS getComputedStyle(flexitem)[&quot;min-height&quot;] is &quot;0px&quot;
</span><ins>+PASS griditem.style.minWidth is &quot;&quot;
+PASS getComputedStyle(griditem)[&quot;min-width&quot;] is &quot;auto&quot;
+PASS griditem.style.minWidth is &quot;auto&quot;
+PASS griditem.style.maxWidth is &quot;&quot;
+PASS getComputedStyle(griditem).minWidth is &quot;auto&quot;
+PASS griditem.style.minWidth is &quot;0px&quot;
+PASS getComputedStyle(griditem)[&quot;min-width&quot;] is &quot;0px&quot;
+PASS griditem.style.minHeight is &quot;&quot;
+PASS getComputedStyle(griditem)[&quot;min-height&quot;] is &quot;auto&quot;
+PASS griditem.style.minHeight is &quot;auto&quot;
+PASS griditem.style.maxHeight is &quot;&quot;
+PASS getComputedStyle(griditem).minHeight is &quot;auto&quot;
+PASS griditem.style.minHeight is &quot;0px&quot;
+PASS getComputedStyle(griditem)[&quot;min-height&quot;] is &quot;0px&quot;
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssautominsizehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/auto-min-size.html (189707 => 189708)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/auto-min-size.html	2015-09-14 10:38:47 UTC (rev 189707)
+++ trunk/LayoutTests/fast/css/auto-min-size.html	2015-09-14 10:40:55 UTC (rev 189708)
</span><span class="lines">@@ -2,6 +2,7 @@
</span><span class="cx"> &lt;script src='../../resources/js-test-pre.js'&gt;&lt;/script&gt;
</span><span class="cx"> &lt;div id=foo&gt;&lt;/div&gt;
</span><span class="cx"> &lt;div id=&quot;flexbox&quot; style=&quot;display: flex;&quot;&gt;&lt;div id=&quot;flexitem&quot;&gt;&lt;/div&gt;&lt;/div&gt;
</span><ins>+&lt;div id=&quot;grid&quot; style=&quot;display: -webkit-grid;&quot;&gt;&lt;div id=&quot;griditem&quot;&gt;&lt;/div&gt;&lt;/div&gt;
</ins><span class="cx"> &lt;script&gt;
</span><span class="cx"> div = document.getElementById('foo');
</span><span class="cx"> shouldBe('div.style.minWidth', '&quot;&quot;');
</span><span class="lines">@@ -56,5 +57,32 @@
</span><span class="cx"> flexitem.style.minHeight = 0;
</span><span class="cx"> shouldBe('flexitem.style.minHeight', '&quot;0px&quot;');
</span><span class="cx"> shouldBe('getComputedStyle(flexitem)[&quot;min-height&quot;]', '&quot;0px&quot;');
</span><ins>+
+var griditem = document.getElementById(&quot;griditem&quot;);
+shouldBe('griditem.style.minWidth', '&quot;&quot;');
+shouldBe('getComputedStyle(griditem)[&quot;min-width&quot;]', '&quot;auto&quot;');
+
+griditem.style.minWidth = 'auto';
+griditem.style.maxWidth = 'auto';
+shouldBe('griditem.style.minWidth', '&quot;auto&quot;');
+shouldBe('griditem.style.maxWidth', '&quot;&quot;');
+shouldBe('getComputedStyle(griditem).minWidth', '&quot;auto&quot;');
+
+griditem.style.minWidth = 0;
+shouldBe('griditem.style.minWidth', '&quot;0px&quot;');
+shouldBe('getComputedStyle(griditem)[&quot;min-width&quot;]', '&quot;0px&quot;');
+
+shouldBe('griditem.style.minHeight', '&quot;&quot;');
+shouldBe('getComputedStyle(griditem)[&quot;min-height&quot;]', '&quot;auto&quot;');
+
+griditem.style.minHeight = 'auto';
+griditem.style.maxHeight = 'auto';
+shouldBe('griditem.style.minHeight', '&quot;auto&quot;');
+shouldBe('griditem.style.maxHeight', '&quot;&quot;');
+shouldBe('getComputedStyle(griditem).minHeight', '&quot;auto&quot;');
+
+griditem.style.minHeight = 0;
+shouldBe('griditem.style.minHeight', '&quot;0px&quot;');
+shouldBe('getComputedStyle(griditem)[&quot;min-height&quot;]', '&quot;0px&quot;');
</ins><span class="cx"> &lt;/script&gt;
</span><span class="cx"> &lt;script src='../../resources/js-test-post.js'&gt;&lt;/script&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutminwidthheightautoexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-grid-layout/min-width-height-auto-expected.txt (0 => 189708)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/min-width-height-auto-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/min-width-height-auto-expected.txt	2015-09-14 10:40:55 UTC (rev 189708)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+This test checks min-width|height auto behavior for grids
+
+XXXX
+PASS
+XXXX
+PASS
+XXXX
+PASS
+XXXX
+PASS
+XXXX
+PASS
+XXXX
+PASS
+XXXX
+PASS
+XXXX
+PASS
</ins><span class="cx">Property changes on: trunk/LayoutTests/fast/css-grid-layout/min-width-height-auto-expected.txt
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestsfastcssgridlayoutminwidthheightautooverflowexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-grid-layout/min-width-height-auto-overflow-expected.html (0 => 189708)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/min-width-height-auto-overflow-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/min-width-height-auto-overflow-expected.html	2015-09-14 10:40:55 UTC (rev 189708)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;style&gt;
+.item {
+    height: 50px;
+    width: 50px;
+    margin: 50px;
+    font: 50px/1 Ahem;
+}
+
+.overflowVisible {
+    overflow: visible;
+}
+
+.overflowHidden {
+    overflow: hidden;
+}
+
+.overflowScroll {
+    overflow-y: scroll;
+}
+
+.overflowAuto {
+    overflow: auto;
+}
+&lt;/style&gt;
+
+&lt;p&gt;This test checks that min-width|height auto behavior for grid items only applies if overflow is visible.&lt;/p&gt;
+&lt;p&gt;The test passes if you see three 50x50 squares and one 100x100 square.&lt;/p&gt;
+
+&lt;div class=&quot;item overflowHidden&quot;&gt;XX&lt;br&gt;XX&lt;/div&gt;
+
+&lt;div class=&quot;item overflowScroll&quot;&gt;XX&lt;br&gt;XX&lt;/div&gt;
+
+&lt;div class=&quot;item overflowAuto&quot;&gt;XX&lt;br&gt;XX&lt;/div&gt;
+
+&lt;div class=&quot;item overflowVisible&quot;&gt;XX&lt;br&gt;XX&lt;/div&gt;
</ins><span class="cx">Property changes on: trunk/LayoutTests/fast/css-grid-layout/min-width-height-auto-overflow-expected.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestsfastcssgridlayoutminwidthheightautooverflowhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-grid-layout/min-width-height-auto-overflow.html (0 => 189708)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/min-width-height-auto-overflow.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/min-width-height-auto-overflow.html	2015-09-14 10:40:55 UTC (rev 189708)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;link href=&quot;resources/grid.css&quot; rel=&quot;stylesheet&quot;&gt;
+&lt;style&gt;
+.grid {
+    -webkit-grid-template-columns: 50px;
+    -webkit-grid-template-rows: 50px;
+    height: 50px;
+    width: 50px;
+    margin: 50px;
+}
+
+div.grid &gt; div { font: 50px/1 Ahem; }
+
+.overflowVisible { overflow: visible; }
+.overflowHidden { overflow: hidden; }
+.overflowScroll { overflow: scroll; }
+.overflowAuto { overflow: auto; }
+
+&lt;/style&gt;
+
+&lt;p&gt;This test checks that min-width|height auto behavior for grid items only applies if overflow is visible.&lt;/p&gt;
+&lt;p&gt;The test passes if you see three 50x50 squares and one 100x100 square.&lt;/p&gt;
+
+&lt;div class=&quot;grid&quot;&gt;
+    &lt;div class=&quot;overflowHidden&quot;&gt;XX&lt;br&gt;XX&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;grid&quot;&gt;
+    &lt;div class=&quot;overflowScroll&quot;&gt;XX&lt;br&gt;XX&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;grid&quot;&gt;
+    &lt;div class=&quot;overflowAuto&quot;&gt;XX&lt;br&gt;XX&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;grid&quot;&gt;
+    &lt;div class=&quot;overflowVisible&quot;&gt;XX&lt;br&gt;XX&lt;/div&gt;
+&lt;/div&gt;
</ins><span class="cx">Property changes on: trunk/LayoutTests/fast/css-grid-layout/min-width-height-auto-overflow.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestsfastcssgridlayoutminwidthheightautohtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-grid-layout/min-width-height-auto.html (0 => 189708)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/min-width-height-auto.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/min-width-height-auto.html	2015-09-14 10:40:55 UTC (rev 189708)
</span><span class="lines">@@ -0,0 +1,96 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;link href=&quot;resources/grid.css&quot; rel=&quot;stylesheet&quot;&gt;
+&lt;style&gt;
+.grid {
+    -webkit-grid-template-columns: 5px;
+    -webkit-grid-template-rows: 5px;
+}
+
+.container {
+    width: 200px;
+    height: 100px;
+}
+
+.ahem {
+    font: 25px/1 Ahem;
+}
+
+.minSmaller {
+    min-width: 10px;
+    min-height: 10px;
+}
+
+.minBigger {
+    min-width: 150px;
+    min-height: 75px;
+}
+
+.maxSmaller {
+    max-width: 10px;
+    max-height: 10px;
+}
+
+.maxBigger {
+    max-width: 150px;
+    max-height: 75px;
+}
+
+.minHeightSmaller { min-height: 12px; }
+.minWidthSmaller { min-width: 12px; }
+
+&lt;/style&gt;
+&lt;script src=&quot;../../resources/check-layout.js&quot;&gt;&lt;/script&gt;
+&lt;body onload=&quot;checkLayout('.grid')&quot;&gt;
+
+&lt;p&gt;This test checks min-width|height auto behavior for grids&lt;/p&gt;
+
+&lt;div class=&quot;container&quot;&gt;
+    &lt;div class=&quot;grid&quot;&gt;
+        &lt;div class=&quot;ahem&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;25&quot;&gt;XXXX&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container&quot;&gt;
+    &lt;div class=&quot;grid&quot;&gt;
+        &lt;div class=&quot;ahem minSmaller&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;XXXX&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container&quot;&gt;
+    &lt;div class=&quot;grid&quot;&gt;
+        &lt;div class=&quot;ahem minBigger&quot; data-expected-width=&quot;150&quot; data-expected-height=&quot;75&quot;&gt;XXXX&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container&quot;&gt;
+    &lt;div class=&quot;grid&quot;&gt;
+        &lt;div class=&quot;ahem maxSmaller&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;XXXX&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container&quot;&gt;
+    &lt;div class=&quot;grid&quot;&gt;
+        &lt;div class=&quot;ahem maxBigger&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;25&quot;&gt;XXXX&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;!-- Check that min-width min-height behavior is preserved when using vertical writing modes --&gt;
+&lt;div class=&quot;container&quot;&gt;
+    &lt;div class=&quot;grid verticalLR&quot;&gt;
+        &lt;div class=&quot;ahem&quot; data-expected-width=&quot;25&quot; data-expected-height=&quot;100&quot;&gt;XXXX&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container&quot;&gt;
+    &lt;div class=&quot;grid verticalLR&quot;&gt;
+        &lt;div class=&quot;ahem minHeightSmaller&quot; data-expected-width=&quot;25&quot; data-expected-height=&quot;12&quot;&gt;XXXX&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container&quot;&gt;
+    &lt;div class=&quot;grid verticalLR&quot;&gt;
+        &lt;div class=&quot;ahem minWidthSmaller&quot; data-expected-width=&quot;12&quot; data-expected-height=&quot;100&quot;&gt;XXXX&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;/body&gt;
</ins><span class="cx">Property changes on: trunk/LayoutTests/fast/css-grid-layout/min-width-height-auto.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (189707 => 189708)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog	2015-09-14 10:38:47 UTC (rev 189707)
+++ trunk/Source/WebCore/ChangeLog	2015-09-14 10:40:55 UTC (rev 189708)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2015-09-09  Sergio Villar Senin  &lt;svillar at igalia.com&gt;
+
+        min-width/height should default to auto for grid items
+        https://bugs.webkit.org/show_bug.cgi?id=146021
+
+        Reviewed by Darin Adler.
+
+        Based on Blink's r194408, r194863 and r194887 by &lt;rego at igalia.com&gt;.
+
+        From the spec (http://dev.w3.org/csswg/css-grid/#grid-items):
+        &quot;The auto value of min-width and min-height behaves on grid
+        items in the relevant axis analogously to its behavior on flex
+        items in the main axis.&quot;
+
+        From now on the default value for min-width and min-height for
+        grid items is auto, meaning that in general, grid items won't
+        shrink bellow their content.
+
+        The change is not exactly the same as the one in Blink because
+        this one takes into account vertical writting modes, something
+        that was not well handled in the original one.
+
+        Tests: fast/css-grid-layout/min-width-height-auto-overflow.html
+               fast/css-grid-layout/min-width-height-auto.html
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::computeLogicalWidthInRegion):
+        (WebCore::RenderBox::computeLogicalHeight):
+
</ins><span class="cx"> 2015-09-14  Manuel Rego Casasnovas  &lt;rego at igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [css-grid] Percentage columns should remove scrollbar's width
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (189707 => 189708)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBox.cpp	2015-09-14 10:38:47 UTC (rev 189707)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2015-09-14 10:40:55 UTC (rev 189708)
</span><span class="lines">@@ -2347,7 +2347,17 @@
</span><span class="cx">     RenderBlock* cb = containingBlock();
</span><span class="cx">     LayoutUnit containerLogicalWidth = std::max&lt;LayoutUnit&gt;(0, containingBlockLogicalWidthForContentInRegion(region));
</span><span class="cx">     bool hasPerpendicularContainingBlock = cb-&gt;isHorizontalWritingMode() != isHorizontalWritingMode();
</span><del>-    
</del><ins>+
+#if ENABLE(CSS_GRID_LAYOUT)
+    if (parent()-&gt;isRenderGrid() &amp;&amp; style().logicalWidth().isAuto() &amp;&amp; style().logicalMinWidth().isAuto() &amp;&amp; style().overflowX() == OVISIBLE) {
+        LayoutUnit minLogicalWidth = minPreferredLogicalWidth();
+        if (containerLogicalWidth &lt; minLogicalWidth) {
+            computedValues.m_extent = constrainLogicalWidthInRegionByMinMax(minLogicalWidth, containerLogicalWidth, cb);
+            return;
+        }
+    }
+#endif
+
</ins><span class="cx">     if (isInline() &amp;&amp; !isInlineBlockOrInlineTable()) {
</span><span class="cx">         // just calculate margins
</span><span class="cx">         computedValues.m_margins.m_start = minimumValueForLength(styleToUse.marginStart(), containerLogicalWidth);
</span><span class="lines">@@ -2738,9 +2748,17 @@
</span><span class="cx"> #if ENABLE(CSS_GRID_LAYOUT)
</span><span class="cx">             || parent()-&gt;isRenderGrid()
</span><span class="cx"> #endif
</span><del>-        ))
-            h = Length(overrideLogicalContentHeight(), Fixed);
-        else if (treatAsReplaced)
</del><ins>+        )) {
+            LayoutUnit contentHeight = overrideLogicalContentHeight();
+#if ENABLE(CSS_GRID_LAYOUT)
+            if (parent()-&gt;isRenderGrid() &amp;&amp; style().logicalHeight().isAuto() &amp;&amp; style().logicalMinHeight().isAuto() &amp;&amp; style().overflowX() == OVISIBLE) {
+                LayoutUnit intrinsicContentHeight = computedValues.m_extent - borderAndPaddingLogicalHeight();
+                if (auto minContentHeight = computeContentLogicalHeight(MinSize, Length(MinContent), intrinsicContentHeight))
+                    contentHeight = std::max(contentHeight, constrainLogicalHeightByMinMax(minContentHeight.value(), intrinsicContentHeight));
+            }
+#endif
+            h = Length(contentHeight, Fixed);
+        } else if (treatAsReplaced)
</ins><span class="cx">             h = Length(computeReplacedLogicalHeight(), Fixed);
</span><span class="cx">         else {
</span><span class="cx">             h = style().logicalHeight();
</span></span></pre>
</div>
</div>

</body>
</html>


More information about the webkit-changes mailing list