Changeset 180142 in webkit for trunk/Source/WebCore/rendering/RenderGrid.cpp
- Timestamp:
- Feb 16, 2015, 4:00:17 AM (11 years ago)
- File:
-
- 1 edited
-
trunk/Source/WebCore/rendering/RenderGrid.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/rendering/RenderGrid.cpp
r180050 r180142 585 585 RenderBox& gridItem() const { return m_gridItem; } 586 586 GridCoordinate coordinate() const { return m_coordinate; } 587 #if !ASSERT_DISABLED 588 size_t span() const { return m_span; } 589 #endif 587 590 588 591 bool operator<(const GridItemWithSpan other) const … … 620 623 for (auto trackIndex : sizingData.contentSizedTracksIndex) { 621 624 GridIterator iterator(m_grid, direction, trackIndex); 625 GridTrack& track = (direction == ForColumns) ? sizingData.columnTracks[trackIndex] : sizingData.rowTracks[trackIndex]; 622 626 623 627 while (RenderBox* gridItem = iterator.nextGridItem()) { 624 628 if (itemsSet.add(gridItem).isNewEntry) { 625 629 const GridCoordinate& coordinate = cachedGridCoordinate(*gridItem); 626 // We should not include items spanning more than one track that span tracks with flexible sizing functions. 627 if (integerSpanForDirection(coordinate, direction) == 1 || !spanningItemCrossesFlexibleSizedTracks(coordinate, direction)) 630 if (integerSpanForDirection(coordinate, direction) == 1) 631 resolveContentBasedTrackSizingFunctionsForNonSpanningItems(direction, coordinate, *gridItem, track, sizingData.columnTracks); 632 else if (!spanningItemCrossesFlexibleSizedTracks(coordinate, direction)) 628 633 sizingData.itemsSortedByIncreasingSpan.append(GridItemWithSpan(*gridItem, coordinate, direction)); 629 634 } … … 646 651 } 647 652 653 void RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems(GridTrackSizingDirection direction, const GridCoordinate& coordinate, RenderBox& gridItem, GridTrack& track, Vector<GridTrack>& columnTracks) 654 { 655 const GridResolvedPosition trackPosition = (direction == ForColumns) ? coordinate.columns.resolvedInitialPosition : coordinate.rows.resolvedInitialPosition; 656 GridTrackSize trackSize = gridTrackSize(direction, trackPosition.toInt()); 657 658 if (trackSize.hasMinContentMinTrackBreadth()) 659 track.setBaseSize(std::max(track.baseSize(), minContentForChild(gridItem, direction, columnTracks))); 660 else if (trackSize.hasMaxContentMinTrackBreadth()) 661 track.setBaseSize(std::max(track.baseSize(), maxContentForChild(gridItem, direction, columnTracks))); 662 663 if (trackSize.hasMinContentMaxTrackBreadth()) 664 track.setGrowthLimit(std::max(track.growthLimit(), minContentForChild(gridItem, direction, columnTracks))); 665 else if (trackSize.hasMaxContentMaxTrackBreadth()) 666 track.setGrowthLimit(std::max(track.growthLimit(), maxContentForChild(gridItem, direction, columnTracks))); 667 } 668 648 669 void RenderGrid::resolveContentBasedTrackSizingFunctionsForItems(GridTrackSizingDirection direction, GridSizingData& sizingData, GridItemWithSpan& gridItemWithSpan, FilterFunction filterFunction, SizingFunction sizingFunction, AccumulatorGetter trackGetter, AccumulatorGrowFunction trackGrowthFunction, FilterFunction growAboveMaxBreadthFilterFunction) 649 670 { 671 ASSERT(gridItemWithSpan.span() > 1); 650 672 const GridCoordinate& coordinate = gridItemWithSpan.coordinate(); 651 673 const GridResolvedPosition initialTrackPosition = (direction == ForColumns) ? coordinate.columns.resolvedInitialPosition : coordinate.rows.resolvedInitialPosition;
Note:
See TracChangeset
for help on using the changeset viewer.