Changeset 201545 in webkit
- Timestamp:
- Jun 1, 2016 12:24:21 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r201529 r201545 1 2016-06-01 Manuel Rego Casasnovas <rego@igalia.com> 2 3 [css-grid] Positioned items can be placed on the implicit grid 4 https://bugs.webkit.org/show_bug.cgi?id=158197 5 6 Reviewed by Sergio Villar Senin. 7 8 Updated the test to follow the expected behavior. 9 10 * fast/css-grid-layout/grid-positioned-items-within-grid-implicit-track-expected.txt: 11 * fast/css-grid-layout/grid-positioned-items-within-grid-implicit-track.html: 12 1 13 2016-05-31 Dave Hyatt <hyatt@apple.com> 2 14 -
trunk/LayoutTests/fast/css-grid-layout/grid-positioned-items-within-grid-implicit-track-expected.txt
r199098 r201545 1 This test checks that positioned grid items are placed properly (i gnoring implicit tracks) even if the grid has implicit tracks.1 This test checks that positioned grid items are placed properly (including implicit tracks) even if the grid has implicit tracks. 2 2 3 3 PASS -
trunk/LayoutTests/fast/css-grid-layout/grid-positioned-items-within-grid-implicit-track.html
r200510 r201545 36 36 <body onload="checkLayout('.grid')"> 37 37 38 <p>This test checks that positioned grid items are placed properly (i gnoring implicit tracks) even if the grid has implicit tracks.</p>38 <p>This test checks that positioned grid items are placed properly (including implicit tracks) even if the grid has implicit tracks.</p> 39 39 40 40 <div class="grid"> … … 79 79 </div> 80 80 <div class="absolute" style="grid-column: -4 / 1; grid-row: -4 / 1;" 81 data-offset-x=" 0" data-offset-y="0" data-expected-width="215" data-expected-height="115">81 data-offset-x="115" data-offset-y="65" data-expected-width="100" data-expected-height="50"> 82 82 </div> 83 83 </div> … … 88 88 </div> 89 89 <div class="absolute" style="grid-column: -4 / 2; grid-row: -4 / 2;" 90 data-offset-x=" 0" data-offset-y="0" data-expected-width="415" data-expected-height="265">90 data-offset-x="115" data-offset-y="65" data-expected-width="300" data-expected-height="200"> 91 91 </div> 92 92 </div> … … 97 97 </div> 98 98 <div class="absolute" style="grid-column: 3 / 4; grid-row: 3 / 4;" 99 data-offset-x="715" data-offset-y="515" data-expected-width="1 15" data-expected-height="115">99 data-offset-x="715" data-offset-y="515" data-expected-width="100" data-expected-height="50"> 100 100 </div> 101 101 </div> … … 106 106 </div> 107 107 <div class="absolute" style="grid-column: 2 / 4; grid-row: 2 / 4;" 108 data-offset-x="415" data-offset-y="265" data-expected-width="4 15" data-expected-height="365">108 data-offset-x="415" data-offset-y="265" data-expected-width="400" data-expected-height="300"> 109 109 </div> 110 110 </div> … … 151 151 </div> 152 152 <div class="absolute" style="grid-column: -4 / 1; grid-row: -4 / 1;" 153 data-offset-x="615" data-offset-y=" 0" data-expected-width="215" data-expected-height="115">153 data-offset-x="615" data-offset-y="65" data-expected-width="100" data-expected-height="50"> 154 154 </div> 155 155 </div> … … 160 160 </div> 161 161 <div class="absolute" style="grid-column: -4 / 2; grid-row: -4 / 2;" 162 data-offset-x="415" data-offset-y=" 0" data-expected-width="415" data-expected-height="265">162 data-offset-x="415" data-offset-y="65" data-expected-width="300" data-expected-height="200"> 163 163 </div> 164 164 </div> … … 169 169 </div> 170 170 <div class="absolute" style="grid-column: 3 / 4; grid-row: 3 / 4;" 171 data-offset-x=" 0" data-offset-y="515" data-expected-width="115" data-expected-height="115">171 data-offset-x="15" data-offset-y="515" data-expected-width="100" data-expected-height="50"> 172 172 </div> 173 173 </div> … … 178 178 </div> 179 179 <div class="absolute" style="grid-column: 2 / 4; grid-row: 2 / 4;" 180 data-offset-x=" 0" data-offset-y="265" data-expected-width="415" data-expected-height="365">180 data-offset-x="15" data-offset-y="265" data-expected-width="400" data-expected-height="300"> 181 181 </div> 182 182 </div> -
trunk/Source/WebCore/ChangeLog
r201543 r201545 1 2016-06-01 Manuel Rego Casasnovas <rego@igalia.com> 2 3 [css-grid] Positioned items can be placed on the implicit grid 4 https://bugs.webkit.org/show_bug.cgi?id=158197 5 6 Reviewed by Sergio Villar Senin. 7 8 The old code wrongly assumed that positioned items couldn't be placed 9 on the implicit grid. However, the spec doesn't mention anything about this. 10 11 The patch fixes this issue, so now positioned items can be actually 12 placed on the implicit tracks. 13 14 Test: fast/css-grid-layout/grid-positioned-items-within-grid-implicit-track.html 15 16 * rendering/RenderGrid.cpp: 17 (WebCore::RenderGrid::offsetAndBreadthForPositionedChild): Use the lines 18 of the implicit grid instead of the explicit one. 19 1 20 2016-05-31 Chris Dumez <cdumez@apple.com> 2 21 -
trunk/Source/WebCore/rendering/RenderGrid.cpp
r201511 r201545 1684 1684 GridPosition startPosition = isRowAxis ? child.style().gridItemColumnStart() : child.style().gridItemRowStart(); 1685 1685 GridPosition endPosition = isRowAxis ? child.style().gridItemColumnEnd() : child.style().gridItemRowEnd(); 1686 int firstExplicitLine = smallestStart; 1687 int lastExplicitLine = (isRowAxis ? GridPositionsResolver::explicitGridColumnCount(style(), autoRepeatCount) : GridPositionsResolver::explicitGridRowCount(style(), autoRepeatCount)) + smallestStart; 1686 int lastLine = isRowAxis ? gridColumnCount() : gridRowCount(); 1688 1687 1689 1688 bool startIsAuto = startPosition.isAuto() 1690 1689 || (startPosition.isNamedGridArea() && !NamedLineCollection::isValidNamedLineOrArea(startPosition.namedGridLine(), style(), (direction == ForColumns) ? ColumnStartSide : RowStartSide)) 1691 || (startLine < firstExplicitLine)1692 || (startLine > last ExplicitLine);1690 || (startLine < 0) 1691 || (startLine > lastLine); 1693 1692 bool endIsAuto = endPosition.isAuto() 1694 1693 || (endPosition.isNamedGridArea() && !NamedLineCollection::isValidNamedLineOrArea(endPosition.namedGridLine(), style(), (direction == ForColumns) ? ColumnEndSide : RowEndSide)) 1695 || (endLine < firstExplicitLine)1696 || (endLine > last ExplicitLine);1694 || (endLine < 0) 1695 || (endLine > lastLine); 1697 1696 1698 1697 // We're normalizing the positions to avoid issues with RTL (as they're stored in the same order than LTR but adding an offset). … … 1719 1718 1720 1719 // These vectors store line positions including gaps, but we shouldn't consider them for the edges of the grid. 1721 if (endLine > firstExplicitLine && endLine < lastExplicitLine) {1720 if (endLine > 0 && endLine < lastLine) { 1722 1721 end -= guttersSize(direction, 2); 1723 1722 end -= isRowAxis ? m_offsetBetweenColumns : m_offsetBetweenRows; … … 1736 1735 offset = translateRTLCoordinate(m_columnPositions[endLine]) - borderLogicalLeft(); 1737 1736 1738 if (endLine > firstExplicitLine && endLine < lastExplicitLine) {1737 if (endLine > 0 && endLine < lastLine) { 1739 1738 offset += guttersSize(direction, 2); 1740 1739 offset += isRowAxis ? m_offsetBetweenColumns : m_offsetBetweenRows;
Note: See TracChangeset
for help on using the changeset viewer.