Title: [201545] trunk
Revision
201545
Author
[email protected]
Date
2016-06-01 00:24:21 -0700 (Wed, 01 Jun 2016)

Log Message

[css-grid] Positioned items can be placed on the implicit grid
https://bugs.webkit.org/show_bug.cgi?id=158197

Reviewed by Sergio Villar Senin.

Source/WebCore:

The old code wrongly assumed that positioned items couldn't be placed
on the implicit grid. However, the spec doesn't mention anything about this.

The patch fixes this issue, so now positioned items can be actually
placed on the implicit tracks.

Test: fast/css-grid-layout/grid-positioned-items-within-grid-implicit-track.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::offsetAndBreadthForPositionedChild): Use the lines
of the implicit grid instead of the explicit one.

LayoutTests:

Updated the test to follow the expected behavior.

* fast/css-grid-layout/grid-positioned-items-within-grid-implicit-track-expected.txt:
* fast/css-grid-layout/grid-positioned-items-within-grid-implicit-track.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (201544 => 201545)


--- trunk/LayoutTests/ChangeLog	2016-06-01 05:05:25 UTC (rev 201544)
+++ trunk/LayoutTests/ChangeLog	2016-06-01 07:24:21 UTC (rev 201545)
@@ -1,3 +1,15 @@
+2016-06-01  Manuel Rego Casasnovas  <[email protected]>
+
+        [css-grid] Positioned items can be placed on the implicit grid
+        https://bugs.webkit.org/show_bug.cgi?id=158197
+
+        Reviewed by Sergio Villar Senin.
+
+        Updated the test to follow the expected behavior.
+
+        * fast/css-grid-layout/grid-positioned-items-within-grid-implicit-track-expected.txt:
+        * fast/css-grid-layout/grid-positioned-items-within-grid-implicit-track.html:
+
 2016-05-31  Dave Hyatt  <[email protected]>
 
         REGRESSION(r201040): Repainting of moving overflow:hidden objects is broken.

Modified: trunk/LayoutTests/fast/css-grid-layout/grid-positioned-items-within-grid-implicit-track-expected.txt (201544 => 201545)


--- trunk/LayoutTests/fast/css-grid-layout/grid-positioned-items-within-grid-implicit-track-expected.txt	2016-06-01 05:05:25 UTC (rev 201544)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-positioned-items-within-grid-implicit-track-expected.txt	2016-06-01 07:24:21 UTC (rev 201545)
@@ -1,4 +1,4 @@
-This test checks that positioned grid items are placed properly (ignoring implicit tracks) even if the grid has implicit tracks.
+This test checks that positioned grid items are placed properly (including implicit tracks) even if the grid has implicit tracks.
 
 PASS
 PASS

Modified: trunk/LayoutTests/fast/css-grid-layout/grid-positioned-items-within-grid-implicit-track.html (201544 => 201545)


--- trunk/LayoutTests/fast/css-grid-layout/grid-positioned-items-within-grid-implicit-track.html	2016-06-01 05:05:25 UTC (rev 201544)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-positioned-items-within-grid-implicit-track.html	2016-06-01 07:24:21 UTC (rev 201545)
@@ -35,7 +35,7 @@
 <script src=""
 <body _onload_="checkLayout('.grid')">
 
-<p>This test checks that positioned grid items are placed properly (ignoring implicit tracks) even if the grid has implicit tracks.</p>
+<p>This test checks that positioned grid items are placed properly (including implicit tracks) even if the grid has implicit tracks.</p>
 
 <div class="grid">
     <div class="sixRowsAndSixColumns"
@@ -78,7 +78,7 @@
         data-offset-x="15" data-offset-y="15" data-expected-width="900" data-expected-height="600">
     </div>
     <div class="absolute" style="grid-column: -4 / 1; grid-row: -4 / 1;"
-        data-offset-x="0" data-offset-y="0" data-expected-width="215" data-expected-height="115">
+        data-offset-x="115" data-offset-y="65" data-expected-width="100" data-expected-height="50">
     </div>
 </div>
 
@@ -87,7 +87,7 @@
         data-offset-x="15" data-offset-y="15" data-expected-width="900" data-expected-height="600">
     </div>
     <div class="absolute" style="grid-column: -4 / 2; grid-row: -4 / 2;"
-        data-offset-x="0" data-offset-y="0" data-expected-width="415" data-expected-height="265">
+        data-offset-x="115" data-offset-y="65" data-expected-width="300" data-expected-height="200">
     </div>
 </div>
 
@@ -96,7 +96,7 @@
         data-offset-x="15" data-offset-y="15" data-expected-width="900" data-expected-height="600">
     </div>
     <div class="absolute" style="grid-column: 3 / 4; grid-row: 3 / 4;"
-        data-offset-x="715" data-offset-y="515" data-expected-width="115" data-expected-height="115">
+        data-offset-x="715" data-offset-y="515" data-expected-width="100" data-expected-height="50">
     </div>
 </div>
 
@@ -105,7 +105,7 @@
         data-offset-x="15" data-offset-y="15" data-expected-width="900" data-expected-height="600">
     </div>
     <div class="absolute" style="grid-column: 2 / 4; grid-row: 2 / 4;"
-        data-offset-x="415" data-offset-y="265" data-expected-width="415" data-expected-height="365">
+        data-offset-x="415" data-offset-y="265" data-expected-width="400" data-expected-height="300">
     </div>
 </div>
 
@@ -150,7 +150,7 @@
         data-offset-x="-85" data-offset-y="15" data-expected-width="900" data-expected-height="600">
     </div>
     <div class="absolute" style="grid-column: -4 / 1; grid-row: -4 / 1;"
