Changeset 180003 in webkit for trunk/Source/WebCore/rendering/RenderGrid.cpp
- Timestamp:
- Feb 12, 2015, 12:00:50 PM (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
r179987 r180003 585 585 RenderBox& gridItem() const { return m_gridItem; } 586 586 GridCoordinate coordinate() const { return m_coordinate; } 587 #if !ASSERT_DISABLED588 size_t span() const { return m_span; }589 #endif590 587 591 588 bool operator<(const GridItemWithSpan other) const … … 623 620 for (auto trackIndex : sizingData.contentSizedTracksIndex) { 624 621 GridIterator iterator(m_grid, direction, trackIndex); 625 GridTrack& track = (direction == ForColumns) ? sizingData.columnTracks[trackIndex] : sizingData.rowTracks[trackIndex];626 622 627 623 while (RenderBox* gridItem = iterator.nextGridItem()) { 628 624 if (itemsSet.add(gridItem).isNewEntry) { 629 625 const GridCoordinate& coordinate = cachedGridCoordinate(*gridItem); 630 if (integerSpanForDirection(coordinate, direction) == 1) 631 resolveContentBasedTrackSizingFunctionsForNonSpanningItems(direction, coordinate, *gridItem, track, sizingData.columnTracks); 632 else if (!spanningItemCrossesFlexibleSizedTracks(coordinate, direction)) 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)) 633 628 sizingData.itemsSortedByIncreasingSpan.append(GridItemWithSpan(*gridItem, coordinate, direction)); 634 629 } … … 651 646 } 652 647 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 669 648 void RenderGrid::resolveContentBasedTrackSizingFunctionsForItems(GridTrackSizingDirection direction, GridSizingData& sizingData, GridItemWithSpan& gridItemWithSpan, FilterFunction filterFunction, SizingFunction sizingFunction, AccumulatorGetter trackGetter, AccumulatorGrowFunction trackGrowthFunction, FilterFunction growAboveMaxBreadthFilterFunction) 670 649 { 671 ASSERT(gridItemWithSpan.span() > 1);672 650 const GridCoordinate& coordinate = gridItemWithSpan.coordinate(); 673 651 const GridResolvedPosition initialTrackPosition = (direction == ForColumns) ? coordinate.columns.resolvedInitialPosition : coordinate.rows.resolvedInitialPosition;
Note:
See TracChangeset
for help on using the changeset viewer.