Changeset 178895 in webkit
- Timestamp:
- Jan 22, 2015 12:56:13 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r178894 r178895 1 2015-01-21 Sergio Villar Senin <svillar@igalia.com> 2 3 [CSS Grid Layout] Skip items spanning flex tracks when sizing content based tracks 4 https://bugs.webkit.org/show_bug.cgi?id=140720 5 6 Reviewed by David Hyatt. 7 8 * fast/css-grid-layout/flex-and-content-sized-resolution-columns-expected.txt: Added. 9 * fast/css-grid-layout/flex-and-content-sized-resolution-columns.html: Added. 10 1 11 2015-01-22 Yusuke Suzuki <utatane.tea@gmail.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r178894 r178895 1 2015-01-21 Sergio Villar Senin <svillar@igalia.com> 2 3 [CSS Grid Layout] Skip items spanning flex tracks when sizing content based tracks 4 https://bugs.webkit.org/show_bug.cgi?id=140720 5 6 Reviewed by David Hyatt. 7 8 Section "11.5. Resolve Intrinsic Track Sizes" of the specs forces 9 us to ignore items spanning tracks with flex sizing functions when 10 resolving the content-based track sizing functions. Items with 11 span < 2 are not affected by this rule (as they will belong to a 12 single track). This way the algorithm ensures that min-content and 13 max-content restrictions are fulfilled before distributing the 14 extra space. 15 16 Test: fast/css-grid-layout/flex-and-content-sized-resolution-columns.html 17 18 * rendering/RenderGrid.cpp: 19 (WebCore::RenderGrid::spanningItemCrossesFlexibleSizedTracks): 20 (WebCore::integerSpanForDirection): 21 (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions): 22 * rendering/RenderGrid.h: 23 1 24 2015-01-22 Yusuke Suzuki <utatane.tea@gmail.com> 2 25 -
trunk/Source/WebCore/rendering/RenderGrid.cpp
r178893 r178895 560 560 }; 561 561 562 bool RenderGrid::spanningItemCrossesFlexibleSizedTracks(const GridCoordinate& coordinate, GridTrackSizingDirection direction) const 563 { 564 const GridSpan itemSpan = (direction == ForColumns) ? coordinate.columns : coordinate.rows; 565 for (auto trackPosition : itemSpan) { 566 const GridTrackSize& trackSize = gridTrackSize(direction, trackPosition.toInt()); 567 if (trackSize.minTrackBreadth().isFlex() || trackSize.maxTrackBreadth().isFlex()) 568 return true; 569 } 570 571 return false; 572 } 573 574 static inline unsigned integerSpanForDirection(const GridCoordinate& coordinate, GridTrackSizingDirection direction) 575 { 576 return (direction == ForRows) ? coordinate.rows.integerSpan() : coordinate.columns.integerSpan(); 577 } 578 562 579 void RenderGrid::resolveContentBasedTrackSizingFunctions(GridTrackSizingDirection direction, GridSizingData& sizingData) 563 580 { 564 // FIXME: Split the grid tracks into groups that doesn't overlap a <flex> grid track.565 581 sizingData.itemsSortedByIncreasingSpan.shrink(0); 566 582 HashSet<RenderBox*> itemsSet; … … 569 585 570 586 while (RenderBox* gridItem = iterator.nextGridItem()) { 571 if (itemsSet.add(gridItem).isNewEntry) 572 sizingData.itemsSortedByIncreasingSpan.append(GridItemWithSpan(*gridItem, cachedGridCoordinate(*gridItem), direction)); 587 if (itemsSet.add(gridItem).isNewEntry) { 588 const GridCoordinate& coordinate = cachedGridCoordinate(*gridItem); 589 // We should not include items spanning more than one track that span tracks with flexible sizing functions. 590 if (integerSpanForDirection(coordinate, direction) == 1 || !spanningItemCrossesFlexibleSizedTracks(coordinate, direction)) 591 sizingData.itemsSortedByIncreasingSpan.append(GridItemWithSpan(*gridItem, coordinate, direction)); 592 } 573 593 } 574 594 } -
trunk/Source/WebCore/rendering/RenderGrid.h
r177259 r178895 115 115 bool gridWasPopulated() const { return !m_grid.isEmpty() && !m_grid[0].isEmpty(); } 116 116 117 bool spanningItemCrossesFlexibleSizedTracks(const GridCoordinate&, GridTrackSizingDirection) const; 118 117 119 unsigned gridColumnCount() const 118 120 {
Note: See TracChangeset
for help on using the changeset viewer.