<!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>[190308] 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/190308">190308</a></dd>
<dt>Author</dt> <dd>jfernandez@igalia.com</dd>
<dt>Date</dt> <dd>2015-09-29 05:32:48 -0700 (Tue, 29 Sep 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>[CSS Grid Layout] Flex tracks sizing alg must handle 0fr values
https://bugs.webkit.org/show_bug.cgi?id=148944

Reviewed by Darin Adler.

Source/WebCore:

We don't allow 0 as flexible size value, which is not following current
specs; it just states that it must be a positive value. This patch
adds such change in the parser but some additional logic must be added
as well to handle 0 values during the flex tracks sizing algorithm.

The old algorithm didn't take 0 values into account, so there is the risk
of division by zero. Additionally, it was not handling fraction values
in the best way. The last versions of the spec changed this algorithm in
order to handle fraction values so that they don't cause exponential
grow of tracks using values bigger than 1.

This patch implements also such new algorithm, so we can deal not only
with 0 values, but managing fraction values properly.

No new tests, just some additional test cases and some of them rebaselined.

* rendering/RenderGrid.cpp:
(WebCore::normalizedFlexFraction):
(WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
(WebCore::RenderGrid::computeFlexFactorUnitSize): Added.
(WebCore::RenderGrid::findFlexFactorUnitSize): Added.
(WebCore::RenderGrid::GridTrackForNormalization): Deleted.
(WebCore::RenderGrid::computeNormalizedFractionBreadth): Deleted.
* rendering/RenderGrid.h:

LayoutTests:

Allow 0 as flex factor value and implement the new flex track sizing algorithm.

* fast/css-grid-layout/flex-and-minmax-content-resolution-rows.html: Updated some cases.
* fast/css-grid-layout/flex-content-resolution-columns-expected.txt:
* fast/css-grid-layout/flex-content-resolution-columns.html: Added some new cases.
* fast/css-grid-layout/flex-content-resolution-rows-expected.txt:
* fast/css-grid-layout/flex-content-resolution-rows.html: Added some new cases.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutflexandminmaxcontentresolutionrowshtml">trunk/LayoutTests/fast/css-grid-layout/flex-and-minmax-content-resolution-rows.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutflexcontentresolutioncolumnsexpectedtxt">trunk/LayoutTests/fast/css-grid-layout/flex-content-resolution-columns-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutflexcontentresolutioncolumnshtml">trunk/LayoutTests/fast/css-grid-layout/flex-content-resolution-columns.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutflexcontentresolutionrowsexpectedtxt">trunk/LayoutTests/fast/css-grid-layout/flex-content-resolution-rows-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutflexcontentresolutionrowshtml">trunk/LayoutTests/fast/css-grid-layout/flex-content-resolution-rows.html</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>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (190307 => 190308)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-09-29 10:23:12 UTC (rev 190307)
+++ trunk/LayoutTests/ChangeLog        2015-09-29 12:32:48 UTC (rev 190308)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2015-09-29  Javier Fernandez  &lt;jfernandez@igalia.com&gt;
+
+        [CSS Grid Layout] Flex tracks sizing alg must handle 0fr values
+        https://bugs.webkit.org/show_bug.cgi?id=148944
+
+        Reviewed by Darin Adler.
+
+        Allow 0 as flex factor value and implement the new flex track sizing algorithm.
+
+        * fast/css-grid-layout/flex-and-minmax-content-resolution-rows.html: Updated some cases.
+        * fast/css-grid-layout/flex-content-resolution-columns-expected.txt:
+        * fast/css-grid-layout/flex-content-resolution-columns.html: Added some new cases.
+        * fast/css-grid-layout/flex-content-resolution-rows-expected.txt:
+        * fast/css-grid-layout/flex-content-resolution-rows.html: Added some new cases.
+
</ins><span class="cx"> 2015-09-16  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         printing does not use minimum page zoom factor
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutflexandminmaxcontentresolutionrowshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/flex-and-minmax-content-resolution-rows.html (190307 => 190308)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/flex-and-minmax-content-resolution-rows.html        2015-09-29 10:23:12 UTC (rev 190307)
+++ trunk/LayoutTests/fast/css-grid-layout/flex-and-minmax-content-resolution-rows.html        2015-09-29 12:32:48 UTC (rev 190308)
</span><span class="lines">@@ -120,6 +120,7 @@
</span><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><ins>+&lt;!-- We normalize fraction flex factors to 1, so we don't keep exact proportions with &gt;1 factors. --&gt;
</ins><span class="cx"> &lt;div style=&quot;width: 10px; height: 60px;&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid gridWithIntrinsicSizeBiggerThanFlex&quot; style=&quot;height: 100%&quot;&gt;
</span><span class="cx">         &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;40&quot;&gt;XXXXX XXXXX XXXXX XXXXX&lt;/div&gt;
</span><span class="lines">@@ -127,10 +128,11 @@
</span><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><ins>+&lt;!-- We normalize fraction flex factors to 1, so we don't keep exact proportions with &gt;1 factors. --&gt;
</ins><span class="cx"> &lt;div style=&quot;width: 10px; height: 60px;&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid gridWithIntrinsicSizeBiggerThanFlex&quot;&gt;
</span><span class="cx">         &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;40&quot;&gt;XXXXX XXXXX XXXXX XXXXX&lt;/div&gt;
</span><del>-        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;160&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;80&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutflexcontentresolutioncolumnsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/flex-content-resolution-columns-expected.txt (190307 => 190308)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/flex-content-resolution-columns-expected.txt        2015-09-29 10:23:12 UTC (rev 190307)
+++ trunk/LayoutTests/fast/css-grid-layout/flex-content-resolution-columns-expected.txt        2015-09-29 12:32:48 UTC (rev 190308)
</span><span class="lines">@@ -13,3 +13,8 @@
</span><span class="cx"> PASS
</span><span class="cx"> PASS
</span><span class="cx"> PASS
</span><ins>+PASS
+PASS
+PASS
+PASS
+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutflexcontentresolutioncolumnshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/flex-content-resolution-columns.html (190307 => 190308)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/flex-content-resolution-columns.html        2015-09-29 10:23:12 UTC (rev 190307)
+++ trunk/LayoutTests/fast/css-grid-layout/flex-content-resolution-columns.html        2015-09-29 12:32:48 UTC (rev 190308)
</span><span class="lines">@@ -6,6 +6,10 @@
</span><span class="cx">     -webkit-grid-template-columns: minmax(1fr, 50px);
</span><span class="cx">     -webkit-grid-template-rows: 50px;
</span><span class="cx"> }
</span><ins>+.gridZeroFlexContent {
+    -webkit-grid-template-columns: minmax(1fr, 0px);
+    -webkit-grid-template-rows: 50px;
+}
</ins><span class="cx"> .gridMaxFlexContent {
</span><span class="cx">     -webkit-grid-template-columns: minmax(30px, 2fr);
</span><span class="cx">     -webkit-grid-template-rows: 50px;
</span><span class="lines">@@ -22,6 +26,27 @@
</span><span class="cx">     -webkit-grid-template-columns: minmax(300px, 3fr) minmax(150px, 1fr);
</span><span class="cx">     -webkit-grid-template-rows: 50px;
</span><span class="cx"> }
</span><ins>+.gridRespectBaseSize {
+    -webkit-grid-template-columns: minmax(75px, 1fr) minmax(0px, 2fr);
+    -webkit-grid-template-rows: 50px;
+}
+.gridRespectProportions {
+    -webkit-grid-template-columns: minmax(0px, .25fr) minmax(0px, .5fr) minmax(0px, 2fr);
+    -webkit-grid-template-rows: 50px;
+}
+.gridRespectBaseSizeProportions {
+    -webkit-grid-template-columns: minmax(50px, .25fr) minmax(0px, .5fr) minmax(0px, 1fr);
+    -webkit-grid-template-rows: 50px;
+}
+.gridRespectBaseSizeBeforeProportions {
+    -webkit-grid-template-columns: minmax(50px, .25fr) minmax(0px, .5fr) minmax(0px, 1fr);
+    -webkit-grid-template-rows: 50px;
+}
+.firstRowThirdColumn {
+    background-color: yellow;
+    -webkit-grid-column: 3;
+    -webkit-grid-row: 1;
+}
</ins><span class="cx"> &lt;/style&gt;
</span><span class="cx"> &lt;script src=&quot;../../resources/check-layout.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;body onload=&quot;checkLayout('.grid');&quot;&gt;
</span><span class="lines">@@ -34,6 +59,12 @@
</span><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><ins>+&lt;div style=&quot;width: 100px&quot;&gt;
+    &lt;div class=&quot;grid gridZeroFlexContent&quot;&gt;
+        &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-expected-width=&quot;0&quot; data-expected-height=&quot;50&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
</ins><span class="cx"> &lt;!-- Allow the extra logical space distribution to occur. --&gt;
</span><span class="cx"> &lt;div style=&quot;width: 40px; height: 10px&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid gridMinFlexContent&quot;&gt;
</span><span class="lines">@@ -121,5 +152,40 @@
</span><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><ins>+&lt;!-- Flex track length must be at least its baseSize. --&gt;
+&lt;div style=&quot;width: 100px; height: 10px;&quot;&gt;
+    &lt;div class=&quot;grid gridRespectBaseSize&quot;&gt;
+        &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-expected-width=&quot;75&quot; data-expected-height=&quot;50&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;sizedToGridArea firstRowSecondColumn&quot; data-expected-width=&quot;25&quot; data-expected-height=&quot;50&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;!-- Flex track lengths must be proportional to their flex factors.. --&gt;
+&lt;div style=&quot;width: 275px; height: 10px;&quot;&gt;
+    &lt;div class=&quot;grid gridRespectProportions&quot;&gt;
+        &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-expected-width=&quot;25&quot; data-expected-height=&quot;50&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;sizedToGridArea firstRowSecondColumn&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;50&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;sizedToGridArea firstRowThirdColumn&quot; data-expected-width=&quot;200&quot; data-expected-height=&quot;50&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;!-- Flex track lengths must be proportional but still respecting their base sizes. --&gt;
+&lt;div style=&quot;width: 350px; height: 10px;&quot;&gt;
+    &lt;div class=&quot;grid gridRespectBaseSizeProportions&quot;&gt;
+        &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;50&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;sizedToGridArea firstRowSecondColumn&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;50&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;sizedToGridArea firstRowThirdColumn&quot; data-expected-width=&quot;200&quot; data-expected-height=&quot;50&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;!-- Not enough space to repsect proportions, because minTrackBreadh it's a harder requirement --&gt;
+&lt;div style=&quot;width: 275px; height: 10px;&quot;&gt;
+    &lt;div class=&quot;grid gridRespectBaseSizeBeforeProportions&quot;&gt;
+        &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;50&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;sizedToGridArea firstRowSecondColumn&quot; data-expected-width=&quot;75&quot; data-expected-height=&quot;50&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;sizedToGridArea firstRowThirdColumn&quot; data-expected-width=&quot;150&quot; data-expected-height=&quot;50&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
</ins><span class="cx"> &lt;/body&gt;
</span><span class="cx"> &lt;/html&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutflexcontentresolutionrowsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/flex-content-resolution-rows-expected.txt (190307 => 190308)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/flex-content-resolution-rows-expected.txt        2015-09-29 10:23:12 UTC (rev 190307)
+++ trunk/LayoutTests/fast/css-grid-layout/flex-content-resolution-rows-expected.txt        2015-09-29 12:32:48 UTC (rev 190308)
</span><span class="lines">@@ -22,3 +22,10 @@
</span><span class="cx"> PASS
</span><span class="cx"> PASS
</span><span class="cx"> PASS
</span><ins>+PASS
+PASS
+PASS
+PASS
+PASS
+PASS
+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutflexcontentresolutionrowshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/flex-content-resolution-rows.html (190307 => 190308)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/flex-content-resolution-rows.html        2015-09-29 10:23:12 UTC (rev 190307)
+++ trunk/LayoutTests/fast/css-grid-layout/flex-content-resolution-rows.html        2015-09-29 12:32:48 UTC (rev 190308)
</span><span class="lines">@@ -6,6 +6,10 @@
</span><span class="cx">     -webkit-grid-template-columns: 50px;
</span><span class="cx">     -webkit-grid-template-rows: minmax(1fr, 50px);
</span><span class="cx"> }
</span><ins>+.gridZeroFlexContent {
+    -webkit-grid-template-columns: 50px;
+    -webkit-grid-template-rows: minmax(1fr, 0px);
+}
</ins><span class="cx"> .gridMaxFlexContent {
</span><span class="cx">     -webkit-grid-template-columns: 50px;
</span><span class="cx">     -webkit-grid-template-rows: minmax(30px, 2fr);
</span><span class="lines">@@ -18,6 +22,27 @@
</span><span class="cx">     -webkit-grid-template-columns: 50px;
</span><span class="cx">     -webkit-grid-template-rows: minmax(10px, 0.5fr) minmax(10px, 2fr);
</span><span class="cx"> }
</span><ins>+.gridRespectBaseSize {
+    -webkit-grid-template-columns: 50px;
+    -webkit-grid-template-rows: minmax(75px, 1fr) minmax(0px, 2fr);
+}
+.gridRespectProportions {
+    -webkit-grid-template-columns: 50px;
+    -webkit-grid-template-rows: minmax(25px, .25fr) minmax(0px, .5fr) minmax(0px, 2fr);
+}
+.gridRespectBaseSizeProportions {
+    -webkit-grid-template-columns: 50px;
+    -webkit-grid-template-rows: minmax(50px, .25fr) minmax(0px, .5fr) minmax(0px, 1fr);
+}
+.gridRespectBaseSizeBeforeProportions {
+    -webkit-grid-template-columns: 50px;
+    -webkit-grid-template-rows: minmax(50px, .25fr) minmax(0px, .5fr) minmax(0px, 1fr);
+}
+.thirdRowFirstColumn {
+    background-color: yellow;
+    -webkit-grid-column: 1;
+    -webkit-grid-row: 3;
+}
</ins><span class="cx"> &lt;/style&gt;
</span><span class="cx"> &lt;script src=&quot;../../resources/check-layout.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;body onload=&quot;checkLayout('.grid');&quot;&gt;
</span><span class="lines">@@ -31,6 +56,12 @@
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div style=&quot;height: 0px&quot;&gt;
</span><ins>+    &lt;div class=&quot;grid gridZeroFlexContent&quot;&gt;
+        &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;0&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div style=&quot;height: 0px&quot;&gt;
</ins><span class="cx">     &lt;div class=&quot;grid gridMinFlexContent&quot;&gt;
</span><span class="cx">         &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;50&quot;&gt;&lt;/div&gt;
</span><span class="cx">     &lt;/div&gt;
</span><span class="lines">@@ -137,10 +168,11 @@
</span><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><ins>+&lt;!-- We normalize fraction flex factors to 1, so we don't keep exact proportions with &gt;1 factors. --&gt;
</ins><span class="cx"> &lt;div class=&quot;constrainedContainer&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid gridTwoDoubleMaxFlexContent&quot;&gt;
</span><span class="cx">         &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;10&quot;&gt;&lt;/div&gt;
</span><del>-        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;20&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -152,10 +184,11 @@
</span><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><ins>+&lt;!-- We normalize fraction flex factors to 1, so we don't keep exact proportions with &gt;1 factors. --&gt;
</ins><span class="cx"> &lt;div style=&quot;width: 10px; height: 60px&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid gridTwoDoubleMaxFlexContent&quot;&gt;
</span><span class="cx">         &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;10&quot;&gt;&lt;/div&gt;
</span><del>-        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;20&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -166,12 +199,64 @@
</span><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><ins>+&lt;!-- We normalize fraction flex factors to 1, so we don't keep exact proportions with &gt;1 factors. --&gt;
</ins><span class="cx"> &lt;div style=&quot;width: 10px; height: 120px;&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid gridTwoDoubleMaxFlexContent&quot;&gt;
</span><span class="cx">         &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;10&quot;&gt;&lt;/div&gt;
</span><del>-        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;20&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><ins>+&lt;!-- Flex track lengths must be proportional to their flex factors.. --&gt;
+&lt;div style=&quot;width: 10px; height: 275px;&quot;&gt;
+    &lt;div class=&quot;grid gridRespectProportions&quot; style=&quot;height: 100%;&quot;&gt;
+        &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;25&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;50&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;sizedToGridArea thirdRowFirstColumn&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;200&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div style=&quot;width: 10px; height: 275px;&quot;&gt;
+    &lt;div class=&quot;grid gridRespectProportions&quot;&gt;
+        &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;25&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;13&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;sizedToGridArea thirdRowFirstColumn&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;50&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;!-- Flex track lengths must be proportional but still respecting their base sizes. --&gt;
+&lt;div style=&quot;width: 10px; height: 350px;&quot;&gt;
+    &lt;div class=&quot;grid gridRespectBaseSizeProportions&quot; style=&quot;height: 100%;&quot;&gt;
+        &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;50&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;sizedToGridArea thirdRowFirstColumn&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;200&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div style=&quot;width: 10px; height: 350px;&quot;&gt;
+    &lt;div class=&quot;grid gridRespectBaseSizeProportions&quot;&gt;
+        &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;50&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;25&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;sizedToGridArea thirdRowFirstColumn&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;50&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;!-- Not enough space to repsect proportions, because minTrackBreadh it's a harder requirement --&gt;
+&lt;div style=&quot;width: 10px; height: 275px;&quot;&gt;
+    &lt;div class=&quot;grid gridRespectBaseSizeBeforeProportions&quot; style=&quot;height: 100%;&quot;&gt;
+        &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;50&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;75&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;sizedToGridArea thirdRowFirstColumn&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;150&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div style=&quot;width: 10px; height: 275px;&quot;&gt;
+    &lt;div class=&quot;grid gridRespectBaseSizeBeforeProportions&quot;&gt;
+        &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;50&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;25&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;sizedToGridArea thirdRowFirstColumn&quot; data-expected-width=&quot;50&quot; data-expected-height=&quot;50&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
</ins><span class="cx"> &lt;/body&gt;
</span><span class="cx"> &lt;/html&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (190307 => 190308)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-09-29 10:23:12 UTC (rev 190307)
+++ trunk/Source/WebCore/ChangeLog        2015-09-29 12:32:48 UTC (rev 190308)
</span><span class="lines">@@ -1,3 +1,35 @@
</span><ins>+2015-09-29  Javier Fernandez  &lt;jfernandez@igalia.com&gt;
+
+        [CSS Grid Layout] Flex tracks sizing alg must handle 0fr values
+        https://bugs.webkit.org/show_bug.cgi?id=148944
+
+        Reviewed by Darin Adler.
+
+        We don't allow 0 as flexible size value, which is not following current
+        specs; it just states that it must be a positive value. This patch
+        adds such change in the parser but some additional logic must be added
+        as well to handle 0 values during the flex tracks sizing algorithm.
+
+        The old algorithm didn't take 0 values into account, so there is the risk
+        of division by zero. Additionally, it was not handling fraction values
+        in the best way. The last versions of the spec changed this algorithm in
+        order to handle fraction values so that they don't cause exponential
+        grow of tracks using values bigger than 1.
+
+        This patch implements also such new algorithm, so we can deal not only
+        with 0 values, but managing fraction values properly.
+
+        No new tests, just some additional test cases and some of them rebaselined.
+
+        * rendering/RenderGrid.cpp:
+        (WebCore::normalizedFlexFraction):
+        (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
+        (WebCore::RenderGrid::computeFlexFactorUnitSize): Added.
+        (WebCore::RenderGrid::findFlexFactorUnitSize): Added.
+        (WebCore::RenderGrid::GridTrackForNormalization): Deleted.
+        (WebCore::RenderGrid::computeNormalizedFractionBreadth): Deleted.
+        * rendering/RenderGrid.h:
+
</ins><span class="cx"> 2015-09-29  Csaba Osztrogonác  &lt;ossy@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix the broken !ENABLE(STREAM_API) build
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderGridcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderGrid.cpp (190307 => 190308)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderGrid.cpp        2015-09-29 10:23:12 UTC (rev 190307)
+++ trunk/Source/WebCore/rendering/RenderGrid.cpp        2015-09-29 12:32:48 UTC (rev 190308)
</span><span class="lines">@@ -116,19 +116,6 @@
</span><span class="cx">     bool m_infinitelyGrowable { false };
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-struct GridTrackForNormalization {
-    GridTrackForNormalization(const GridTrack&amp; track, double flex)
-        : m_track(&amp;track)
-        , m_flex(flex)
-        , m_normalizedFlexValue(track.baseSize() / flex)
-    {
-    }
-
-    const GridTrack* m_track;
-    double m_flex;
-    LayoutUnit m_normalizedFlexValue;
-};
-
</del><span class="cx"> class RenderGrid::GridIterator {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(GridIterator);
</span><span class="cx"> public:
</span><span class="lines">@@ -369,6 +356,11 @@
</span><span class="cx">     return isFloatingOrOutOfFlowPositioned();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static inline double normalizedFlexFraction(const GridTrack&amp; track, double flexFactor)
+{
+    return track.baseSize() / std::max&lt;double&gt;(1, flexFactor);
+}
+
</ins><span class="cx"> void RenderGrid::computeUsedBreadthOfGridTracks(GridTrackSizingDirection direction, GridSizingData&amp; sizingData, LayoutUnit&amp; availableLogicalSpace)
</span><span class="cx"> {
</span><span class="cx">     const LayoutUnit initialAvailableLogicalSpace = availableLogicalSpace;
</span><span class="lines">@@ -429,14 +421,12 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // 4. Grow all Grid tracks having a fraction as the MaxTrackSizingFunction.
</span><del>-    double normalizedFractionBreadth = 0;
</del><ins>+    double flexFraction = 0;
</ins><span class="cx">     if (!hasUndefinedRemainingSpace)
</span><del>-        normalizedFractionBreadth = computeNormalizedFractionBreadth(tracks, GridSpan(0, tracks.size() - 1), direction, initialAvailableLogicalSpace);
</del><ins>+        flexFraction = findFlexFactorUnitSize(tracks, GridSpan(0, tracks.size() - 1), direction, initialAvailableLogicalSpace);
</ins><span class="cx">     else {
</span><del>-        for (auto trackIndex : flexibleSizedTracksIndex) {
-            const GridTrackSize&amp; trackSize = gridTrackSize(direction, trackIndex);
-            normalizedFractionBreadth = std::max(normalizedFractionBreadth, tracks[trackIndex].baseSize() / trackSize.maxTrackBreadth().flex());
-        }
</del><ins>+        for (const auto&amp; trackIndex : flexibleSizedTracksIndex)
+            flexFraction = std::max(flexFraction, normalizedFlexFraction(tracks[trackIndex], gridTrackSize(direction, trackIndex).maxTrackBreadth().flex()));
</ins><span class="cx"> 
</span><span class="cx">         for (unsigned i = 0; i &lt; flexibleSizedTracksIndex.size(); ++i) {
</span><span class="cx">             GridIterator iterator(m_grid, direction, flexibleSizedTracksIndex[i]);
</span><span class="lines">@@ -448,8 +438,7 @@
</span><span class="cx">                 if (i &gt; 0 &amp;&amp; span.resolvedInitialPosition.toInt() &lt;= flexibleSizedTracksIndex[i - 1])
</span><span class="cx">                     continue;
</span><span class="cx"> 
</span><del>-                double itemNormalizedFlexBreadth = computeNormalizedFractionBreadth(tracks, span, direction, maxContentForChild(*gridItem, direction, sizingData.columnTracks));
-                normalizedFractionBreadth = std::max(normalizedFractionBreadth, itemNormalizedFlexBreadth);
</del><ins>+                flexFraction = std::max(flexFraction, findFlexFactorUnitSize(tracks, span, direction, maxContentForChild(*gridItem, direction, sizingData.columnTracks)));
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -457,7 +446,7 @@
</span><span class="cx">     for (auto trackIndex : flexibleSizedTracksIndex) {
</span><span class="cx">         const GridTrackSize&amp; trackSize = gridTrackSize(direction, trackIndex);
</span><span class="cx">         GridTrack&amp; track = tracks[trackIndex];
</span><del>-        LayoutUnit baseSize = std::max&lt;LayoutUnit&gt;(track.baseSize(), normalizedFractionBreadth * trackSize.maxTrackBreadth().flex());
</del><ins>+        LayoutUnit baseSize = std::max&lt;LayoutUnit&gt;(track.baseSize(), flexFraction * trackSize.maxTrackBreadth().flex());
</ins><span class="cx">         track.setBaseSize(baseSize);
</span><span class="cx">         availableLogicalSpace -= baseSize;
</span><span class="cx">     }
</span><span class="lines">@@ -500,57 +489,56 @@
</span><span class="cx">     return valueForLength(trackLength, computeContentLogicalHeight(MainOrPreferredSize, style().logicalHeight(), Nullopt).valueOr(0));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-double RenderGrid::computeNormalizedFractionBreadth(Vector&lt;GridTrack&gt;&amp; tracks, const GridSpan&amp; tracksSpan, GridTrackSizingDirection direction, LayoutUnit spaceToFill) const
</del><ins>+double RenderGrid::computeFlexFactorUnitSize(const Vector&lt;GridTrack&gt;&amp; tracks, GridTrackSizingDirection direction, double flexFactorSum, LayoutUnit leftOverSpace, const Vector&lt;size_t, 8&gt;&amp; flexibleTracksIndexes, std::unique_ptr&lt;TrackIndexSet&gt; tracksToTreatAsInflexible) const
</ins><span class="cx"> {
</span><del>-    LayoutUnit allocatedSpace;
-    Vector&lt;GridTrackForNormalization&gt; tracksForNormalization;
-    for (auto&amp; position : tracksSpan) {
-        GridTrack&amp; track = tracks[position.toInt()];
-        allocatedSpace += track.baseSize();
</del><ins>+    // We want to avoid the effect of flex factors sum below 1 making the factor unit size to grow exponentially.
+    double hypotheticalFactorUnitSize = leftOverSpace / std::max&lt;double&gt;(1, flexFactorSum);
</ins><span class="cx"> 
</span><del>-        const GridTrackSize&amp; trackSize = gridTrackSize(direction, position.toInt());
-        if (!trackSize.maxTrackBreadth().isFlex())
</del><ins>+    // product of the hypothetical &quot;flex factor unit&quot; and any flexible track's &quot;flex factor&quot; must be grater than such track's &quot;base size&quot;.
+    bool validFlexFactorUnit = true;
+    for (auto index : flexibleTracksIndexes) {
+        if (tracksToTreatAsInflexible &amp;&amp; tracksToTreatAsInflexible-&gt;contains(index))
</ins><span class="cx">             continue;
</span><del>-
-        tracksForNormalization.append(GridTrackForNormalization(track, trackSize.maxTrackBreadth().flex()));
</del><ins>+        LayoutUnit baseSize = tracks[index].baseSize();
+        double flexFactor = gridTrackSize(direction, index).maxTrackBreadth().flex();
+        // treating all such tracks as inflexible.
+        if (baseSize &gt; hypotheticalFactorUnitSize * flexFactor) {
+            leftOverSpace -= baseSize;
+            flexFactorSum -= flexFactor;
+            if (!tracksToTreatAsInflexible)
+                tracksToTreatAsInflexible = std::unique_ptr&lt;TrackIndexSet&gt;(new TrackIndexSet());
+            tracksToTreatAsInflexible-&gt;add(index);
+            validFlexFactorUnit = false;
+        }
</ins><span class="cx">     }
</span><ins>+    if (!validFlexFactorUnit)
+        return computeFlexFactorUnitSize(tracks, direction, flexFactorSum, leftOverSpace, flexibleTracksIndexes, WTF::move(tracksToTreatAsInflexible));
+    return hypotheticalFactorUnitSize;
+}
</ins><span class="cx"> 
</span><del>-    // The function is not called if we don't have &lt;flex&gt; grid tracks
-    ASSERT(!tracksForNormalization.isEmpty());
</del><ins>+double RenderGrid::findFlexFactorUnitSize(const Vector&lt;GridTrack&gt;&amp; tracks, const GridSpan&amp; tracksSpan, GridTrackSizingDirection direction, LayoutUnit leftOverSpace) const
+{
+    if (leftOverSpace &lt;= 0)
+        return 0;
</ins><span class="cx"> 
</span><del>-    std::sort(tracksForNormalization.begin(), tracksForNormalization.end(),
-              [](const GridTrackForNormalization&amp; track1, const GridTrackForNormalization&amp; track2) {
-                  return track1.m_normalizedFlexValue &lt; track2.m_normalizedFlexValue;
-              });
-
-    // These values work together: as we walk over our grid tracks, we increase fractionValueBasedOnGridItemsRatio
-    // to match a grid track's usedBreadth to &lt;flex&gt; ratio until the total fractions sized grid tracks wouldn't
-    // fit into availableLogicalSpaceIgnoringFractionTracks.
-    double accumulatedFractions = 0;
-    LayoutUnit fractionValueBasedOnGridItemsRatio = 0;
-    LayoutUnit availableLogicalSpaceIgnoringFractionTracks = spaceToFill - allocatedSpace;
-
-    for (auto&amp; track : tracksForNormalization) {
-        if (track.m_normalizedFlexValue &gt; fractionValueBasedOnGridItemsRatio) {
-            // If the normalized flex value (we ordered |tracksForNormalization| by increasing normalized flex value)
-            // will make us overflow our container, then stop. We have the previous step's ratio is the best fit.
-            if (track.m_normalizedFlexValue * accumulatedFractions &gt; availableLogicalSpaceIgnoringFractionTracks)
-                break;
-
-            fractionValueBasedOnGridItemsRatio = track.m_normalizedFlexValue;
</del><ins>+    double flexFactorSum = 0;
+    Vector&lt;size_t, 8&gt; flexibleTracksIndexes;
+    for (const auto&amp; resolvedPosition : tracksSpan) {
+        size_t trackIndex = resolvedPosition.toInt();
+        GridTrackSize trackSize = gridTrackSize(direction, trackIndex);
+        if (!trackSize.maxTrackBreadth().isFlex())
+            leftOverSpace -= tracks[trackIndex].baseSize();
+        else {
+            double flexFactor = trackSize.maxTrackBreadth().flex();
+            flexibleTracksIndexes.append(trackIndex);
+            flexFactorSum += flexFactor;
</ins><span class="cx">         }
</span><del>-
-        accumulatedFractions += track.m_flex;
-        // This item was processed so we re-add its used breadth to the available space to accurately count the remaining space.
-        availableLogicalSpaceIgnoringFractionTracks += track.m_track-&gt;baseSize();
</del><span class="cx">     }
</span><span class="cx"> 
</span><del>-    // Let flex factor sum be the sum of the flex factors of the flexible tracks. If this value
-    // is less than 1, set it to 1 instead.
-    if (accumulatedFractions &lt; 1)
-        return availableLogicalSpaceIgnoringFractionTracks;
</del><ins>+    // The function is not called if we don't have &lt;flex&gt; grid tracks
+    ASSERT(!flexibleTracksIndexes.isEmpty());
</ins><span class="cx"> 
</span><del>-    return availableLogicalSpaceIgnoringFractionTracks / accumulatedFractions;
</del><ins>+    return computeFlexFactorUnitSize(tracks, direction, flexFactorSum, leftOverSpace, flexibleTracksIndexes);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool RenderGrid::hasDefiniteLogicalSize(GridTrackSizingDirection direction) const
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderGridh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderGrid.h (190307 => 190308)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderGrid.h        2015-09-29 10:23:12 UTC (rev 190307)
+++ trunk/Source/WebCore/rendering/RenderGrid.h        2015-09-29 12:32:48 UTC (rev 190308)
</span><span class="lines">@@ -113,7 +113,9 @@
</span><span class="cx">     template &lt;TrackSizeComputationPhase&gt; void resolveContentBasedTrackSizingFunctionsForItems(GridTrackSizingDirection, GridSizingData&amp;, const GridItemsSpanGroupRange&amp;);
</span><span class="cx">     template &lt;TrackSizeComputationPhase&gt; void distributeSpaceToTracks(Vector&lt;GridTrack*&gt;&amp;, const Vector&lt;GridTrack*&gt;* growBeyondGrowthLimitsTracks, LayoutUnit&amp; availableLogicalSpace);
</span><span class="cx"> 
</span><del>-    double computeNormalizedFractionBreadth(Vector&lt;GridTrack&gt;&amp;, const GridSpan&amp; tracksSpan, GridTrackSizingDirection, LayoutUnit availableLogicalSpace) const;
</del><ins>+    typedef HashSet&lt;unsigned, DefaultHash&lt;unsigned&gt;::Hash, WTF::UnsignedWithZeroKeyHashTraits&lt;unsigned&gt;&gt; TrackIndexSet;
+    double computeFlexFactorUnitSize(const Vector&lt;GridTrack&gt;&amp;, GridTrackSizingDirection, double flexFactorSum, LayoutUnit leftOverSpace, const Vector&lt;size_t, 8&gt;&amp; flexibleTracksIndexes, std::unique_ptr&lt;TrackIndexSet&gt; tracksToTreatAsInflexible = nullptr) const;
+    double findFlexFactorUnitSize(const Vector&lt;GridTrack&gt;&amp;, const GridSpan&amp;, GridTrackSizingDirection, LayoutUnit spaceToFill) const;
</ins><span class="cx"> 
</span><span class="cx">     GridTrackSize gridTrackSize(GridTrackSizingDirection, unsigned) const;
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>