Changeset 199981 in webkit
- Timestamp:
- Apr 25, 2016 2:54:48 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r199980 r199981 1 2016-04-25 Manuel Rego Casasnovas <rego@igalia.com> 2 3 [css-grid] Fix grid-template-columns|rows computed style with content alignment 4 https://bugs.webkit.org/show_bug.cgi?id=156793 5 6 Reviewed by Darin Adler. 7 8 * fast/css-grid-layout/grid-template-columns-rows-computed-style-gaps-content-alignment-expected.txt: Added. 9 * fast/css-grid-layout/grid-template-columns-rows-computed-style-gaps-content-alignment.html: Added. 10 1 11 2016-04-25 Frederic Wang <fwang@igalia.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r199980 r199981 1 2016-04-25 Manuel Rego Casasnovas <rego@igalia.com> 2 3 [css-grid] Fix grid-template-columns|rows computed style with content alignment 4 https://bugs.webkit.org/show_bug.cgi?id=156793 5 6 Reviewed by Darin Adler. 7 8 Computed style of grid-template-columns and grid-template-rows properties 9 was including the distribution offset because of content alignment. 10 We should subtract that offset, like we do for the case of gaps, 11 when we're calculating the computed style. 12 13 Test: fast/css-grid-layout/grid-template-columns-rows-computed-style-gaps-content-alignment.html 14 15 * css/CSSComputedStyleDeclaration.cpp: 16 (WebCore::valueForGridTrackList): 17 * rendering/RenderGrid.cpp: 18 (WebCore::RenderGrid::offsetBetweenTracks): 19 (WebCore::RenderGrid::populateGridPositions): Deleted FIXME. 20 * rendering/RenderGrid.h: 21 1 22 2016-04-25 Frederic Wang <fwang@igalia.com> 2 23 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r199964 r199981 1071 1071 unsigned insertionIndex; 1072 1072 if (isRenderGrid) { 1073 const Vector<LayoutUnit>& trackPositions = direction == ForColumns ? downcast<RenderGrid>(*renderer).columnPositions() : downcast<RenderGrid>(*renderer).rowPositions(); 1073 auto& grid = downcast<RenderGrid>(*renderer); 1074 const auto& trackPositions = direction == ForColumns ? grid.columnPositions() : grid.rowPositions(); 1074 1075 // There are at least #tracks + 1 grid lines (trackPositions). Apart from that, the grid container can generate implicit grid tracks, 1075 1076 // so we'll have more trackPositions than trackSizes as the latter only contain the explicit grid. … … 1077 1078 1078 1079 unsigned i = 0; 1079 LayoutUnit gutterSize = downcast<RenderGrid>(*renderer).guttersSize(direction, 2); 1080 LayoutUnit gutterSize = grid.guttersSize(direction, 2); 1081 LayoutUnit offsetBetweenTracks = grid.offsetBetweenTracks(direction); 1080 1082 for (; i < trackPositions.size() - 2; ++i) { 1081 1083 addValuesForNamedGridLinesAtIndex(orderedNamedGridLines, i, list.get()); 1082 list.get().append(zoomAdjustedPixelValue(trackPositions[i + 1] - trackPositions[i] - gutterSize , style));1083 } 1084 // Last track line does not have any gutter .1084 list.get().append(zoomAdjustedPixelValue(trackPositions[i + 1] - trackPositions[i] - gutterSize - offsetBetweenTracks, style)); 1085 } 1086 // Last track line does not have any gutter or distribution offset. 1085 1087 addValuesForNamedGridLinesAtIndex(orderedNamedGridLines, i, list.get()); 1086 1088 list.get().append(zoomAdjustedPixelValue(trackPositions[i + 1] - trackPositions[i], style)); -
trunk/Source/WebCore/rendering/RenderGrid.cpp
r199964 r199981 429 429 } 430 430 431 LayoutUnit RenderGrid::offsetBetweenTracks(GridTrackSizingDirection direction) const 432 { 433 return direction == ForColumns ? m_offsetBetweenColumns : m_offsetBetweenRows; 434 } 435 431 436 void RenderGrid::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const 432 437 { … … 1647 1652 // assume from now on that we just store positions of the initial grid lines of each track, 1648 1653 // except the last one, which is the only one considered as a final grid line of a track. 1649 // FIXME: This will affect the computed style value of grid tracks size, since we are1650 // using these positions to compute them.1651 1654 1652 1655 // The grid container's frame elements (border, padding and <content-position> offset) are sensible to the -
trunk/Source/WebCore/rendering/RenderGrid.h
r199964 r199981 62 62 63 63 LayoutUnit guttersSize(GridTrackSizingDirection, size_t span) const; 64 LayoutUnit offsetBetweenTracks(GridTrackSizingDirection) const; 64 65 65 66 private:
Note: See TracChangeset
for help on using the changeset viewer.