No subject


Mon Jan 28 08:41:14 PST 2013


4805">r154805</a> by &lt;jchaffraix at chromium.org&gt;

Source/WebCore:

Reject negative values for track-breadth at parse time as
mentioned in the latest versions of the spec.

Added some extra checks to the existing tests.

* css/CSSParser.cpp:
(WebCore::CSSParser::parseGridBreadth):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeUsedBreadthOfMaxLength):

LayoutTests:

Added some new test cases to check that track-breadth cannot be a
negative value, either it's a length, a percentage...

* fast/css-grid-layout/grid-columns-rows-get-set-expected.txt:
* fast/css-grid-layout/grid-columns-rows-get-set-multiple-expected.txt:
* fast/css-grid-layout/resources/grid-columns-rows-get-set-multiple.js:
* fast/css-grid-layout/resources/grid-columns-rows-get-set.js:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href=3D"#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a=
></li>
<li><a href=3D"#trunkLayoutTestsfastcssgridlayoutgridcolumnsrowsgetsetexp=
ectedtxt">trunk/LayoutTests/fast/css-grid-layout/grid-columns-rows-get-se=
t-expected.txt</a></li>
<li><a href=3D"#trunkLayoutTestsfastcssgridlayoutgridcolumnsrowsgetsetmul=
tipleexpectedtxt">trunk/LayoutTests/fast/css-grid-layout/grid-columns-row=
s-get-set-multiple-expected.txt</a></li>
<li><a href=3D"#trunkLayoutTestsfastcssgridlayoutresourcesgridcolumnsrows=
getsetmultiplejs">trunk/LayoutTests/fast/css-grid-layout/resources/grid-c=
olumns-rows-get-set-multiple.js</a></li>
<li><a href=3D"#trunkLayoutTestsfastcssgridlayoutresourcesgridcolumnsrows=
getsetjs">trunk/LayoutTests/fast/css-grid-layout/resources/grid-columns-r=
ows-get-set.js</a></li>
<li><a href=3D"#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeL=
og</a></li>
<li><a href=3D"#trunkSourceWebCorecssCSSParsercpp">trunk/Source/WebCore/c=
ss/CSSParser.cpp</a></li>
<li><a href=3D"#trunkSourceWebCorerenderingRenderGridcpp">trunk/Source/We=
bCore/rendering/RenderGrid.cpp</a></li>
</ul>

