OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 | 225 |
226 if (style()->gridAutoFlow() != AutoFlowNone) { | 226 if (style()->gridAutoFlow() != AutoFlowNone) { |
227 // The grid needs to be recomputed as it might contain auto-placed items
that will change their position. | 227 // The grid needs to be recomputed as it might contain auto-placed items
that will change their position. |
228 dirtyGrid(); | 228 dirtyGrid(); |
229 return; | 229 return; |
230 } | 230 } |
231 | 231 |
232 const RenderBox* childBox = toRenderBox(child); | 232 const RenderBox* childBox = toRenderBox(child); |
233 GridCoordinate coordinate = m_gridItemCoordinate.take(childBox); | 233 GridCoordinate coordinate = m_gridItemCoordinate.take(childBox); |
234 | 234 |
235 for (GridResolvedPosition row = coordinate.rows.resolvedInitialPosition; row
<= coordinate.rows.resolvedFinalPosition; ++row) { | 235 for (GridSpan::iterator row = coordinate.rows.begin(); row != coordinate.row
s.end(); ++row) { |
236 for (GridResolvedPosition column = coordinate.columns.resolvedInitialPos
ition; column <= coordinate.columns.resolvedFinalPosition; ++column) { | 236 for (GridSpan::iterator column = coordinate.columns.begin(); column != c
oordinate.columns.end(); ++column) { |
237 GridCell& cell = m_grid[row.toInt()][column.toInt()]; | 237 GridCell& cell = m_grid[row.toInt()][column.toInt()]; |
238 cell.remove(cell.find(childBox)); | 238 cell.remove(cell.find(childBox)); |
239 } | 239 } |
240 } | 240 } |
241 } | 241 } |
242 | 242 |
243 void RenderGrid::styleDidChange(StyleDifference diff, const RenderStyle* oldStyl
e) | 243 void RenderGrid::styleDidChange(StyleDifference diff, const RenderStyle* oldStyl
e) |
244 { | 244 { |
245 RenderBlock::styleDidChange(diff, oldStyle); | 245 RenderBlock::styleDidChange(diff, oldStyle); |
246 if (!oldStyle) | 246 if (!oldStyle) |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 static bool sortByGridNormalizedFlexValue(const GridTrackForNormalization& track
1, const GridTrackForNormalization& track2) | 493 static bool sortByGridNormalizedFlexValue(const GridTrackForNormalization& track
1, const GridTrackForNormalization& track2) |
494 { | 494 { |
495 return track1.m_normalizedFlexValue < track2.m_normalizedFlexValue; | 495 return track1.m_normalizedFlexValue < track2.m_normalizedFlexValue; |
496 } | 496 } |
497 | 497 |
498 double RenderGrid::computeNormalizedFractionBreadth(Vector<GridTrack>& tracks, c
onst GridSpan& tracksSpan, GridTrackSizingDirection direction, LayoutUnit availa
bleLogicalSpace) const | 498 double RenderGrid::computeNormalizedFractionBreadth(Vector<GridTrack>& tracks, c
onst GridSpan& tracksSpan, GridTrackSizingDirection direction, LayoutUnit availa
bleLogicalSpace) const |
499 { | 499 { |
500 // |availableLogicalSpace| already accounts for the used breadths so no need
to remove it here. | 500 // |availableLogicalSpace| already accounts for the used breadths so no need
to remove it here. |
501 | 501 |
502 Vector<GridTrackForNormalization> tracksForNormalization; | 502 Vector<GridTrackForNormalization> tracksForNormalization; |
503 for (GridResolvedPosition resolvedPosition = tracksSpan.resolvedInitialPosit
ion; resolvedPosition <= tracksSpan.resolvedFinalPosition; ++resolvedPosition) { | 503 for (GridSpan::iterator resolvedPosition = tracksSpan.begin(); resolvedPosit
ion != tracksSpan.end(); ++resolvedPosition) { |
504 const GridTrackSize& trackSize = gridTrackSize(direction, resolvedPositi
on.toInt()); | 504 const GridTrackSize& trackSize = gridTrackSize(direction, resolvedPositi
on.toInt()); |
505 if (!trackSize.maxTrackBreadth().isFlex()) | 505 if (!trackSize.maxTrackBreadth().isFlex()) |
506 continue; | 506 continue; |
507 | 507 |
508 tracksForNormalization.append(GridTrackForNormalization(tracks[resolvedP
osition.toInt()], trackSize.maxTrackBreadth().flex())); | 508 tracksForNormalization.append(GridTrackForNormalization(tracks[resolvedP
osition.toInt()], trackSize.maxTrackBreadth().flex())); |
509 } | 509 } |
510 | 510 |
511 // The function is not called if we don't have <flex> grid tracks | 511 // The function is not called if we don't have <flex> grid tracks |
512 ASSERT(!tracksForNormalization.isEmpty()); | 512 ASSERT(!tracksForNormalization.isEmpty()); |
513 | 513 |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 ASSERT(maximumPositionIndex >= m_grid.size()); | 720 ASSERT(maximumPositionIndex >= m_grid.size()); |
721 const size_t oldRowSize = m_grid.size(); | 721 const size_t oldRowSize = m_grid.size(); |
722 m_grid.grow(maximumPositionIndex + 1); | 722 m_grid.grow(maximumPositionIndex + 1); |
723 for (size_t row = oldRowSize; row < m_grid.size(); ++row) | 723 for (size_t row = oldRowSize; row < m_grid.size(); ++row) |
724 m_grid[row].grow(m_grid[0].size()); | 724 m_grid[row].grow(m_grid[0].size()); |
725 } | 725 } |
726 } | 726 } |
727 | 727 |
728 void RenderGrid::insertItemIntoGrid(RenderBox* child, const GridCoordinate& coor
dinate) | 728 void RenderGrid::insertItemIntoGrid(RenderBox* child, const GridCoordinate& coor
dinate) |
729 { | 729 { |
730 for (GridResolvedPosition row = coordinate.rows.resolvedInitialPosition; row
<= coordinate.rows.resolvedFinalPosition; ++row) { | 730 for (GridSpan::iterator row = coordinate.rows.begin(); row != coordinate.row
s.end(); ++row) { |
731 for (GridResolvedPosition column = coordinate.columns.resolvedInitialPos
ition; column <= coordinate.columns.resolvedFinalPosition; ++column) | 731 for (GridSpan::iterator column = coordinate.columns.begin(); column != c
oordinate.columns.end(); ++column) |
732 m_grid[row.toInt()][column.toInt()].append(child); | 732 m_grid[row.toInt()][column.toInt()].append(child); |
733 } | 733 } |
734 | 734 |
735 m_gridItemCoordinate.set(child, coordinate); | 735 m_gridItemCoordinate.set(child, coordinate); |
736 } | 736 } |
737 | 737 |
738 void RenderGrid::insertItemIntoGrid(RenderBox* child, const GridResolvedPosition
& rowTrack, const GridResolvedPosition& columnTrack) | 738 void RenderGrid::insertItemIntoGrid(RenderBox* child, const GridResolvedPosition
& rowTrack, const GridResolvedPosition& columnTrack) |
739 { | 739 { |
740 const GridSpan& rowSpan = GridResolvedPosition::resolveGridPositionsFromAuto
PlacementPosition(*child, ForRows, rowTrack); | 740 const GridSpan& rowSpan = GridResolvedPosition::resolveGridPositionsFromAuto
PlacementPosition(*child, ForRows, rowTrack); |
741 const GridSpan& columnSpan = GridResolvedPosition::resolveGridPositionsFromA
utoPlacementPosition(*child, ForColumns, columnTrack); | 741 const GridSpan& columnSpan = GridResolvedPosition::resolveGridPositionsFromA
utoPlacementPosition(*child, ForColumns, columnTrack); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBo
x()) { | 800 for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBo
x()) { |
801 populator.collectChild(child); | 801 populator.collectChild(child); |
802 | 802 |
803 // This function bypasses the cache (cachedGridCoordinate()) as it is us
ed to build it. | 803 // This function bypasses the cache (cachedGridCoordinate()) as it is us
ed to build it. |
804 OwnPtr<GridSpan> rowPositions = GridResolvedPosition::resolveGridPositio
nsFromStyle(*style(), *child, ForRows); | 804 OwnPtr<GridSpan> rowPositions = GridResolvedPosition::resolveGridPositio
nsFromStyle(*style(), *child, ForRows); |
805 OwnPtr<GridSpan> columnPositions = GridResolvedPosition::resolveGridPosi
tionsFromStyle(*style(), *child, ForColumns); | 805 OwnPtr<GridSpan> columnPositions = GridResolvedPosition::resolveGridPosi
tionsFromStyle(*style(), *child, ForColumns); |
806 | 806 |
807 // |positions| is 0 if we need to run the auto-placement algorithm. Our
estimation ignores | 807 // |positions| is 0 if we need to run the auto-placement algorithm. Our
estimation ignores |
808 // this case as the auto-placement algorithm will grow the grid as neede
d. | 808 // this case as the auto-placement algorithm will grow the grid as neede
d. |
809 if (rowPositions) | 809 if (rowPositions) |
810 maximumRowIndex = std::max<size_t>(maximumRowIndex, rowPositions->re
solvedFinalPosition.toInt() + 1); | 810 maximumRowIndex = std::max<size_t>(maximumRowIndex, rowPositions->re
solvedFinalPosition.next().toInt()); |
811 if (columnPositions) | 811 if (columnPositions) |
812 maximumColumnIndex = std::max<size_t>(maximumColumnIndex, columnPosi
tions->resolvedFinalPosition.toInt() + 1); | 812 maximumColumnIndex = std::max<size_t>(maximumColumnIndex, columnPosi
tions->resolvedFinalPosition.next().toInt()); |
813 } | 813 } |
814 | 814 |
815 m_grid.grow(maximumRowIndex); | 815 m_grid.grow(maximumRowIndex); |
816 for (size_t i = 0; i < m_grid.size(); ++i) | 816 for (size_t i = 0; i < m_grid.size(); ++i) |
817 m_grid[i].grow(maximumColumnIndex); | 817 m_grid[i].grow(maximumColumnIndex); |
818 } | 818 } |
819 | 819 |
820 void RenderGrid::placeSpecifiedMajorAxisItemsOnGrid(const Vector<RenderBox*>& au
toGridItems) | 820 void RenderGrid::placeSpecifiedMajorAxisItemsOnGrid(const Vector<RenderBox*>& au
toGridItems) |
821 { | 821 { |
822 for (size_t i = 0; i < autoGridItems.size(); ++i) { | 822 for (size_t i = 0; i < autoGridItems.size(); ++i) { |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
960 { | 960 { |
961 ASSERT(m_gridItemCoordinate.contains(gridItem)); | 961 ASSERT(m_gridItemCoordinate.contains(gridItem)); |
962 return m_gridItemCoordinate.get(gridItem); | 962 return m_gridItemCoordinate.get(gridItem); |
963 } | 963 } |
964 | 964 |
965 LayoutUnit RenderGrid::gridAreaBreadthForChild(const RenderBox* child, GridTrack
SizingDirection direction, const Vector<GridTrack>& tracks) const | 965 LayoutUnit RenderGrid::gridAreaBreadthForChild(const RenderBox* child, GridTrack
SizingDirection direction, const Vector<GridTrack>& tracks) const |
966 { | 966 { |
967 const GridCoordinate& coordinate = cachedGridCoordinate(child); | 967 const GridCoordinate& coordinate = cachedGridCoordinate(child); |
968 const GridSpan& span = (direction == ForColumns) ? coordinate.columns : coor
dinate.rows; | 968 const GridSpan& span = (direction == ForColumns) ? coordinate.columns : coor
dinate.rows; |
969 LayoutUnit gridAreaBreadth = 0; | 969 LayoutUnit gridAreaBreadth = 0; |
970 for (GridResolvedPosition trackPosition = span.resolvedInitialPosition; trac
kPosition <= span.resolvedFinalPosition; ++trackPosition) | 970 for (GridSpan::iterator trackPosition = span.begin(); trackPosition != span.
end(); ++trackPosition) |
971 gridAreaBreadth += tracks[trackPosition.toInt()].m_usedBreadth; | 971 gridAreaBreadth += tracks[trackPosition.toInt()].m_usedBreadth; |
972 return gridAreaBreadth; | 972 return gridAreaBreadth; |
973 } | 973 } |
974 | 974 |
975 void RenderGrid::populateGridPositions(const GridSizingData& sizingData) | 975 void RenderGrid::populateGridPositions(const GridSizingData& sizingData) |
976 { | 976 { |
977 m_columnPositions.resize(sizingData.columnTracks.size() + 1); | 977 m_columnPositions.resize(sizingData.columnTracks.size() + 1); |
978 m_columnPositions[0] = borderAndPaddingStart(); | 978 m_columnPositions[0] = borderAndPaddingStart(); |
979 for (size_t i = 0; i < m_columnPositions.size() - 1; ++i) | 979 for (size_t i = 0; i < m_columnPositions.size() - 1; ++i) |
980 m_columnPositions[i + 1] = m_columnPositions[i] + sizingData.columnTrack
s[i].m_usedBreadth; | 980 m_columnPositions[i + 1] = m_columnPositions[i] + sizingData.columnTrack
s[i].m_usedBreadth; |
(...skipping 13 matching lines...) Expand all Loading... |
994 return startOfColumn + marginStartForChild(child); | 994 return startOfColumn + marginStartForChild(child); |
995 } | 995 } |
996 | 996 |
997 LayoutUnit RenderGrid::endOfColumnForChild(const RenderBox* child) const | 997 LayoutUnit RenderGrid::endOfColumnForChild(const RenderBox* child) const |
998 { | 998 { |
999 const GridCoordinate& coordinate = cachedGridCoordinate(child); | 999 const GridCoordinate& coordinate = cachedGridCoordinate(child); |
1000 LayoutUnit startOfColumn = m_columnPositions[coordinate.columns.resolvedInit
ialPosition.toInt()]; | 1000 LayoutUnit startOfColumn = m_columnPositions[coordinate.columns.resolvedInit
ialPosition.toInt()]; |
1001 // The grid items should be inside the grid container's border box, that's w
hy they need to be shifted. | 1001 // The grid items should be inside the grid container's border box, that's w
hy they need to be shifted. |
1002 LayoutUnit columnPosition = startOfColumn + marginStartForChild(child); | 1002 LayoutUnit columnPosition = startOfColumn + marginStartForChild(child); |
1003 | 1003 |
1004 LayoutUnit endOfColumn = m_columnPositions[coordinate.columns.resolvedFinalP
osition.toInt() + 1]; | 1004 LayoutUnit endOfColumn = m_columnPositions[coordinate.columns.resolvedFinalP
osition.next().toInt()]; |
1005 // FIXME: This should account for the grid item's <overflow-position>. | 1005 // FIXME: This should account for the grid item's <overflow-position>. |
1006 return columnPosition + std::max<LayoutUnit>(0, endOfColumn - m_columnPositi
ons[coordinate.columns.resolvedInitialPosition.toInt()] - child->logicalWidth())
; | 1006 return columnPosition + std::max<LayoutUnit>(0, endOfColumn - m_columnPositi
ons[coordinate.columns.resolvedInitialPosition.toInt()] - child->logicalWidth())
; |
1007 } | 1007 } |
1008 | 1008 |
1009 LayoutUnit RenderGrid::columnPositionAlignedWithGridContainerStart(const RenderB
ox* child) const | 1009 LayoutUnit RenderGrid::columnPositionAlignedWithGridContainerStart(const RenderB
ox* child) const |
1010 { | 1010 { |
1011 if (style()->isLeftToRightDirection()) | 1011 if (style()->isLeftToRightDirection()) |
1012 return startOfColumnForChild(child); | 1012 return startOfColumnForChild(child); |
1013 | 1013 |
1014 return endOfColumnForChild(child); | 1014 return endOfColumnForChild(child); |
1015 } | 1015 } |
1016 | 1016 |
1017 LayoutUnit RenderGrid::columnPositionAlignedWithGridContainerEnd(const RenderBox
* child) const | 1017 LayoutUnit RenderGrid::columnPositionAlignedWithGridContainerEnd(const RenderBox
* child) const |
1018 { | 1018 { |
1019 if (!style()->isLeftToRightDirection()) | 1019 if (!style()->isLeftToRightDirection()) |
1020 return startOfColumnForChild(child); | 1020 return startOfColumnForChild(child); |
1021 | 1021 |
1022 return endOfColumnForChild(child); | 1022 return endOfColumnForChild(child); |
1023 } | 1023 } |
1024 | 1024 |
1025 LayoutUnit RenderGrid::centeredColumnPositionForChild(const RenderBox* child) co
nst | 1025 LayoutUnit RenderGrid::centeredColumnPositionForChild(const RenderBox* child) co
nst |
1026 { | 1026 { |
1027 const GridCoordinate& coordinate = cachedGridCoordinate(child); | 1027 const GridCoordinate& coordinate = cachedGridCoordinate(child); |
1028 LayoutUnit startOfColumn = m_columnPositions[coordinate.columns.resolvedInit
ialPosition.toInt()]; | 1028 LayoutUnit startOfColumn = m_columnPositions[coordinate.columns.resolvedInit
ialPosition.toInt()]; |
1029 LayoutUnit endOfColumn = m_columnPositions[coordinate.columns.resolvedFinalP
osition.toInt() + 1]; | 1029 LayoutUnit endOfColumn = m_columnPositions[coordinate.columns.resolvedFinalP
osition.next().toInt()]; |
1030 LayoutUnit columnPosition = startOfColumn + marginStartForChild(child); | 1030 LayoutUnit columnPosition = startOfColumn + marginStartForChild(child); |
1031 return columnPosition + std::max<LayoutUnit>(0, endOfColumn - startOfColumn
- child->logicalWidth()) / 2; | 1031 return columnPosition + std::max<LayoutUnit>(0, endOfColumn - startOfColumn
- child->logicalWidth()) / 2; |
1032 } | 1032 } |
1033 | 1033 |
1034 LayoutUnit RenderGrid::columnPositionForChild(const RenderBox* child) const | 1034 LayoutUnit RenderGrid::columnPositionForChild(const RenderBox* child) const |
1035 { | 1035 { |
1036 ItemPosition childJustifySelf = child->style()->justifySelf(); | 1036 ItemPosition childJustifySelf = child->style()->justifySelf(); |
1037 switch (childJustifySelf) { | 1037 switch (childJustifySelf) { |
1038 case ItemPositionSelfStart: | 1038 case ItemPositionSelfStart: |
1039 // self-start is based on the child's direction. That's why we need to c
heck against the grid container's direction. | 1039 // self-start is based on the child's direction. That's why we need to c
heck against the grid container's direction. |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1111 static GridSpan dirtiedGridAreas(const Vector<LayoutUnit>& coordinates, LayoutUn
it start, LayoutUnit end) | 1111 static GridSpan dirtiedGridAreas(const Vector<LayoutUnit>& coordinates, LayoutUn
it start, LayoutUnit end) |
1112 { | 1112 { |
1113 // This function does a binary search over the coordinates. | 1113 // This function does a binary search over the coordinates. |
1114 // FIXME: This doesn't work with grid items overflowing their grid areas and
should be tested & fixed. | 1114 // FIXME: This doesn't work with grid items overflowing their grid areas and
should be tested & fixed. |
1115 | 1115 |
1116 size_t startGridAreaIndex = std::upper_bound(coordinates.begin(), coordinate
s.end() - 1, start) - coordinates.begin(); | 1116 size_t startGridAreaIndex = std::upper_bound(coordinates.begin(), coordinate
s.end() - 1, start) - coordinates.begin(); |
1117 if (startGridAreaIndex > 0) | 1117 if (startGridAreaIndex > 0) |
1118 --startGridAreaIndex; | 1118 --startGridAreaIndex; |
1119 | 1119 |
1120 size_t endGridAreaIndex = std::upper_bound(coordinates.begin() + startGridAr
eaIndex, coordinates.end() - 1, end) - coordinates.begin(); | 1120 size_t endGridAreaIndex = std::upper_bound(coordinates.begin() + startGridAr
eaIndex, coordinates.end() - 1, end) - coordinates.begin(); |
| 1121 if (endGridAreaIndex > 0) |
| 1122 --endGridAreaIndex; |
| 1123 |
1121 return GridSpan(startGridAreaIndex, endGridAreaIndex); | 1124 return GridSpan(startGridAreaIndex, endGridAreaIndex); |
1122 } | 1125 } |
1123 | 1126 |
1124 class GridCoordinateSorter { | 1127 class GridCoordinateSorter { |
1125 public: | 1128 public: |
1126 GridCoordinateSorter(RenderGrid* renderer) : m_renderer(renderer) { } | 1129 GridCoordinateSorter(RenderGrid* renderer) : m_renderer(renderer) { } |
1127 | 1130 |
1128 bool operator()(const RenderBox* firstItem, const RenderBox* secondItem) con
st | 1131 bool operator()(const RenderBox* firstItem, const RenderBox* secondItem) con
st |
1129 { | 1132 { |
1130 GridCoordinate first = m_renderer->cachedGridCoordinate(firstItem); | 1133 GridCoordinate first = m_renderer->cachedGridCoordinate(firstItem); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1173 { | 1176 { |
1174 OrderIteratorPopulator populator(paintIterator); | 1177 OrderIteratorPopulator populator(paintIterator); |
1175 Vector<RenderBox*>::const_iterator overflowIterator = m_gridItemsOverflo
wingGridArea.begin(); | 1178 Vector<RenderBox*>::const_iterator overflowIterator = m_gridItemsOverflo
wingGridArea.begin(); |
1176 Vector<RenderBox*>::const_iterator end = m_gridItemsOverflowingGridArea.
end(); | 1179 Vector<RenderBox*>::const_iterator end = m_gridItemsOverflowingGridArea.
end(); |
1177 | 1180 |
1178 for (; overflowIterator != end && rowIsBeforeDirtyArea(cachedGridCoordin
ate(*overflowIterator), dirtiedRows); ++overflowIterator) { | 1181 for (; overflowIterator != end && rowIsBeforeDirtyArea(cachedGridCoordin
ate(*overflowIterator), dirtiedRows); ++overflowIterator) { |
1179 if ((*overflowIterator)->frameRect().intersects(localRepaintRect)) | 1182 if ((*overflowIterator)->frameRect().intersects(localRepaintRect)) |
1180 populator.storeChild(*overflowIterator); | 1183 populator.storeChild(*overflowIterator); |
1181 } | 1184 } |
1182 | 1185 |
1183 for (GridResolvedPosition row = dirtiedRows.resolvedInitialPosition; row
< dirtiedRows.resolvedFinalPosition; ++row) { | 1186 for (GridSpan::iterator row = dirtiedRows.begin(); row != dirtiedRows.en
d(); ++row) { |
1184 | 1187 |
1185 for (; overflowIterator != end && isInSameRowBeforeDirtyArea(cachedG
ridCoordinate(*overflowIterator), row, dirtiedColumns); ++overflowIterator) { | 1188 for (; overflowIterator != end && isInSameRowBeforeDirtyArea(cachedG
ridCoordinate(*overflowIterator), row, dirtiedColumns); ++overflowIterator) { |
1186 if ((*overflowIterator)->frameRect().intersects(localRepaintRect
)) | 1189 if ((*overflowIterator)->frameRect().intersects(localRepaintRect
)) |
1187 populator.storeChild(*overflowIterator); | 1190 populator.storeChild(*overflowIterator); |
1188 } | 1191 } |
1189 | 1192 |
1190 for (GridResolvedPosition column = dirtiedColumns.resolvedInitialPos
ition; column < dirtiedColumns.resolvedFinalPosition; ++column) { | 1193 for (GridSpan::iterator column = dirtiedColumns.begin(); column != d
irtiedColumns.end(); ++column) { |
1191 const Vector<RenderBox*, 1>& children = m_grid[row.toInt()][colu
mn.toInt()]; | 1194 const Vector<RenderBox*, 1>& children = m_grid[row.toInt()][colu
mn.toInt()]; |
1192 // FIXME: If we start adding spanning children in all grid areas
they span, this | 1195 // FIXME: If we start adding spanning children in all grid areas
they span, this |
1193 // would make us paint them several times, which is wrong! | 1196 // would make us paint them several times, which is wrong! |
1194 for (size_t j = 0; j < children.size(); ++j) { | 1197 for (size_t j = 0; j < children.size(); ++j) { |
1195 populator.storeChild(children[j]); | 1198 populator.storeChild(children[j]); |
1196 // Do not paint overflowing grid items twice. | 1199 // Do not paint overflowing grid items twice. |
1197 if (overflowIterator != end && *overflowIterator == children
[j]) | 1200 if (overflowIterator != end && *overflowIterator == children
[j]) |
1198 ++overflowIterator; | 1201 ++overflowIterator; |
1199 } | 1202 } |
1200 } | 1203 } |
(...skipping 21 matching lines...) Expand all Loading... |
1222 if (isOutOfFlowPositioned()) | 1225 if (isOutOfFlowPositioned()) |
1223 return "RenderGrid (positioned)"; | 1226 return "RenderGrid (positioned)"; |
1224 if (isAnonymous()) | 1227 if (isAnonymous()) |
1225 return "RenderGrid (generated)"; | 1228 return "RenderGrid (generated)"; |
1226 if (isRelPositioned()) | 1229 if (isRelPositioned()) |
1227 return "RenderGrid (relative positioned)"; | 1230 return "RenderGrid (relative positioned)"; |
1228 return "RenderGrid"; | 1231 return "RenderGrid"; |
1229 } | 1232 } |
1230 | 1233 |
1231 } // namespace WebCore | 1234 } // namespace WebCore |
OLD | NEW |