| 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 |
| 11 * documentation and/or other materials provided with the distribution. | 11 * documentation and/or other materials provided with the distribution. |
| 12 * | 12 * |
| 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY | 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY |
| 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR | 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR |
| 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #include "config.h" | 26 #include "config.h" |
| 27 #include "core/rendering/RenderGrid.h" | 27 #include "core/rendering/RenderGrid.h" |
| 28 | 28 |
| 29 #include "core/layout/Layer.h" |
| 29 #include "core/paint/GridPainter.h" | 30 #include "core/paint/GridPainter.h" |
| 30 #include "core/rendering/RenderLayer.h" | |
| 31 #include "core/rendering/RenderView.h" | 31 #include "core/rendering/RenderView.h" |
| 32 #include "core/rendering/TextAutosizer.h" | 32 #include "core/rendering/TextAutosizer.h" |
| 33 #include "core/rendering/style/GridCoordinate.h" | 33 #include "core/rendering/style/GridCoordinate.h" |
| 34 #include "core/rendering/style/RenderStyle.h" | 34 #include "core/rendering/style/RenderStyle.h" |
| 35 #include "platform/LengthFunctions.h" | 35 #include "platform/LengthFunctions.h" |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 static const int infinity = -1; | 39 static const int infinity = -1; |
| 40 | 40 |
| (...skipping 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1176 LayoutUnit rowBreadth = LayoutUnit(0); | 1176 LayoutUnit rowBreadth = LayoutUnit(0); |
| 1177 offsetAndBreadthForPositionedChild(*child, ForRows, rowStartIsAuto, chil
d->style()->gridRowEnd().isAuto(), rowOffset, rowBreadth); | 1177 offsetAndBreadthForPositionedChild(*child, ForRows, rowStartIsAuto, chil
d->style()->gridRowEnd().isAuto(), rowOffset, rowBreadth); |
| 1178 | 1178 |
| 1179 child->setOverrideContainingBlockContentLogicalWidth(columnBreadth); | 1179 child->setOverrideContainingBlockContentLogicalWidth(columnBreadth); |
| 1180 child->setOverrideContainingBlockContentLogicalHeight(rowBreadth); | 1180 child->setOverrideContainingBlockContentLogicalHeight(rowBreadth); |
| 1181 child->setExtraInlineOffset(columnOffset); | 1181 child->setExtraInlineOffset(columnOffset); |
| 1182 child->setExtraBlockOffset(rowOffset); | 1182 child->setExtraBlockOffset(rowOffset); |
| 1183 | 1183 |
| 1184 if (child->parent() == this) { | 1184 if (child->parent() == this) { |
| 1185 // If column/row start is not auto the padding has been already comp
uted in offsetAndBreadthForPositionedChild(). | 1185 // If column/row start is not auto the padding has been already comp
uted in offsetAndBreadthForPositionedChild(). |
| 1186 RenderLayer* childLayer = child->layer(); | 1186 Layer* childLayer = child->layer(); |
| 1187 if (columnStartIsAuto) | 1187 if (columnStartIsAuto) |
| 1188 childLayer->setStaticInlinePosition(borderAndPaddingStart()); | 1188 childLayer->setStaticInlinePosition(borderAndPaddingStart()); |
| 1189 else | 1189 else |
| 1190 childLayer->setStaticInlinePosition(borderStart() + columnOffset
); | 1190 childLayer->setStaticInlinePosition(borderStart() + columnOffset
); |
| 1191 if (rowStartIsAuto) | 1191 if (rowStartIsAuto) |
| 1192 childLayer->setStaticBlockPosition(borderAndPaddingBefore()); | 1192 childLayer->setStaticBlockPosition(borderAndPaddingBefore()); |
| 1193 else | 1193 else |
| 1194 childLayer->setStaticBlockPosition(borderBefore() + rowOffset); | 1194 childLayer->setStaticBlockPosition(borderBefore() + rowOffset); |
| 1195 } | 1195 } |
| 1196 } | 1196 } |
| (...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1730 if (isOutOfFlowPositioned()) | 1730 if (isOutOfFlowPositioned()) |
| 1731 return "RenderGrid (positioned)"; | 1731 return "RenderGrid (positioned)"; |
| 1732 if (isAnonymous()) | 1732 if (isAnonymous()) |
| 1733 return "RenderGrid (generated)"; | 1733 return "RenderGrid (generated)"; |
| 1734 if (isRelPositioned()) | 1734 if (isRelPositioned()) |
| 1735 return "RenderGrid (relative positioned)"; | 1735 return "RenderGrid (relative positioned)"; |
| 1736 return "RenderGrid"; | 1736 return "RenderGrid"; |
| 1737 } | 1737 } |
| 1738 | 1738 |
| 1739 } // namespace blink | 1739 } // namespace blink |
| OLD | NEW |