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 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
737 } | 737 } |
738 } | 738 } |
739 | 739 |
740 for (size_t i = 0; i < tracksSize; ++i) { | 740 for (size_t i = 0; i < tracksSize; ++i) { |
741 LayoutUnit growth = sizingData.distributeTrackVector[i] - (tracks[i]->*t
rackGetter)(); | 741 LayoutUnit growth = sizingData.distributeTrackVector[i] - (tracks[i]->*t
rackGetter)(); |
742 if (growth >= 0) | 742 if (growth >= 0) |
743 (tracks[i]->*trackGrowthFunction)(growth); | 743 (tracks[i]->*trackGrowthFunction)(growth); |
744 } | 744 } |
745 } | 745 } |
746 | 746 |
747 #ifndef NDEBUG | 747 #if ENABLE(ASSERT) |
748 bool RenderGrid::tracksAreWiderThanMinTrackBreadth(GridTrackSizingDirection dire
ction, const Vector<GridTrack>& tracks) | 748 bool RenderGrid::tracksAreWiderThanMinTrackBreadth(GridTrackSizingDirection dire
ction, const Vector<GridTrack>& tracks) |
749 { | 749 { |
750 for (size_t i = 0; i < tracks.size(); ++i) { | 750 for (size_t i = 0; i < tracks.size(); ++i) { |
751 const GridTrackSize& trackSize = gridTrackSize(direction, i); | 751 const GridTrackSize& trackSize = gridTrackSize(direction, i); |
752 const GridLength& minTrackBreadth = trackSize.minTrackBreadth(); | 752 const GridLength& minTrackBreadth = trackSize.minTrackBreadth(); |
753 if (computeUsedBreadthOfMinLength(direction, minTrackBreadth) > tracks[i
].m_usedBreadth) | 753 if (computeUsedBreadthOfMinLength(direction, minTrackBreadth) > tracks[i
].m_usedBreadth) |
754 return false; | 754 return false; |
755 } | 755 } |
756 return true; | 756 return true; |
757 } | 757 } |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1013 layoutScope.setNeedsLayout(child); | 1013 layoutScope.setNeedsLayout(child); |
1014 | 1014 |
1015 child->setOverrideContainingBlockContentLogicalWidth(overrideContainingB
lockContentLogicalWidth); | 1015 child->setOverrideContainingBlockContentLogicalWidth(overrideContainingB
lockContentLogicalWidth); |
1016 child->setOverrideContainingBlockContentLogicalHeight(overrideContaining
BlockContentLogicalHeight); | 1016 child->setOverrideContainingBlockContentLogicalHeight(overrideContaining
BlockContentLogicalHeight); |
1017 | 1017 |
1018 // FIXME: Grid items should stretch to fill their cells. Once we | 1018 // FIXME: Grid items should stretch to fill their cells. Once we |
1019 // implement grid-{column,row}-align, we can also shrink to fit. For | 1019 // implement grid-{column,row}-align, we can also shrink to fit. For |
1020 // now, just size as if we were a regular child. | 1020 // now, just size as if we were a regular child. |
1021 child->layoutIfNeeded(); | 1021 child->layoutIfNeeded(); |
1022 | 1022 |
1023 #ifndef NDEBUG | 1023 #if ENABLE(ASSERT) |
1024 const GridCoordinate& coordinate = cachedGridCoordinate(child); | 1024 const GridCoordinate& coordinate = cachedGridCoordinate(child); |
1025 ASSERT(coordinate.columns.resolvedInitialPosition.toInt() < sizingData.c
olumnTracks.size()); | 1025 ASSERT(coordinate.columns.resolvedInitialPosition.toInt() < sizingData.c
olumnTracks.size()); |
1026 ASSERT(coordinate.rows.resolvedInitialPosition.toInt() < sizingData.rowT
racks.size()); | 1026 ASSERT(coordinate.rows.resolvedInitialPosition.toInt() < sizingData.rowT
racks.size()); |
1027 #endif | 1027 #endif |
1028 child->setLogicalLocation(findChildLogicalPosition(child)); | 1028 child->setLogicalLocation(findChildLogicalPosition(child)); |
1029 | 1029 |
1030 // Keep track of children overflowing their grid area as we might need t
o paint them even if the grid-area is | 1030 // Keep track of children overflowing their grid area as we might need t
o paint them even if the grid-area is |
1031 // not visible | 1031 // not visible |
1032 if (child->logicalHeight() > overrideContainingBlockContentLogicalHeight | 1032 if (child->logicalHeight() > overrideContainingBlockContentLogicalHeight |
1033 || child->logicalWidth() > overrideContainingBlockContentLogicalWidt
h) | 1033 || child->logicalWidth() > overrideContainingBlockContentLogicalWidt
h) |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1378 if (isOutOfFlowPositioned()) | 1378 if (isOutOfFlowPositioned()) |
1379 return "RenderGrid (positioned)"; | 1379 return "RenderGrid (positioned)"; |
1380 if (isAnonymous()) | 1380 if (isAnonymous()) |
1381 return "RenderGrid (generated)"; | 1381 return "RenderGrid (generated)"; |
1382 if (isRelPositioned()) | 1382 if (isRelPositioned()) |
1383 return "RenderGrid (relative positioned)"; | 1383 return "RenderGrid (relative positioned)"; |
1384 return "RenderGrid"; | 1384 return "RenderGrid"; |
1385 } | 1385 } |
1386 | 1386 |
1387 } // namespace WebCore | 1387 } // namespace WebCore |
OLD | NEW |