OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 | 116 |
117 // FIXME: it's scary that neither destroy() nor the move*Children* methods t
ake care of this, | 117 // FIXME: it's scary that neither destroy() nor the move*Children* methods t
ake care of this, |
118 // and instead leave you with dangling root line box pointers. But since thi
s is how it is done | 118 // and instead leave you with dangling root line box pointers. But since thi
s is how it is done |
119 // in other parts of the code that deal with reparenting renderers, let's do
the cleanup on our | 119 // in other parts of the code that deal with reparenting renderers, let's do
the cleanup on our |
120 // own here as well. | 120 // own here as well. |
121 deleteLineBoxTree(); | 121 deleteLineBoxTree(); |
122 | 122 |
123 destroy(); | 123 destroy(); |
124 } | 124 } |
125 | 125 |
| 126 LayoutSize RenderMultiColumnFlowThread::columnOffset(const LayoutPoint& point) c
onst |
| 127 { |
| 128 if (!hasValidRegionInfo()) |
| 129 return LayoutSize(0, 0); |
| 130 |
| 131 LayoutPoint flowThreadPoint(point); |
| 132 flipForWritingMode(flowThreadPoint); |
| 133 LayoutUnit blockOffset = isHorizontalWritingMode() ? flowThreadPoint.y() : f
lowThreadPoint.x(); |
| 134 RenderRegion* renderRegion = regionAtBlockOffset(blockOffset); |
| 135 if (!renderRegion) |
| 136 return LayoutSize(0, 0); |
| 137 return toRenderMultiColumnSet(renderRegion)->flowThreadTranslationAtOffset(b
lockOffset); |
| 138 } |
| 139 |
126 void RenderMultiColumnFlowThread::layoutColumns(bool relayoutChildren, SubtreeLa
youtScope& layoutScope) | 140 void RenderMultiColumnFlowThread::layoutColumns(bool relayoutChildren, SubtreeLa
youtScope& layoutScope) |
127 { | 141 { |
128 // Update the dimensions of our regions before we lay out the flow thread. | 142 // Update the dimensions of our regions before we lay out the flow thread. |
129 // FIXME: Eventually this is going to get way more complicated, and we will
be destroying regions | 143 // FIXME: Eventually this is going to get way more complicated, and we will
be destroying regions |
130 // instead of trying to keep them around. | 144 // instead of trying to keep them around. |
131 bool shouldInvalidateRegions = false; | 145 bool shouldInvalidateRegions = false; |
132 for (RenderMultiColumnSet* columnSet = firstMultiColumnSet(); columnSet; col
umnSet = columnSet->nextSiblingMultiColumnSet()) { | 146 for (RenderMultiColumnSet* columnSet = firstMultiColumnSet(); columnSet; col
umnSet = columnSet->nextSiblingMultiColumnSet()) { |
133 if (relayoutChildren || columnSet->needsLayout()) { | 147 if (relayoutChildren || columnSet->needsLayout()) { |
134 if (!m_inBalancingPass) | 148 if (!m_inBalancingPass) |
135 columnSet->prepareForLayout(); | 149 columnSet->prepareForLayout(); |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 } | 299 } |
286 | 300 |
287 bool RenderMultiColumnFlowThread::isPageLogicalHeightKnown() const | 301 bool RenderMultiColumnFlowThread::isPageLogicalHeightKnown() const |
288 { | 302 { |
289 if (RenderMultiColumnSet* columnSet = lastMultiColumnSet()) | 303 if (RenderMultiColumnSet* columnSet = lastMultiColumnSet()) |
290 return columnSet->computedColumnHeight(); | 304 return columnSet->computedColumnHeight(); |
291 return false; | 305 return false; |
292 } | 306 } |
293 | 307 |
294 } | 308 } |
OLD | NEW |