<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[208531] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/208531">208531</a></dd>
<dt>Author</dt> <dd>svillar@igalia.com</dd>
<dt>Date</dt> <dd>2016-11-10 02:08:19 -0800 (Thu, 10 Nov 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[css-grid] Fix fr tracks sizing under min|max-size constraints
https://bugs.webkit.org/show_bug.cgi?id=150674

Reviewed by Darin Adler.

Source/WebCore:

The min|max-sizes must be used to compute the flex fraction for indefinite free
spaces. According to the spec &quot;If using this flex fraction would cause the grid to be
smaller than the grid container’s min-width/height (or larger than the grid container’s
max-width/height), then redo this step, treating the free space as definite and the
available grid space as equal to the grid container’s content box size when it’s sized to
its min-width/height (max-width/height).&quot;

This only affects indefinite heights because during layout both definite sizes and any kind
of widths are properly constrained by min|max-width restrictions.

Tests: fast/css-grid-layout/flex-sizing-columns-min-max-width.html
       fast/css-grid-layout/flex-sizing-rows-min-max-height.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
(WebCore::RenderGrid::computeFlexSizedTracksGrowth):
* rendering/RenderGrid.h:

LayoutTests:

* fast/css-grid-layout/flex-sizing-columns-min-max-width-expected.txt: Added.
* fast/css-grid-layout/flex-sizing-columns-min-max-width.html: Added.
* fast/css-grid-layout/flex-sizing-rows-min-max-height-expected.txt: Added.
* fast/css-grid-layout/flex-sizing-rows-min-max-height.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderGridcpp">trunk/Source/WebCore/rendering/RenderGrid.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderGridh">trunk/Source/WebCore/rendering/RenderGrid.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcssgridlayoutflexsizingcolumnsminmaxwidthexpectedtxt">trunk/LayoutTests/fast/css-grid-layout/flex-sizing-columns-min-max-width-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutflexsizingcolumnsminmaxwidthhtml">trunk/LayoutTests/fast/css-grid-layout/flex-sizing-columns-min-max-width.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutflexsizingrowsminmaxheightexpectedtxt">trunk/LayoutTests/fast/css-grid-layout/flex-sizing-rows-min-max-height-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutflexsizingrowsminmaxheighthtml">trunk/LayoutTests/fast/css-grid-layout/flex-sizing-rows-min-max-height.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (208530 => 208531)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-11-10 09:01:21 UTC (rev 208530)
+++ trunk/LayoutTests/ChangeLog        2016-11-10 10:08:19 UTC (rev 208531)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-11-08  Sergio Villar Senin  &lt;svillar@igalia.com&gt;
+
+        [css-grid] Fix fr tracks sizing under min|max-size constraints
+        https://bugs.webkit.org/show_bug.cgi?id=150674
+
+        Reviewed by Darin Adler.
+
+        * fast/css-grid-layout/flex-sizing-columns-min-max-width-expected.txt: Added.
+        * fast/css-grid-layout/flex-sizing-columns-min-max-width.html: Added.
+        * fast/css-grid-layout/flex-sizing-rows-min-max-height-expected.txt: Added.
+        * fast/css-grid-layout/flex-sizing-rows-min-max-height.html: Added.
+
</ins><span class="cx"> 2016-11-09  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         WebHTMLView's _attributeStringFromDOMRange should use HTMLConverter instead of NSAttributedString's _initWithDOMRange
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutflexsizingcolumnsminmaxwidthexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-grid-layout/flex-sizing-columns-min-max-width-expected.txt (0 => 208531)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/flex-sizing-columns-min-max-width-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/flex-sizing-columns-min-max-width-expected.txt        2016-11-10 10:08:19 UTC (rev 208531)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+This test PASS if all the grids in the same row look the same.
+
+PASS
+PASS
+PASS
+
+PASS
+PASS
+PASS
+
+PASS
+PASS
+PASS
+
+PASS
+PASS
+PASS
</ins><span class="cx">Property changes on: trunk/LayoutTests/fast/css-grid-layout/flex-sizing-columns-min-max-width-expected.txt
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+LF
</ins><span class="cx">\ No newline at end of property
</span><a id="trunkLayoutTestsfastcssgridlayoutflexsizingcolumnsminmaxwidthhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-grid-layout/flex-sizing-columns-min-max-width.html (0 => 208531)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/flex-sizing-columns-min-max-width.html                                (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/flex-sizing-columns-min-max-width.html        2016-11-10 10:08:19 UTC (rev 208531)
</span><span class="lines">@@ -0,0 +1,88 @@
</span><ins>+&lt;!DOCTYPE HTML&gt;
+&lt;link href=&quot;resources/grid.css&quot; rel=&quot;stylesheet&quot;&gt;
+&lt;link href=&quot;../css-intrinsic-dimensions/resources/width-keyword-classes.css&quot; rel=&quot;stylesheet&quot;&gt;
+&lt;style&gt;
+.grid {
+   margin: 3px;
+   grid: 50px / minmax(10px, 1fr) minmax(10px, 4fr);
+   grid-column-gap: 33px;
+   border: 5px dashed;
+   padding: 2px;
+}
+
+.float { float: left; }
+
+.item:nth-child(1) { background-color: purple; }
+.item:nth-child(2) { background-color: blue; }
+&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 PASS if all the grids in the same row look the same.&lt;/p&gt;
+
+&lt;div class=&quot;grid float&quot; style=&quot;max-width: 70px&quot; data-expected-height=&quot;64&quot; data-expected-width=&quot;84&quot;&gt;
+    &lt;div class=&quot;item&quot; data-expected-height=&quot;50&quot; data-expected-width=&quot;10&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;item&quot; data-expected-height=&quot;50&quot; data-expected-width=&quot;27&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&quot;grid float&quot; style=&quot;min-width: 70px; max-width: 60px&quot; data-expected-height=&quot;64&quot; data-expected-width=&quot;84&quot;&gt;
+    &lt;div class=&quot;item&quot; data-expected-height=&quot;50&quot; data-expected-width=&quot;10&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;item&quot; data-expected-height=&quot;50&quot; data-expected-width=&quot;27&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&quot;grid float&quot; style=&quot;width: 70px&quot; data-expected-height=&quot;64&quot; data-expected-width=&quot;84&quot;&gt;
+    &lt;div class=&quot;item&quot; data-expected-height=&quot;50&quot; data-expected-width=&quot;10&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;item&quot; data-expected-height=&quot;50&quot; data-expected-width=&quot;27&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;br clear=&quot;all&quot;&gt;
+
+&lt;div class=&quot;grid float&quot; style=&quot;min-width: 108px&quot; data-expected-height=&quot;64&quot; data-expected-width=&quot;122&quot;&gt;
+    &lt;div class=&quot;item&quot; data-expected-height=&quot;50&quot; data-expected-width=&quot;15&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;item&quot; data-expected-height=&quot;50&quot; data-expected-width=&quot;60&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&quot;grid float&quot; style=&quot;min-width: 108px; max-width: 60px&quot; data-expected-height=&quot;64&quot; data-expected-width=&quot;122&quot;&gt;
+    &lt;div class=&quot;item&quot; data-expected-height=&quot;50&quot; data-expected-width=&quot;15&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;item&quot; data-expected-height=&quot;50&quot; data-expected-width=&quot;60&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&quot;grid float&quot; style=&quot;width: 108px&quot; data-expected-height=&quot;64&quot; data-expected-width=&quot;122&quot;&gt;
+    &lt;div class=&quot;item&quot; data-expected-height=&quot;50&quot; data-expected-width=&quot;15&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;item&quot; data-expected-height=&quot;50&quot; data-expected-width=&quot;60&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;br clear=&quot;all&quot;&gt;
+
+&lt;div class=&quot;grid float min-width-max-content&quot; data-expected-height=&quot;64&quot; data-expected-width=&quot;97&quot;&gt;
+    &lt;div class=&quot;item&quot; data-expected-height=&quot;50&quot; data-expected-width=&quot;10&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;item&quot; data-expected-height=&quot;50&quot; data-expected-width=&quot;40&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&quot;grid float min-width-max-content max-width-min-content&quot; data-expected-height=&quot;64&quot; data-expected-width=&quot;97&quot;&gt;
+    &lt;div class=&quot;item&quot; data-expected-height=&quot;50&quot; data-expected-width=&quot;10&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;item&quot; data-expected-height=&quot;50&quot; data-expected-width=&quot;40&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&quot;grid float max-content&quot; data-expected-height=&quot;64&quot; data-expected-width=&quot;97&quot;&gt;
+    &lt;div class=&quot;item&quot; data-expected-height=&quot;50&quot; data-expected-width=&quot;10&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;item&quot; data-expected-height=&quot;50&quot; data-expected-width=&quot;40&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;br clear=&quot;all&quot;&gt;
+
+&lt;div class=&quot;float min-content&quot;&gt;
+    &lt;div class=&quot;grid min-width-max-content&quot; data-expected-height=&quot;64&quot; data-expected-width=&quot;97&quot;&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=&quot;50&quot; data-expected-width=&quot;10&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=&quot;50&quot; data-expected-width=&quot;40&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&quot;float max-content&quot;&gt;
+    &lt;div class=&quot;grid min-width-max-content max-width-min-content&quot; data-expected-height=&quot;64&quot; data-expected-width=&quot;97&quot;&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=&quot;50&quot; data-expected-width=&quot;10&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=&quot;50&quot; data-expected-width=&quot;40&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&quot;float fit-content&quot;&gt;
+    &lt;div class=&quot;grid max-content&quot; data-expected-height=&quot;64&quot; data-expected-width=&quot;97&quot;&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=&quot;50&quot; data-expected-width=&quot;10&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=&quot;50&quot; data-expected-width=&quot;40&quot;&gt;&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/flex-sizing-columns-min-max-width.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+LF
</ins><span class="cx">\ No newline at end of property
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+text/html
</ins><span class="cx">\ No newline at end of property
</span><a id="trunkLayoutTestsfastcssgridlayoutflexsizingrowsminmaxheightexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-grid-layout/flex-sizing-rows-min-max-height-expected.txt (0 => 208531)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/flex-sizing-rows-min-max-height-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/flex-sizing-rows-min-max-height-expected.txt        2016-11-10 10:08:19 UTC (rev 208531)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+This test PASS if all the grids in the same row look the same.
+
+PASS
+PASS
+PASS
+
+PASS
+PASS
+PASS
+
+PASS
+PASS
+PASS
+
+PASS
+PASS
+PASS
</ins><span class="cx">Property changes on: trunk/LayoutTests/fast/css-grid-layout/flex-sizing-rows-min-max-height-expected.txt
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+LF
</ins><span class="cx">\ No newline at end of property
</span><a id="trunkLayoutTestsfastcssgridlayoutflexsizingrowsminmaxheighthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-grid-layout/flex-sizing-rows-min-max-height.html (0 => 208531)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/flex-sizing-rows-min-max-height.html                                (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/flex-sizing-rows-min-max-height.html        2016-11-10 10:08:19 UTC (rev 208531)
</span><span class="lines">@@ -0,0 +1,89 @@
</span><ins>+&lt;!DOCTYPE HTML&gt;
+&lt;link href=&quot;resources/grid.css&quot; rel=&quot;stylesheet&quot;&gt;
+&lt;link href=&quot;../css-intrinsic-dimensions/resources/height-keyword-classes.css&quot; rel=&quot;stylesheet&quot;&gt;
+&lt;style&gt;
+.grid {
+   margin: 3px;
+   grid: minmax(10px, 1fr) minmax(10px, 4fr) / 50px;
+   grid-row-gap: 33px;
+   border: 5px dashed;
+   padding: 2px;
+}
+
+.float { float: left; }
+
+.item:nth-child(1) { background-color: purple; }
+.item:nth-child(2) { background-color: blue; }
+&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;div id=&quot;log&quot;&gt;&lt;/div&gt;
+
+&lt;p&gt;This test PASS if all the grids in the same row look the same.&lt;/p&gt;
+
+&lt;div class=&quot;grid float&quot; style=&quot;max-height: 70px&quot; data-expected-width=&quot;64&quot; data-expected-height=&quot;84&quot;&gt;
+    &lt;div class=&quot;item&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;10&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;item&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;27&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&quot;grid float&quot; style=&quot;min-height: 70px; max-height: 60px&quot; data-expected-width=&quot;64&quot; data-expected-height=&quot;84&quot;&gt;
+    &lt;div class=&quot;item&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;10&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;item&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;27&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&quot;grid float&quot; style=&quot;height: 70px&quot; data-expected-width=&quot;64&quot; data-expected-height=&quot;84&quot;&gt;
+    &lt;div class=&quot;item&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;10&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;item&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;27&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;br clear=&quot;all&quot;&gt;
+
+&lt;div class=&quot;grid float&quot; style=&quot;min-height: 108px&quot; data-expected-width=&quot;64&quot; data-expected-height=&quot;122&quot;&gt;
+    &lt;div class=&quot;item&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;15&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;item&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;60&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&quot;grid float&quot; style=&quot;min-height: 108px; max-height: 60px&quot; data-expected-width=&quot;64&quot; data-expected-height=&quot;122&quot;&gt;
+    &lt;div class=&quot;item&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;15&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;item&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;60&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&quot;grid float&quot; style=&quot;height: 108px&quot; data-expected-width=&quot;64&quot; data-expected-height=&quot;122&quot;&gt;
+    &lt;div class=&quot;item&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;15&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;item&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;60&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;br clear=&quot;all&quot;&gt;
+
+&lt;div class=&quot;grid float min-height-max-content&quot; data-expected-width=&quot;64&quot; data-expected-height=&quot;97&quot;&gt;
+    &lt;div class=&quot;item&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;10&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;item&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&quot;grid float min-height-max-content max-height-min-content&quot; data-expected-width=&quot;64&quot; data-expected-height=&quot;97&quot;&gt;
+    &lt;div class=&quot;item&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;10&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;item&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&quot;grid float max-content&quot; data-expected-width=&quot;64&quot; data-expected-height=&quot;97&quot;&gt;
+    &lt;div class=&quot;item&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;10&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;item&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;br clear=&quot;all&quot;&gt;
+
+&lt;div class=&quot;float min-content&quot;&gt;
+    &lt;div class=&quot;grid min-height-max-content&quot; data-expected-width=&quot;64&quot; data-expected-height=&quot;97&quot;&gt;
+        &lt;div class=&quot;item&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;10&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;item&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&quot;float max-content&quot;&gt;
+    &lt;div class=&quot;grid min-height-max-content max-height-min-content&quot; data-expected-width=&quot;64&quot; data-expected-height=&quot;97&quot;&gt;
+        &lt;div class=&quot;item&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;10&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;item&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&quot;float fit-content&quot;&gt;
+    &lt;div class=&quot;grid max-content&quot; data-expected-width=&quot;64&quot; data-expected-height=&quot;97&quot;&gt;
+        &lt;div class=&quot;item&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;10&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;item&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;40&quot;&gt;&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/flex-sizing-rows-min-max-height.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+LF
</ins><span class="cx">\ No newline at end of property
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+text/html
</ins><span class="cx">\ No newline at end of property
</span><a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (208530 => 208531)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-11-10 09:01:21 UTC (rev 208530)
+++ trunk/Source/WebCore/ChangeLog        2016-11-10 10:08:19 UTC (rev 208531)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2016-11-08  Sergio Villar Senin  &lt;svillar@igalia.com&gt;
+
+        [css-grid] Fix fr tracks sizing under min|max-size constraints
+        https://bugs.webkit.org/show_bug.cgi?id=150674
+
+        Reviewed by Darin Adler.
+
+        The min|max-sizes must be used to compute the flex fraction for indefinite free
+        spaces. According to the spec &quot;If using this flex fraction would cause the grid to be
+        smaller than the grid container’s min-width/height (or larger than the grid container’s
+        max-width/height), then redo this step, treating the free space as definite and the
+        available grid space as equal to the grid container’s content box size when it’s sized to
+        its min-width/height (max-width/height).&quot;
+
+        This only affects indefinite heights because during layout both definite sizes and any kind
+        of widths are properly constrained by min|max-width restrictions.
+
+        Tests: fast/css-grid-layout/flex-sizing-columns-min-max-width.html
+               fast/css-grid-layout/flex-sizing-rows-min-max-height.html
+
+        * rendering/RenderGrid.cpp:
+        (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
+        (WebCore::RenderGrid::computeFlexSizedTracksGrowth):
+        * rendering/RenderGrid.h:
+
</ins><span class="cx"> 2016-11-10  Alejandro G. Castro  &lt;alex@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [WebRTC] [OpenWebRTC] RTX default parameters broken after r207952
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderGridcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderGrid.cpp (208530 => 208531)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderGrid.cpp        2016-11-10 09:01:21 UTC (rev 208530)
+++ trunk/Source/WebCore/rendering/RenderGrid.cpp        2016-11-10 10:08:19 UTC (rev 208531)
</span><span class="lines">@@ -799,21 +799,59 @@
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">     }
</span><ins>+    LayoutUnit totalGrowth;
+    Vector&lt;LayoutUnit&gt; increments;
+    increments.grow(flexibleSizedTracksIndex.size());
+    computeFlexSizedTracksGrowth(direction, sizingData.sizingOperation, tracks, flexibleSizedTracksIndex, flexFraction, increments, totalGrowth);
</ins><span class="cx"> 
</span><del>-    for (auto trackIndex : flexibleSizedTracksIndex) {
-        const GridTrackSize&amp; trackSize = gridTrackSize(direction, trackIndex, sizingData.sizingOperation);
-        GridTrack&amp; track = tracks[trackIndex];
-        LayoutUnit oldBaseSize = track.baseSize();
-        LayoutUnit baseSize = std::max&lt;LayoutUnit&gt;(oldBaseSize, flexFraction * trackSize.maxTrackBreadth().flex());
-        if (LayoutUnit increment = baseSize - oldBaseSize) {
-            track.setBaseSize(baseSize);
-            freeSpace -= increment;
-            growthLimitsWithoutMaximization += increment;
</del><ins>+    // We only need to redo the flex fraction computation for indefinite heights (definite sizes are
+    // already constrained by min/max sizes). Regarding widths, they are always definite at layout
+    // time so we shouldn't ever have to do this.
+    if (!hasDefiniteFreeSpace &amp;&amp; direction == ForRows) {
+        auto minSize = computeContentLogicalHeight(MinSize, style().logicalMinHeight(), LayoutUnit(-1));
+        auto maxSize = computeContentLogicalHeight(MaxSize, style().logicalMaxHeight(), LayoutUnit(-1));
+
+        // Redo the flex fraction computation using min|max-height as definite available space in
+        // case the total height is smaller than min-height or larger than max-height.
+        LayoutUnit rowsSize = totalGrowth + computeTrackBasedLogicalHeight(sizingData);
+        bool checkMinSize = minSize &amp;&amp; rowsSize &lt; minSize.value();
+        bool checkMaxSize = maxSize &amp;&amp; rowsSize &gt; maxSize.value();
+        if (checkMinSize || checkMaxSize) {
+            LayoutUnit constrainedFreeSpace = checkMaxSize ? maxSize.value() : LayoutUnit(-1);
+            constrainedFreeSpace = std::max(constrainedFreeSpace, minSize.value()) - guttersSize(ForRows, 0, gridRowCount());
+            flexFraction = findFlexFactorUnitSize(tracks, GridSpan::translatedDefiniteGridSpan(0, tracks.size()), ForRows, sizingData.sizingOperation, constrainedFreeSpace);
+
+            totalGrowth = LayoutUnit(0);
+            computeFlexSizedTracksGrowth(ForRows, sizingData.sizingOperation, tracks, flexibleSizedTracksIndex, flexFraction, increments, totalGrowth);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><ins>+
+    for (size_t i = 0; i &lt; flexibleSizedTracksIndex.size(); ++i) {
+        if (LayoutUnit increment = increments[i]) {
+            auto&amp; track = tracks[flexibleSizedTracksIndex[i]];
+            track.setBaseSize(track.baseSize() + increment);
+        }
+    }
+    freeSpace -= totalGrowth;
+    growthLimitsWithoutMaximization += totalGrowth;
</ins><span class="cx">     sizingData.setFreeSpace(direction, freeSpace);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void RenderGrid::computeFlexSizedTracksGrowth(GridTrackSizingDirection direction, SizingOperation sizingOperation, Vector&lt;GridTrack&gt;&amp; tracks, const Vector&lt;unsigned&gt;&amp; flexibleSizedTracksIndex, double flexFraction, Vector&lt;LayoutUnit&gt;&amp; increments, LayoutUnit&amp; totalGrowth) const
+{
+    size_t numFlexTracks = flexibleSizedTracksIndex.size();
+    ASSERT(increments.size() == numFlexTracks);
+    for (size_t i = 0; i &lt; numFlexTracks; ++i) {
+        unsigned trackIndex = flexibleSizedTracksIndex[i];
+        auto trackSize = gridTrackSize(direction, trackIndex, sizingOperation);
+        ASSERT(trackSize.maxTrackBreadth().isFlex());
+        LayoutUnit oldBaseSize = tracks[trackIndex].baseSize();
+        LayoutUnit newBaseSize = std::max(oldBaseSize, LayoutUnit(flexFraction * trackSize.maxTrackBreadth().flex()));
+        increments[i] = newBaseSize - oldBaseSize;
+        totalGrowth += increments[i];
+    }
+}
+
</ins><span class="cx"> LayoutUnit RenderGrid::computeUsedBreadthOfMinLength(const GridTrackSize&amp; trackSize, LayoutUnit maxSize) const
</span><span class="cx"> {
</span><span class="cx">     const GridLength&amp; gridLength = trackSize.minTrackBreadth();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderGridh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderGrid.h (208530 => 208531)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderGrid.h        2016-11-10 09:01:21 UTC (rev 208530)
+++ trunk/Source/WebCore/rendering/RenderGrid.h        2016-11-10 10:08:19 UTC (rev 208531)
</span><span class="lines">@@ -84,6 +84,7 @@
</span><span class="cx">     class GridSizingData;
</span><span class="cx">     enum SizingOperation { TrackSizing, IntrinsicSizeComputation };
</span><span class="cx">     void computeUsedBreadthOfGridTracks(GridTrackSizingDirection, GridSizingData&amp;, LayoutUnit&amp; baseSizesWithoutMaximization, LayoutUnit&amp; growthLimitsWithoutMaximization) const;
</span><ins>+    void computeFlexSizedTracksGrowth(GridTrackSizingDirection, SizingOperation, Vector&lt;GridTrack&gt;&amp;, const Vector&lt;unsigned&gt;&amp; flexibleSizedTracksIndex, double flexFraction, Vector&lt;LayoutUnit&gt;&amp; increments, LayoutUnit&amp; totalGrowth) const;
</ins><span class="cx">     LayoutUnit computeUsedBreadthOfMinLength(const GridTrackSize&amp;, LayoutUnit maxSize) const;
</span><span class="cx">     LayoutUnit computeUsedBreadthOfMaxLength(const GridTrackSize&amp;, LayoutUnit usedBreadth, LayoutUnit maxSize) const;
</span><span class="cx">     void resolveContentBasedTrackSizingFunctions(GridTrackSizingDirection, GridSizingData&amp;) const;
</span></span></pre>
</div>
</div>

</body>
</html>