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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 { | 180 { |
181 if (lineGridBox()) | 181 if (lineGridBox()) |
182 lineGridBox()->destroy(); | 182 lineGridBox()->destroy(); |
183 | 183 |
184 if (renderNamedFlowFragment()) | 184 if (renderNamedFlowFragment()) |
185 setRenderNamedFlowFragment(0); | 185 setRenderNamedFlowFragment(0); |
186 | 186 |
187 RenderBlock::willBeDestroyed(); | 187 RenderBlock::willBeDestroyed(); |
188 } | 188 } |
189 | 189 |
| 190 void RenderBlockFlow::checkForPaginationLogicalHeightChange(LayoutUnit& pageLogi
calHeight, bool& pageLogicalHeightChanged, bool& hasSpecifiedPageLogicalHeight) |
| 191 { |
| 192 ColumnInfo* colInfo = columnInfo(); |
| 193 if (hasColumns()) { |
| 194 if (!pageLogicalHeight) { |
| 195 LayoutUnit oldLogicalHeight = logicalHeight(); |
| 196 setLogicalHeight(0); |
| 197 // We need to go ahead and set our explicit page height if one exist
s, so that we can |
| 198 // avoid doing two layout passes. |
| 199 updateLogicalHeight(); |
| 200 LayoutUnit columnHeight = contentLogicalHeight(); |
| 201 if (columnHeight > 0) { |
| 202 pageLogicalHeight = columnHeight; |
| 203 hasSpecifiedPageLogicalHeight = true; |
| 204 } |
| 205 setLogicalHeight(oldLogicalHeight); |
| 206 } |
| 207 if (colInfo->columnHeight() != pageLogicalHeight && everHadLayout()) { |
| 208 colInfo->setColumnHeight(pageLogicalHeight); |
| 209 pageLogicalHeightChanged = true; |
| 210 } |
| 211 |
| 212 if (!hasSpecifiedPageLogicalHeight && !pageLogicalHeight) |
| 213 colInfo->clearForcedBreaks(); |
| 214 |
| 215 colInfo->setPaginationUnit(paginationUnit()); |
| 216 } else if (isRenderFlowThread()) { |
| 217 pageLogicalHeight = 1; // This is just a hack to always make sure we hav
e a page logical height. |
| 218 pageLogicalHeightChanged = toRenderFlowThread(this)->pageLogicalSizeChan
ged(); |
| 219 } |
| 220 } |
| 221 |
190 bool RenderBlockFlow::relayoutForPagination(bool hasSpecifiedPageLogicalHeight,
LayoutUnit pageLogicalHeight, LayoutStateMaintainer& statePusher) | 222 bool RenderBlockFlow::relayoutForPagination(bool hasSpecifiedPageLogicalHeight,
LayoutUnit pageLogicalHeight, LayoutStateMaintainer& statePusher) |
191 { | 223 { |
192 if (!hasColumns()) | 224 if (!hasColumns()) |
193 return false; | 225 return false; |
194 | 226 |
195 OwnPtr<RenderOverflow> savedOverflow = m_overflow.release(); | 227 OwnPtr<RenderOverflow> savedOverflow = m_overflow.release(); |
196 if (childrenInline()) | 228 if (childrenInline()) |
197 addOverflowFromInlineChildren(); | 229 addOverflowFromInlineChildren(); |
198 else | 230 else |
199 addOverflowFromBlockChildren(); | 231 addOverflowFromBlockChildren(); |
(...skipping 2622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2822 RenderBlockFlow::RenderBlockFlowRareData& RenderBlockFlow::ensureRareData() | 2854 RenderBlockFlow::RenderBlockFlowRareData& RenderBlockFlow::ensureRareData() |
2823 { | 2855 { |
2824 if (m_rareData) | 2856 if (m_rareData) |
2825 return *m_rareData; | 2857 return *m_rareData; |
2826 | 2858 |
2827 m_rareData = adoptPtr(new RenderBlockFlowRareData(this)); | 2859 m_rareData = adoptPtr(new RenderBlockFlowRareData(this)); |
2828 return *m_rareData; | 2860 return *m_rareData; |
2829 } | 2861 } |
2830 | 2862 |
2831 } // namespace WebCore | 2863 } // namespace WebCore |
OLD | NEW |