</div>
<div id=3D"patch">
<h3>Diff</h3>
<a id=3D"trunkLayoutTestsChangeLog"></a>
<div class=3D"modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (154729 =
=3D> 154730)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/LayoutTests/ChangeLog	2013-08-28 09:45:14 =
UTC (rev 154729)
+++ trunk/LayoutTests/ChangeLog	2013-08-28 09:58:33 UTC (rev 154730)
</span><span class=3D"lines">@@ -1,5 +1,22 @@
</span><span class=3D"cx"> 2013-08-28  Sergio Villar Senin  &lt;svillar at i=
galia.com&gt;
</span><span class=3D"cx">=20
</span><ins>+        [CSS Grid Layout] infinity should be defined as a ne=
gative value
+        https://bugs.webkit.org/show_bug.cgi?id=3D107053
+
+        Reviewed by Andreas Kling.
+
+        From Blink r154805 by &lt;jchaffraix at chromium.org&gt;
+
+        Added some new test cases to check that track-breadth cannot be =
a
+        negative value, either it's a length, a percentage...
+
+        * fast/css-grid-layout/grid-columns-rows-get-set-expected.txt:
+        * fast/css-grid-layout/grid-columns-rows-get-set-multiple-expect=
ed.txt:
+        * fast/css-grid-layout/resources/grid-columns-rows-get-set-multi=
ple.js:
+        * fast/css-grid-layout/resources/grid-columns-rows-get-set.js:
+
+2013-08-28  Sergio Villar Senin  &lt;svillar at igalia.com&gt;
+
</ins><span class=3D"cx">         [Soup] WebTiming information not shown =
in the inspector
</span><span class=3D"cx">         https://bugs.webkit.org/show_bug.cgi?i=
d=3D118395
</span><span class=3D"cx">=20
</span></span></pre></div>
<a id=3D"trunkLayoutTestsfastcssgridlayoutgridcolumnsrowsgetsetexpectedtx=
t"></a>
<div class=3D"modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layo=
ut/grid-columns-rows-get-set-expected.txt (154729 =3D> 154730)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/LayoutTests/fast/css-grid-layout/grid-colu=
mns-rows-get-set-expected.txt	2013-08-28 09:45:14 UTC (rev 154729)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-columns-rows-get-set-expe=
cted.txt	2013-08-28 09:58:33 UTC (rev 154730)
</span><span class=3D"lines">@@ -70,6 +70,10 @@
</span><span class=3D"cx"> PASS getComputedStyle(element, '').getProperty=
Value('-webkit-grid-definition-rows') is 'none'
</span><span class=3D"cx"> PASS getComputedStyle(element, '').getProperty=
Value('-webkit-grid-definition-columns') is 'none'
</span><span class=3D"cx"> PASS getComputedStyle(element, '').getProperty=
Value('-webkit-grid-definition-rows') is 'none'
</span><ins>+PASS getComputedStyle(element, '').getPropertyValue('-webkit=
-grid-definition-columns') is 'none'
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-defini=
tion-rows') is 'none'
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-defini=
tion-columns') is 'none'
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-defini=
tion-rows') is 'none'
</ins><span class=3D"cx">=20
</span><span class=3D"cx"> Test setting grid-definition-columns and grid-=
definition-rows back to 'none' through JS
</span><span class=3D"cx"> PASS getComputedStyle(element, '').getProperty=
Value('-webkit-grid-definition-columns') is '18px'
</span></span></pre></div>
<a id=3D"trunkLayoutTestsfastcssgridlayoutgridcolumnsrowsgetsetmultipleex=
pectedtxt"></a>
<div class=3D"modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layo=
ut/grid-columns-rows-get-set-multiple-expected.txt (154729 =3D> 154730)</=
h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/LayoutTests/fast/css-grid-layout/grid-colu=
mns-rows-get-set-multiple-expected.txt	2013-08-28 09:45:14 UTC (rev 15472=
9)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-columns-rows-get-set-mult=
iple-expected.txt	2013-08-28 09:58:33 UTC (rev 154730)
</span><span class=3D"lines">@@ -64,6 +64,10 @@
</span><span class=3D"cx"> PASS getComputedStyle(element, '').getProperty=
Value('-webkit-grid-definition-rows') is 'none'
</span><span class=3D"cx"> PASS getComputedStyle(element, '').getProperty=
Value('-webkit-grid-definition-columns') is 'none'
</span><span class=3D"cx"> PASS getComputedStyle(element, '').getProperty=
Value('-webkit-grid-definition-rows') is 'none'
</span><ins>+PASS getComputedStyle(element, '').getPropertyValue('-webkit=
-grid-definition-columns') is 'none'
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-defini=
tion-rows') is 'none'
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-defini=
tion-columns') is 'none'
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-defini=
tion-rows') is 'none'
</ins><span class=3D"cx"> PASS successfullyParsed is true
</span><span class=3D"cx">=20
</span><span class=3D"cx"> TEST COMPLETE
</span></span></pre></div>
<a id=3D"trunkLayoutTestsfastcssgridlayoutresourcesgridcolumnsrowsgetsetm=
ultiplejs"></a>
<div class=3D"modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layo=
ut/resources/grid-columns-rows-get-set-multiple.js (154729 =3D> 154730)</=
h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/LayoutTests/fast/css-grid-layout/resources=
/grid-columns-rows-get-set-multiple.js	2013-08-28 09:45:14 UTC (rev 15472=
9)
+++ trunk/LayoutTests/fast/css-grid-layout/resources/grid-columns-rows-ge=
t-set-multiple.js	2013-08-28 09:58:33 UTC (rev 154730)
</span><span class=3D"lines">@@ -152,3 +152,18 @@
</span><span class=3D"cx"> element.style.webkitGridDefinitionRows =3D &qu=
ot;minmax(auto, 15%) 10vw&quot;;
</span><span class=3D"cx"> shouldBe(&quot;getComputedStyle(element, '').g=
etPropertyValue('-webkit-grid-definition-columns')&quot;, &quot;'none'&qu=
ot;);
</span><span class=3D"cx"> shouldBe(&quot;getComputedStyle(element, '').g=
etPropertyValue('-webkit-grid-definition-rows')&quot;, &quot;'none'&quot;=
);
</span><ins>+
+// Negative values are not allowed.
+element =3D document.createElement(&quot;div&quot;);
+document.body.appendChild(element);
+element.style.webkitGridDefinitionColumns =3D &quot;-10px minmax(16px, 3=
2px)&quot;;
+element.style.webkitGridDefinitionRows =3D &quot;minmax(10%, 15%) -10vw&=
quot;;
+shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('-webkit-g=
rid-definition-columns')&quot;, &quot;'none'&quot;);
+shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('-webkit-g=
rid-definition-rows')&quot;, &quot;'none'&quot;);
+
+element =3D document.createElement(&quot;div&quot;);
+document.body.appendChild(element);
+element.style.webkitGridDefinitionColumns =3D &quot;10px minmax(16px, -1=
vw)&quot;;
+element.style.webkitGridDefinitionRows =3D &quot;minmax(-1%, 15%) 10vw&q=
uot;;
+shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('-webkit-g=
rid-definition-columns')&quot;, &quot;'none'&quot;);
+shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('-webkit-g=
rid-definition-rows')&quot;, &quot;'none'&quot;);
</ins></span></pre></div>
<a id=3D"trunkLayoutTestsfastcssgridlayoutresourcesgridcolumnsrowsgetsetj=
s"></a>
<div class=3D"modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layo=
ut/resources/grid-columns-rows-get-set.js (154729 =3D> 154730)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/LayoutTests/fast/css-grid-layout/resources=
/grid-columns-rows-get-set.js	2013-08-28 09:45:14 UTC (rev 154729)
+++ trunk/LayoutTests/fast/css-grid-layout/resources/grid-columns-rows-ge=
t-set.js	2013-08-28 09:58:33 UTC (rev 154730)
</span><span class=3D"lines">@@ -180,6 +180,17 @@
</span><span class=3D"cx"> shouldBe(&quot;getComputedStyle(element, '').g=
etPropertyValue('-webkit-grid-definition-columns')&quot;, &quot;'none'&qu=
ot;);
</span><span class=3D"cx"> shouldBe(&quot;getComputedStyle(element, '').g=
etPropertyValue('-webkit-grid-definition-rows')&quot;, &quot;'none'&quot;=
);
</span><span class=3D"cx">=20
</span><ins>+// Negative values are not allowed.
+element.style.webkitGridDefinitionColumns =3D &quot;-1px&quot;;
+element.style.webkitGridDefinitionRows =3D &quot;-6em&quot;;
+shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('-webkit-g=
rid-definition-columns')&quot;, &quot;'none'&quot;);
+shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('-webkit-g=
rid-definition-rows')&quot;, &quot;'none'&quot;);
+
+element.style.webkitGridDefinitionColumns =3D &quot;minmax(-1%, 32%)&quo=
t;;
+element.style.webkitGridDefinitionRows =3D &quot;minmax(2vw, -6em)&quot;=
;
+shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('-webkit-g=
rid-definition-columns')&quot;, &quot;'none'&quot;);
+shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('-webkit-g=
rid-definition-rows')&quot;, &quot;'none'&quot;);
+
</ins><span class=3D"cx"> debug(&quot;&quot;);
</span><span class=3D"cx"> debug(&quot;Test setting grid-definition-colum=
ns and grid-definition-rows back to 'none' through JS&quot;);
</span><span class=3D"cx"> element.style.webkitGridDefinitionColumns =3D =
&quot;18px&quot;;
</span></span></pre></div>
<a id=3D"trunkSourceWebCoreChangeLog"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (1547=
29 =3D> 154730)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebCore/ChangeLog	2013-08-28 09:45:=
14 UTC (rev 154729)
+++ trunk/Source/WebCore/ChangeLog	2013-08-28 09:58:33 UTC (rev 154730)
</span><span class=3D"lines">@@ -1,5 +1,24 @@
</span><span class=3D"cx"> 2013-08-28  Sergio Villar Senin  &lt;svillar at i=
galia.com&gt;
</span><span class=3D"cx">=20
</span><ins>+        [CSS Grid Layout] infinity should be defined as a ne=
gative value
+        https://bugs.webkit.org/show_bug.cgi?id=3D107053
+
+        Reviewed by Andreas Kling.
+
+        From Blink r154805 by &lt;jchaffraix at chromium.org&gt;
+
+        Reject negative values for track-breadth at parse time as
+        mentioned in the latest versions of the spec.
+
+        Added some extra checks to the existing tests.
+
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseGridBreadth):
+        * rendering/RenderGrid.cpp:
+        (WebCore::RenderGrid::computeUsedBreadthOfMaxLength):
+
+2013-08-28  Sergio Villar Senin  &lt;svillar at igalia.com&gt;
+
</ins><span class=3D"cx">         [Soup] WebTiming information not shown =
in the inspector
</span><span class=3D"cx">         https://bugs.webkit.org/show_bug.cgi?i=
d=3D118395
</span><span class=3D"cx">=20
</span></span></pre></div>
<a id=3D"trunkSourceWebCorecssCSSParsercpp"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.c=
pp (154729 =3D> 154730)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebCore/css/CSSParser.cpp	2013-08-2=
8 09:45:14 UTC (rev 154729)
+++ trunk/Source/WebCore/css/CSSParser.cpp	2013-08-28 09:58:33 UTC (rev 1=
54730)
</span><span class=3D"lines">@@ -4925,7 +4925,7 @@
</span><span class=3D"cx">     if (currentValue-&gt;id =3D=3D CSSValueWeb=
kitMinContent || currentValue-&gt;id =3D=3D CSSValueWebkitMaxContent)
</span><span class=3D"cx">         return cssValuePool().createIdentifier=
Value(currentValue-&gt;id);
</span><span class=3D"cx">=20
</span><del>-    if (!validUnit(currentValue, FLength | FPercent))
</del><ins>+    if (!validUnit(currentValue, FNonNeg | FLength | FPercent=
))
</ins><span class=3D"cx">         return 0;
</span><span class=3D"cx">=20
</span><span class=3D"cx">     return createPrimitiveNumericValue(current=
Value);
</span></span></pre></div>
<a id=3D"trunkSourceWebCorerenderingRenderGridcpp"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebCore/rendering/Rende=
rGrid.cpp (154729 =3D> 154730)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebCore/rendering/RenderGrid.cpp	20=
13-08-28 09:45:14 UTC (rev 154729)
+++ trunk/Source/WebCore/rendering/RenderGrid.cpp	2013-08-28 09:58:33 UTC=
 (rev 154730)
</span><span class=3D"lines">@@ -33,7 +33,7 @@
</span><span class=3D"cx">=20
</span><span class=3D"cx"> namespace WebCore {
</span><span class=3D"cx">=20
</span><del>-static const int infinity =3D intMaxForLayoutUnit;
</del><ins>+static const int infinity =3D -1;
</ins><span class=3D"cx">=20
</span><span class=3D"cx"> class GridTrack {
</span><span class=3D"cx"> public:
</span><span class=3D"lines">@@ -303,8 +303,7 @@
</span><span class=3D"cx"> {
</span><span class=3D"cx">     if (trackLength.isFixed() || trackLength.i=
sPercent() || trackLength.isViewportPercentage()) {
</span><span class=3D"cx">         LayoutUnit computedBreadth =3D compute=
UsedBreadthOfSpecifiedLength(direction, trackLength);
</span><del>-        // FIXME: We should ASSERT that computedBreadth cann=
ot return infinity but it's currently
-        // possible. See https://bugs.webkit.org/show_bug.cgi?id=3D10705=
3
</del><ins>+        ASSERT(computedBreadth !=3D infinity);
</ins><span class=3D"cx">         return computedBreadth;
</span><span class=3D"cx">     }
</span><span class=3D"cx">=20
</span></span></pre>
</div>
</div>

</body>
</html>


More information about the webkit-changes mailing list