<!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 "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)."
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 <svillar@igalia.com>
+
+ [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 <rniwa@webkit.org>
</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>+<!DOCTYPE HTML>
+<link href="resources/grid.css" rel="stylesheet">
+<link href="../css-intrinsic-dimensions/resources/width-keyword-classes.css" rel="stylesheet">
+<style>
+.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; }
+</style>
+
+<script src="../../resources/check-layout.js"></script>
+<body onload="checkLayout('.grid')">
+
+<p>This test PASS if all the grids in the same row look the same.</p>
+
+<div class="grid float" style="max-width: 70px" data-expected-height="64" data-expected-width="84">
+ <div class="item" data-expected-height="50" data-expected-width="10"></div>
+ <div class="item" data-expected-height="50" data-expected-width="27"></div>
+</div>
+<div class="grid float" style="min-width: 70px; max-width: 60px" data-expected-height="64" data-expected-width="84">
+ <div class="item" data-expected-height="50" data-expected-width="10"></div>
+ <div class="item" data-expected-height="50" data-expected-width="27"></div>
+</div>
+<div class="grid float" style="width: 70px" data-expected-height="64" data-expected-width="84">
+ <div class="item" data-expected-height="50" data-expected-width="10"></div>
+ <div class="item" data-expected-height="50" data-expected-width="27"></div>
+</div>
+
+<br clear="all">
+
+<div class="grid float" style="min-width: 108px" data-expected-height="64" data-expected-width="122">
+ <div class="item" data-expected-height="50" data-expected-width="15"></div>
+ <div class="item" data-expected-height="50" data-expected-width="60"></div>
+</div>
+<div class="grid float" style="min-width: 108px; max-width: 60px" data-expected-height="64" data-expected-width="122">
+ <div class="item" data-expected-height="50" data-expected-width="15"></div>
+ <div class="item" data-expected-height="50" data-expected-width="60"></div>
+</div>
+<div class="grid float" style="width: 108px" data-expected-height="64" data-expected-width="122">
+ <div class="item" data-expected-height="50" data-expected-width="15"></div>
+ <div class="item" data-expected-height="50" data-expected-width="60"></div>
+</div>
+
+<br clear="all">
+
+<div class="grid float min-width-max-content" data-expected-height="64" data-expected-width="97">
+ <div class="item" data-expected-height="50" data-expected-width="10"></div>
+ <div class="item" data-expected-height="50" data-expected-width="40"></div>
+</div>
+<div class="grid float min-width-max-content max-width-min-content" data-expected-height="64" data-expected-width="97">
+ <div class="item" data-expected-height="50" data-expected-width="10"></div>
+ <div class="item" data-expected-height="50" data-expected-width="40"></div>
+</div>
+<div class="grid float max-content" data-expected-height="64" data-expected-width="97">
+ <div class="item" data-expected-height="50" data-expected-width="10"></div>
+ <div class="item" data-expected-height="50" data-expected-width="40"></div>
+</div>
+
+<br clear="all">
+
+<div class="float min-content">
+ <div class="grid min-width-max-content" data-expected-height="64" data-expected-width="97">
+ <div class="item" data-expected-height="50" data-expected-width="10"></div>
+ <div class="item" data-expected-height="50" data-expected-width="40"></div>
+ </div>
+</div>
+<div class="float max-content">
+ <div class="grid min-width-max-content max-width-min-content" data-expected-height="64" data-expected-width="97">
+ <div class="item" data-expected-height="50" data-expected-width="10"></div>
+ <div class="item" data-expected-height="50" data-expected-width="40"></div>
+ </div>
+</div>
+<div class="float fit-content">
+ <div class="grid max-content" data-expected-height="64" data-expected-width="97">
+ <div class="item" data-expected-height="50" data-expected-width="10"></div>
+ <div class="item" data-expected-height="50" data-expected-width="40"></div>
+ </div>
+</div>
+
+</body>
</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>+<!DOCTYPE HTML>
+<link href="resources/grid.css" rel="stylesheet">
+<link href="../css-intrinsic-dimensions/resources/height-keyword-classes.css" rel="stylesheet">
+<style>
+.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; }
+</style>
+
+<script src="../../resources/check-layout.js"></script>
+<body onload="checkLayout('.grid')">
+<div id="log"></div>
+
+<p>This test PASS if all the grids in the same row look the same.</p>
+
+<div class="grid float" style="max-height: 70px" data-expected-width="64" data-expected-height="84">
+ <div class="item" data-expected-width="50" data-expected-height="10"></div>
+ <div class="item" data-expected-width="50" data-expected-height="27"></div>
+</div>
+<div class="grid float" style="min-height: 70px; max-height: 60px" data-expected-width="64" data-expected-height="84">
+ <div class="item" data-expected-width="50" data-expected-height="10"></div>
+ <div class="item" data-expected-width="50" data-expected-height="27"></div>
+</div>
+<div class="grid float" style="height: 70px" data-expected-width="64" data-expected-height="84">
+ <div class="item" data-expected-width="50" data-expected-height="10"></div>
+ <div class="item" data-expected-width="50" data-expected-height="27"></div>
+</div>
+
+<br clear="all">
+
+<div class="grid float" style="min-height: 108px" data-expected-width="64" data-expected-height="122">
+ <div class="item" data-expected-width="50" data-expected-height="15"></div>
+ <div class="item" data-expected-width="50" data-expected-height="60"></div>
+</div>
+<div class="grid float" style="min-height: 108px; max-height: 60px" data-expected-width="64" data-expected-height="122">
+ <div class="item" data-expected-width="50" data-expected-height="15"></div>
+ <div class="item" data-expected-width="50" data-expected-height="60"></div>
+</div>
+<div class="grid float" style="height: 108px" data-expected-width="64" data-expected-height="122">
+ <div class="item" data-expected-width="50" data-expected-height="15"></div>
+ <div class="item" data-expected-width="50" data-expected-height="60"></div>
+</div>
+
+<br clear="all">
+
+<div class="grid float min-height-max-content" data-expected-width="64" data-expected-height="97">
+ <div class="item" data-expected-width="50" data-expected-height="10"></div>
+ <div class="item" data-expected-width="50" data-expected-height="40"></div>
+</div>
+<div class="grid float min-height-max-content max-height-min-content" data-expected-width="64" data-expected-height="97">
+ <div class="item" data-expected-width="50" data-expected-height="10"></div>
+ <div class="item" data-expected-width="50" data-expected-height="40"></div>
+</div>
+<div class="grid float max-content" data-expected-width="64" data-expected-height="97">
+ <div class="item" data-expected-width="50" data-expected-height="10"></div>
+ <div class="item" data-expected-width="50" data-expected-height="40"></div>
+</div>
+
+<br clear="all">
+
+<div class="float min-content">
+ <div class="grid min-height-max-content" data-expected-width="64" data-expected-height="97">
+ <div class="item" data-expected-width="50" data-expected-height="10"></div>
+ <div class="item" data-expected-width="50" data-expected-height="40"></div>
+ </div>
+</div>
+<div class="float max-content">
+ <div class="grid min-height-max-content max-height-min-content" data-expected-width="64" data-expected-height="97">
+ <div class="item" data-expected-width="50" data-expected-height="10"></div>
+ <div class="item" data-expected-width="50" data-expected-height="40"></div>
+ </div>
+</div>
+<div class="float fit-content">
+ <div class="grid max-content" data-expected-width="64" data-expected-height="97">
+ <div class="item" data-expected-width="50" data-expected-height="10"></div>
+ <div class="item" data-expected-width="50" data-expected-height="40"></div>
+ </div>
+</div>
+
+</body>
</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 <svillar@igalia.com>
+
+ [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 "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)."
+
+ 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 <alex@igalia.com>
</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<LayoutUnit> 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& trackSize = gridTrackSize(direction, trackIndex, sizingData.sizingOperation);
- GridTrack& track = tracks[trackIndex];
- LayoutUnit oldBaseSize = track.baseSize();
- LayoutUnit baseSize = std::max<LayoutUnit>(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 && 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 && rowsSize < minSize.value();
+ bool checkMaxSize = maxSize && rowsSize > 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 < flexibleSizedTracksIndex.size(); ++i) {
+ if (LayoutUnit increment = increments[i]) {
+ auto& 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<GridTrack>& tracks, const Vector<unsigned>& flexibleSizedTracksIndex, double flexFraction, Vector<LayoutUnit>& increments, LayoutUnit& totalGrowth) const
+{
+ size_t numFlexTracks = flexibleSizedTracksIndex.size();
+ ASSERT(increments.size() == numFlexTracks);
+ for (size_t i = 0; i < 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& trackSize, LayoutUnit maxSize) const
</span><span class="cx"> {
</span><span class="cx"> const GridLength& 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&, LayoutUnit& baseSizesWithoutMaximization, LayoutUnit& growthLimitsWithoutMaximization) const;
</span><ins>+ void computeFlexSizedTracksGrowth(GridTrackSizingDirection, SizingOperation, Vector<GridTrack>&, const Vector<unsigned>& flexibleSizedTracksIndex, double flexFraction, Vector<LayoutUnit>& increments, LayoutUnit& totalGrowth) const;
</ins><span class="cx"> LayoutUnit computeUsedBreadthOfMinLength(const GridTrackSize&, LayoutUnit maxSize) const;
</span><span class="cx"> LayoutUnit computeUsedBreadthOfMaxLength(const GridTrackSize&, LayoutUnit usedBreadth, LayoutUnit maxSize) const;
</span><span class="cx"> void resolveContentBasedTrackSizingFunctions(GridTrackSizingDirection, GridSizingData&) const;
</span></span></pre>
</div>
</div>
</body>
</html>