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 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
556 } | 556 } |
557 | 557 |
558 size_t RenderGrid::explicitGridSizeForSide(GridPositionSide side) const | 558 size_t RenderGrid::explicitGridSizeForSide(GridPositionSide side) const |
559 { | 559 { |
560 return (side == ColumnStartSide || side == ColumnEndSide) ? explicitGridColu mnCount() : explicitGridRowCount(); | 560 return (side == ColumnStartSide || side == ColumnEndSide) ? explicitGridColu mnCount() : explicitGridRowCount(); |
561 } | 561 } |
562 | 562 |
563 LayoutUnit RenderGrid::logicalContentHeightForChild(RenderBox* child, Vector<Gri dTrack>& columnTracks) | 563 LayoutUnit RenderGrid::logicalContentHeightForChild(RenderBox* child, Vector<Gri dTrack>& columnTracks) |
564 { | 564 { |
565 SubtreeLayoutScope layoutScope(child); | 565 SubtreeLayoutScope layoutScope(child); |
566 if (child->style()->logicalHeight().isPercent()) | 566 LayoutUnit oldOverrideContainingBlockContentLogicalWidth = child->hasOverrid eContainingBlockLogicalWidth() ? child->overrideContainingBlockContentLogicalWid th() : LayoutUnit(); |
567 LayoutUnit overrideContainingBlockContentLogicalWidth = gridAreaBreadthForCh ild(child, ForColumns, columnTracks); | |
568 if (child->style()->logicalHeight().isPercent() || oldOverrideContainingBloc kContentLogicalWidth != overrideContainingBlockContentLogicalWidth) | |
Julien - ping for review
2014/01/29 02:14:08
Quick question: why is this check in logicalConten
| |
567 layoutScope.setNeedsLayout(child); | 569 layoutScope.setNeedsLayout(child); |
568 | 570 |
569 child->setOverrideContainingBlockContentLogicalWidth(gridAreaBreadthForChild (child, ForColumns, columnTracks)); | 571 child->setOverrideContainingBlockContentLogicalWidth(overrideContainingBlock ContentLogicalWidth); |
570 // If |child| has a percentage logical height, we shouldn't let it override its intrinsic height, which is | 572 // If |child| has a percentage logical height, we shouldn't let it override its intrinsic height, which is |
571 // what we are interested in here. Thus we need to set the override logical height to -1 (no possible resolution). | 573 // what we are interested in here. Thus we need to set the override logical height to -1 (no possible resolution). |
572 child->setOverrideContainingBlockContentLogicalHeight(-1); | 574 child->setOverrideContainingBlockContentLogicalHeight(-1); |
573 child->layoutIfNeeded(); | 575 child->layoutIfNeeded(); |
574 return child->logicalHeight(); | 576 return child->logicalHeight(); |
575 } | 577 } |
576 | 578 |
577 LayoutUnit RenderGrid::minContentForChild(RenderBox* child, GridTrackSizingDirec tion direction, Vector<GridTrack>& columnTracks) | 579 LayoutUnit RenderGrid::minContentForChild(RenderBox* child, GridTrackSizingDirec tion direction, Vector<GridTrack>& columnTracks) |
578 { | 580 { |
579 bool hasOrthogonalWritingMode = child->isHorizontalWritingMode() != isHorizo ntalWritingMode(); | 581 bool hasOrthogonalWritingMode = child->isHorizontalWritingMode() != isHorizo ntalWritingMode(); |
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1197 if (isOutOfFlowPositioned()) | 1199 if (isOutOfFlowPositioned()) |
1198 return "RenderGrid (positioned)"; | 1200 return "RenderGrid (positioned)"; |
1199 if (isAnonymous()) | 1201 if (isAnonymous()) |
1200 return "RenderGrid (generated)"; | 1202 return "RenderGrid (generated)"; |
1201 if (isRelPositioned()) | 1203 if (isRelPositioned()) |
1202 return "RenderGrid (relative positioned)"; | 1204 return "RenderGrid (relative positioned)"; |
1203 return "RenderGrid"; | 1205 return "RenderGrid"; |
1204 } | 1206 } |
1205 | 1207 |
1206 } // namespace WebCore | 1208 } // namespace WebCore |
OLD | NEW |