| 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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 setLogicalHeight(oldLogicalHeight); | 221 setLogicalHeight(oldLogicalHeight); |
| 222 } | 222 } |
| 223 if (colInfo->columnHeight() != pageLogicalHeight && everHadLayout()) { | 223 if (colInfo->columnHeight() != pageLogicalHeight && everHadLayout()) { |
| 224 colInfo->setColumnHeight(pageLogicalHeight); | 224 colInfo->setColumnHeight(pageLogicalHeight); |
| 225 pageLogicalHeightChanged = true; | 225 pageLogicalHeightChanged = true; |
| 226 } | 226 } |
| 227 | 227 |
| 228 if (!hasSpecifiedPageLogicalHeight && !pageLogicalHeight) | 228 if (!hasSpecifiedPageLogicalHeight && !pageLogicalHeight) |
| 229 colInfo->clearForcedBreaks(); | 229 colInfo->clearForcedBreaks(); |
| 230 } else if (isRenderFlowThread()) { | 230 } else if (isRenderFlowThread()) { |
| 231 pageLogicalHeight = 1; // This is just a hack to always make sure we hav
e a page logical height. | 231 RenderFlowThread* flowThread = toRenderFlowThread(this); |
| 232 pageLogicalHeightChanged = toRenderFlowThread(this)->pageLogicalSizeChan
ged(); | 232 |
| 233 // FIXME: This is a hack to always make sure we have a page logical heig
ht, if said height |
| 234 // is known. The page logical height thing in LayoutState is meaningless
for flow |
| 235 // thread-based pagination (page height isn't necessarily uniform throug
hout the flow |
| 236 // thread), but as long as it is used universally as a means to determin
e whether page |
| 237 // height is known or not, we need this. Page height is unknown when col
umn balancing is |
| 238 // enabled and flow thread height is still unknown (i.e. during the firs
t layout pass). When |
| 239 // it's unknown, we need to prevent the pagination code from assuming pa
ge breaks everywhere |
| 240 // and thereby eating every top margin. It should be trivial to clean up
and get rid of this |
| 241 // hack once the old multicol implementation is gone. |
| 242 pageLogicalHeight = flowThread->isPageLogicalHeightKnown() ? LayoutUnit(
1) : LayoutUnit(0); |
| 243 |
| 244 pageLogicalHeightChanged = flowThread->pageLogicalSizeChanged(); |
| 233 } | 245 } |
| 234 } | 246 } |
| 235 | 247 |
| 236 bool RenderBlockFlow::shouldRelayoutForPagination(LayoutUnit& pageLogicalHeight,
LayoutUnit layoutOverflowLogicalBottom) const | 248 bool RenderBlockFlow::shouldRelayoutForPagination(LayoutUnit& pageLogicalHeight,
LayoutUnit layoutOverflowLogicalBottom) const |
| 237 { | 249 { |
| 238 // FIXME: We don't balance properly at all in the presence of forced page br
eaks. We need to understand what | 250 // FIXME: We don't balance properly at all in the presence of forced page br
eaks. We need to understand what |
| 239 // the distance between forced page breaks is so that we can avoid making th
e minimum column height too tall. | 251 // the distance between forced page breaks is so that we can avoid making th
e minimum column height too tall. |
| 240 ColumnInfo* colInfo = columnInfo(); | 252 ColumnInfo* colInfo = columnInfo(); |
| 241 LayoutUnit columnHeight = pageLogicalHeight; | 253 LayoutUnit columnHeight = pageLogicalHeight; |
| 242 const int minColumnCount = colInfo->forcedBreaks() + 1; | 254 const int minColumnCount = colInfo->forcedBreaks() + 1; |
| (...skipping 2570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2813 RenderBlockFlow::RenderBlockFlowRareData& RenderBlockFlow::ensureRareData() | 2825 RenderBlockFlow::RenderBlockFlowRareData& RenderBlockFlow::ensureRareData() |
| 2814 { | 2826 { |
| 2815 if (m_rareData) | 2827 if (m_rareData) |
| 2816 return *m_rareData; | 2828 return *m_rareData; |
| 2817 | 2829 |
| 2818 m_rareData = adoptPtr(new RenderBlockFlowRareData(this)); | 2830 m_rareData = adoptPtr(new RenderBlockFlowRareData(this)); |
| 2819 return *m_rareData; | 2831 return *m_rareData; |
| 2820 } | 2832 } |
| 2821 | 2833 |
| 2822 } // namespace WebCore | 2834 } // namespace WebCore |
| OLD | NEW |