| 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 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 } | 557 } |
| 558 | 558 |
| 559 size_t RenderGrid::explicitGridSizeForSide(GridPositionSide side) const | 559 size_t RenderGrid::explicitGridSizeForSide(GridPositionSide side) const |
| 560 { | 560 { |
| 561 return (side == ColumnStartSide || side == ColumnEndSide) ? explicitGridColu
mnCount() : explicitGridRowCount(); | 561 return (side == ColumnStartSide || side == ColumnEndSide) ? explicitGridColu
mnCount() : explicitGridRowCount(); |
| 562 } | 562 } |
| 563 | 563 |
| 564 LayoutUnit RenderGrid::logicalContentHeightForChild(RenderBox* child, Vector<Gri
dTrack>& columnTracks) | 564 LayoutUnit RenderGrid::logicalContentHeightForChild(RenderBox* child, Vector<Gri
dTrack>& columnTracks) |
| 565 { | 565 { |
| 566 SubtreeLayoutScope layoutScope(child); | 566 SubtreeLayoutScope layoutScope(child); |
| 567 if (child->style()->logicalHeight().isPercent()) | 567 LayoutUnit oldOverrideContainingBlockContentLogicalWidth = child->hasOverrid
eContainingBlockLogicalWidth() ? child->overrideContainingBlockContentLogicalWid
th() : LayoutUnit(); |
| 568 LayoutUnit overrideContainingBlockContentLogicalWidth = gridAreaBreadthForCh
ild(child, ForColumns, columnTracks); |
| 569 if (child->style()->logicalHeight().isPercent() || oldOverrideContainingBloc
kContentLogicalWidth != overrideContainingBlockContentLogicalWidth) |
| 568 layoutScope.setNeedsLayout(child); | 570 layoutScope.setNeedsLayout(child); |
| 569 | 571 |
| 570 child->setOverrideContainingBlockContentLogicalWidth(gridAreaBreadthForChild
(child, ForColumns, columnTracks)); | 572 child->setOverrideContainingBlockContentLogicalWidth(overrideContainingBlock
ContentLogicalWidth); |
| 571 // If |child| has a percentage logical height, we shouldn't let it override
its intrinsic height, which is | 573 // If |child| has a percentage logical height, we shouldn't let it override
its intrinsic height, which is |
| 572 // what we are interested in here. Thus we need to set the override logical
height to -1 (no possible resolution). | 574 // what we are interested in here. Thus we need to set the override logical
height to -1 (no possible resolution). |
| 573 child->setOverrideContainingBlockContentLogicalHeight(-1); | 575 child->setOverrideContainingBlockContentLogicalHeight(-1); |
| 574 child->layoutIfNeeded(); | 576 child->layoutIfNeeded(); |
| 575 return child->logicalHeight(); | 577 return child->logicalHeight(); |
| 576 } | 578 } |
| 577 | 579 |
| 578 LayoutUnit RenderGrid::minContentForChild(RenderBox* child, GridTrackSizingDirec
tion direction, Vector<GridTrack>& columnTracks) | 580 LayoutUnit RenderGrid::minContentForChild(RenderBox* child, GridTrackSizingDirec
tion direction, Vector<GridTrack>& columnTracks) |
| 579 { | 581 { |
| 580 bool hasOrthogonalWritingMode = child->isHorizontalWritingMode() != isHorizo
ntalWritingMode(); | 582 bool hasOrthogonalWritingMode = child->isHorizontalWritingMode() != isHorizo
ntalWritingMode(); |
| (...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1318 if (isOutOfFlowPositioned()) | 1320 if (isOutOfFlowPositioned()) |
| 1319 return "RenderGrid (positioned)"; | 1321 return "RenderGrid (positioned)"; |
| 1320 if (isAnonymous()) | 1322 if (isAnonymous()) |
| 1321 return "RenderGrid (generated)"; | 1323 return "RenderGrid (generated)"; |
| 1322 if (isRelPositioned()) | 1324 if (isRelPositioned()) |
| 1323 return "RenderGrid (relative positioned)"; | 1325 return "RenderGrid (relative positioned)"; |
| 1324 return "RenderGrid"; | 1326 return "RenderGrid"; |
| 1325 } | 1327 } |
| 1326 | 1328 |
| 1327 } // namespace WebCore | 1329 } // namespace WebCore |
| OLD | NEW |