-        data-offset-x="615" data-offset-y="0" data-expected-width="215" data-expected-height="115">
+        data-offset-x="615" data-offset-y="65" data-expected-width="100" data-expected-height="50">
     </div>
 </div>
 
@@ -159,7 +159,7 @@
         data-offset-x="-85" data-offset-y="15" data-expected-width="900" data-expected-height="600">
     </div>
     <div class="absolute" style="grid-column: -4 / 2; grid-row: -4 / 2;"
-        data-offset-x="415" data-offset-y="0" data-expected-width="415" data-expected-height="265">
+        data-offset-x="415" data-offset-y="65" data-expected-width="300" data-expected-height="200">
     </div>
 </div>
 
@@ -168,7 +168,7 @@
         data-offset-x="-85" data-offset-y="15" data-expected-width="900" data-expected-height="600">
     </div>
     <div class="absolute" style="grid-column: 3 / 4; grid-row: 3 / 4;"
-        data-offset-x="0" data-offset-y="515" data-expected-width="115" data-expected-height="115">
+        data-offset-x="15" data-offset-y="515" data-expected-width="100" data-expected-height="50">
     </div>
 </div>
 
@@ -177,7 +177,7 @@
         data-offset-x="-85" data-offset-y="15" data-expected-width="900" data-expected-height="600">
     </div>
     <div class="absolute" style="grid-column: 2 / 4; grid-row: 2 / 4;"
-        data-offset-x="0" data-offset-y="265" data-expected-width="415" data-expected-height="365">
+        data-offset-x="15" data-offset-y="265" data-expected-width="400" data-expected-height="300">
     </div>
 </div>
 

Modified: trunk/Source/WebCore/ChangeLog (201544 => 201545)


--- trunk/Source/WebCore/ChangeLog	2016-06-01 05:05:25 UTC (rev 201544)
+++ trunk/Source/WebCore/ChangeLog	2016-06-01 07:24:21 UTC (rev 201545)
@@ -1,3 +1,22 @@
+2016-06-01  Manuel Rego Casasnovas  <[email protected]>
+
+        [css-grid] Positioned items can be placed on the implicit grid
+        https://bugs.webkit.org/show_bug.cgi?id=158197
+
+        Reviewed by Sergio Villar Senin.
+
+        The old code wrongly assumed that positioned items couldn't be placed
+        on the implicit grid. However, the spec doesn't mention anything about this.
+
+        The patch fixes this issue, so now positioned items can be actually
+        placed on the implicit tracks.
+
+        Test: fast/css-grid-layout/grid-positioned-items-within-grid-implicit-track.html
+
+        * rendering/RenderGrid.cpp:
+        (WebCore::RenderGrid::offsetAndBreadthForPositionedChild): Use the lines
+        of the implicit grid instead of the explicit one.
+
 2016-05-31  Chris Dumez  <[email protected]>
 
         Modernize lambda captures in WorkerThreadableWebSocketChannel

Modified: trunk/Source/WebCore/rendering/RenderGrid.cpp (201544 => 201545)


--- trunk/Source/WebCore/rendering/RenderGrid.cpp	2016-06-01 05:05:25 UTC (rev 201544)
+++ trunk/Source/WebCore/rendering/RenderGrid.cpp	2016-06-01 07:24:21 UTC (rev 201545)
@@ -1683,17 +1683,16 @@
 
     GridPosition startPosition = isRowAxis ? child.style().gridItemColumnStart() : child.style().gridItemRowStart();
     GridPosition endPosition = isRowAxis ? child.style().gridItemColumnEnd() : child.style().gridItemRowEnd();
-    int firstExplicitLine = smallestStart;
-    int lastExplicitLine = (isRowAxis ? GridPositionsResolver::explicitGridColumnCount(style(), autoRepeatCount) : GridPositionsResolver::explicitGridRowCount(style(), autoRepeatCount)) + smallestStart;
+    int lastLine = isRowAxis ? gridColumnCount() : gridRowCount();
 
     bool startIsAuto = startPosition.isAuto()
         || (startPosition.isNamedGridArea() && !NamedLineCollection::isValidNamedLineOrArea(startPosition.namedGridLine(), style(), (direction == ForColumns) ? ColumnStartSide : RowStartSide))
-        || (startLine < firstExplicitLine)
-        || (startLine > lastExplicitLine);
+        || (startLine < 0)
+        || (startLine > lastLine);
     bool endIsAuto = endPosition.isAuto()
         || (endPosition.isNamedGridArea() && !NamedLineCollection::isValidNamedLineOrArea(endPosition.namedGridLine(), style(), (direction == ForColumns) ? ColumnEndSide : RowEndSide))
-        || (endLine < firstExplicitLine)
-        || (endLine > lastExplicitLine);
+        || (endLine < 0)
+        || (endLine > lastLine);
 
     // We're normalizing the positions to avoid issues with RTL (as they're stored in the same order than LTR but adding an offset).
     LayoutUnit start;
@@ -1718,7 +1717,7 @@
             end = m_rowPositions[endLine] - borderBefore();
 
         // These vectors store line positions including gaps, but we shouldn't consider them for the edges of the grid.
-        if (endLine > firstExplicitLine && endLine < lastExplicitLine) {
+        if (endLine > 0 && endLine < lastLine) {
             end -= guttersSize(direction, 2);
             end -= isRowAxis ? m_offsetBetweenColumns : m_offsetBetweenRows;
         }
@@ -1735,7 +1734,7 @@
         else {
             offset = translateRTLCoordinate(m_columnPositions[endLine]) - borderLogicalLeft();
 
-            if (endLine > firstExplicitLine && endLine < lastExplicitLine) {
+            if (endLine > 0 && endLine < lastLine) {
                 offset += guttersSize(direction, 2);
                 offset += isRowAxis ? m_offsetBetweenColumns : m_offsetBetweenRows;
             }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to