| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 columnHeight = max(colInfo->minimumColumnHeight(), distanceBetwe
enBreaks); | 214 columnHeight = max(colInfo->minimumColumnHeight(), distanceBetwe
enBreaks); |
| 215 } | 215 } |
| 216 } else if (layoutOverflowLogicalBottom > boundedMultiply(pageLogicalHeig
ht, desiredColumnCount)) { | 216 } else if (layoutOverflowLogicalBottom > boundedMultiply(pageLogicalHeig
ht, desiredColumnCount)) { |
| 217 // Now that we know the intrinsic height of the columns, we have to
rebalance them. | 217 // Now that we know the intrinsic height of the columns, we have to
rebalance them. |
| 218 columnHeight = max<LayoutUnit>(colInfo->minimumColumnHeight(), ceilf
((float)layoutOverflowLogicalBottom / desiredColumnCount)); | 218 columnHeight = max<LayoutUnit>(colInfo->minimumColumnHeight(), ceilf
((float)layoutOverflowLogicalBottom / desiredColumnCount)); |
| 219 } | 219 } |
| 220 | 220 |
| 221 if (columnHeight && columnHeight != pageLogicalHeight) { | 221 if (columnHeight && columnHeight != pageLogicalHeight) { |
| 222 statePusher.pop(); | 222 statePusher.pop(); |
| 223 setEverHadLayout(true); | 223 setEverHadLayout(true); |
| 224 layoutBlock(false, columnHeight); | 224 layoutBlockFlow(false, columnHeight); |
| 225 return true; | 225 return true; |
| 226 } | 226 } |
| 227 } | 227 } |
| 228 | 228 |
| 229 if (pageLogicalHeight) | 229 if (pageLogicalHeight) |
| 230 colInfo->setColumnCountAndHeight(ceilf((float)layoutOverflowLogicalBotto
m / pageLogicalHeight), pageLogicalHeight); | 230 colInfo->setColumnCountAndHeight(ceilf((float)layoutOverflowLogicalBotto
m / pageLogicalHeight), pageLogicalHeight); |
| 231 | 231 |
| 232 if (columnCount(colInfo)) { | 232 if (columnCount(colInfo)) { |
| 233 setLogicalHeight(borderBefore() + paddingBefore() + colInfo->columnHeigh
t() + borderAfter() + paddingAfter() + scrollbarLogicalHeight()); | 233 setLogicalHeight(borderBefore() + paddingBefore() + colInfo->columnHeigh
t() + borderAfter() + paddingAfter() + scrollbarLogicalHeight()); |
| 234 m_overflow.clear(); | 234 m_overflow.clear(); |
| 235 } else { | 235 } else { |
| 236 m_overflow = savedOverflow.release(); | 236 m_overflow = savedOverflow.release(); |
| 237 } | 237 } |
| 238 | 238 |
| 239 return false; | 239 return false; |
| 240 } | 240 } |
| 241 | 241 |
| 242 bool RenderBlockFlow::isSelfCollapsingBlock() const | 242 bool RenderBlockFlow::isSelfCollapsingBlock() const |
| 243 { | 243 { |
| 244 m_hasOnlySelfCollapsingChildren = RenderBlock::isSelfCollapsingBlock(); | 244 m_hasOnlySelfCollapsingChildren = RenderBlock::isSelfCollapsingBlock(); |
| 245 return m_hasOnlySelfCollapsingChildren; | 245 return m_hasOnlySelfCollapsingChildren; |
| 246 } | 246 } |
| 247 | 247 |
| 248 void RenderBlockFlow::layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalH
eight) | 248 void RenderBlockFlow::layoutBlock(bool relayoutChildren) |
| 249 { |
| 250 layoutBlockFlow(relayoutChildren); |
| 251 } |
| 252 |
| 253 void RenderBlockFlow::layoutBlockFlow(bool relayoutChildren, LayoutUnit pageLogi
calHeight) |
| 249 { | 254 { |
| 250 ASSERT(needsLayout()); | 255 ASSERT(needsLayout()); |
| 251 ASSERT(isInlineBlockOrInlineTable() || !isInline()); | 256 ASSERT(isInlineBlockOrInlineTable() || !isInline()); |
| 252 | 257 |
| 253 // If we are self-collapsing with self-collapsing descendants this will get
set to save us burrowing through our | 258 // If we are self-collapsing with self-collapsing descendants this will get
set to save us burrowing through our |
| 254 // descendants every time in |isSelfCollapsingBlock|. We reset it here so th
at |isSelfCollapsingBlock| attempts to burrow | 259 // descendants every time in |isSelfCollapsingBlock|. We reset it here so th
at |isSelfCollapsingBlock| attempts to burrow |
| 255 // at least once and so that it always gives a reliable result reflecting th
e latest layout. | 260 // at least once and so that it always gives a reliable result reflecting th
e latest layout. |
| 256 m_hasOnlySelfCollapsingChildren = false; | 261 m_hasOnlySelfCollapsingChildren = false; |
| 257 | 262 |
| 258 if (!relayoutChildren && simplifiedLayout()) | 263 if (!relayoutChildren && simplifiedLayout()) |
| (...skipping 2546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2805 RenderBlockFlow::RenderBlockFlowRareData& RenderBlockFlow::ensureRareData() | 2810 RenderBlockFlow::RenderBlockFlowRareData& RenderBlockFlow::ensureRareData() |
| 2806 { | 2811 { |
| 2807 if (m_rareData) | 2812 if (m_rareData) |
| 2808 return *m_rareData; | 2813 return *m_rareData; |
| 2809 | 2814 |
| 2810 m_rareData = adoptPtr(new RenderBlockFlowRareData(this)); | 2815 m_rareData = adoptPtr(new RenderBlockFlowRareData(this)); |
| 2811 return *m_rareData; | 2816 return *m_rareData; |
| 2812 } | 2817 } |
| 2813 | 2818 |
| 2814 } // namespace WebCore | 2819 } // namespace WebCore |
| OLD | NEW |