| 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 if (RenderMultiColumnFlowThread* flowThread = multiColumnFlowThread()) { | 193 if (RenderMultiColumnFlowThread* flowThread = multiColumnFlowThread()) { |
| 194 if (flowThread->computeColumnCountAndWidth()) | 194 if (flowThread->computeColumnCountAndWidth()) |
| 195 return true; | 195 return true; |
| 196 } | 196 } |
| 197 return relayoutChildren; | 197 return relayoutChildren; |
| 198 } | 198 } |
| 199 | 199 |
| 200 void RenderBlockFlow::checkForPaginationLogicalHeightChange(LayoutUnit& pageLogi
calHeight, bool& pageLogicalHeightChanged, bool& hasSpecifiedPageLogicalHeight) | 200 void RenderBlockFlow::checkForPaginationLogicalHeightChange(LayoutUnit& pageLogi
calHeight, bool& pageLogicalHeightChanged, bool& hasSpecifiedPageLogicalHeight) |
| 201 { | 201 { |
| 202 if (RenderMultiColumnFlowThread* flowThread = multiColumnFlowThread()) { | 202 if (RenderMultiColumnFlowThread* flowThread = multiColumnFlowThread()) { |
| 203 // We don't actually update any of the variables. We just subclassed to
adjust our column height. | |
| 204 updateLogicalHeight(); | 203 updateLogicalHeight(); |
| 204 pageLogicalHeightChanged = contentLogicalHeight() != flowThread->columnH
eightAvailable(); |
| 205 flowThread->setColumnHeightAvailable(std::max<LayoutUnit>(contentLogical
Height(), 0)); | 205 flowThread->setColumnHeightAvailable(std::max<LayoutUnit>(contentLogical
Height(), 0)); |
| 206 setLogicalHeight(0); | 206 setLogicalHeight(0); |
| 207 } else if (hasColumns()) { | 207 } else if (hasColumns()) { |
| 208 ColumnInfo* colInfo = columnInfo(); | 208 ColumnInfo* colInfo = columnInfo(); |
| 209 | 209 |
| 210 if (!pageLogicalHeight) { | 210 if (!pageLogicalHeight) { |
| 211 LayoutUnit oldLogicalHeight = logicalHeight(); | 211 LayoutUnit oldLogicalHeight = logicalHeight(); |
| 212 setLogicalHeight(0); | 212 setLogicalHeight(0); |
| 213 // We need to go ahead and set our explicit page height if one exist
s, so that we can | 213 // We need to go ahead and set our explicit page height if one exist
s, so that we can |
| 214 // avoid doing two layout passes. | 214 // avoid doing two layout passes. |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 { | 344 { |
| 345 LayoutUnit oldLeft = logicalLeft(); | 345 LayoutUnit oldLeft = logicalLeft(); |
| 346 if (updateLogicalWidthAndColumnWidth()) | 346 if (updateLogicalWidthAndColumnWidth()) |
| 347 relayoutChildren = true; | 347 relayoutChildren = true; |
| 348 | 348 |
| 349 rebuildFloatsFromIntruding(); | 349 rebuildFloatsFromIntruding(); |
| 350 | 350 |
| 351 bool pageLogicalHeightChanged = false; | 351 bool pageLogicalHeightChanged = false; |
| 352 bool hasSpecifiedPageLogicalHeight = false; | 352 bool hasSpecifiedPageLogicalHeight = false; |
| 353 checkForPaginationLogicalHeightChange(pageLogicalHeight, pageLogicalHeightCh
anged, hasSpecifiedPageLogicalHeight); | 353 checkForPaginationLogicalHeightChange(pageLogicalHeight, pageLogicalHeightCh
anged, hasSpecifiedPageLogicalHeight); |
| 354 if (pageLogicalHeightChanged) |
| 355 relayoutChildren = true; |
| 354 | 356 |
| 355 LayoutStateMaintainer statePusher(*this, locationOffset(), pageLogicalHeight
, pageLogicalHeightChanged, columnInfo()); | 357 LayoutStateMaintainer statePusher(*this, locationOffset(), pageLogicalHeight
, pageLogicalHeightChanged, columnInfo()); |
| 356 | 358 |
| 357 // We use four values, maxTopPos, maxTopNeg, maxBottomPos, and maxBottomNeg,
to track | 359 // We use four values, maxTopPos, maxTopNeg, maxBottomPos, and maxBottomNeg,
to track |
| 358 // our current maximal positive and negative margins. These values are used
when we | 360 // our current maximal positive and negative margins. These values are used
when we |
| 359 // are collapsed with adjacent blocks, so for example, if you have block A a
nd B | 361 // are collapsed with adjacent blocks, so for example, if you have block A a
nd B |
| 360 // collapsing together, then you'd take the maximal positive margin from bot
h A and B | 362 // collapsing together, then you'd take the maximal positive margin from bot
h A and B |
| 361 // and subtract it from the maximal negative margin from both A and B to get
the | 363 // and subtract it from the maximal negative margin from both A and B to get
the |
| 362 // true collapsed margin. This algorithm is recursive, so when we finish lay
out() | 364 // true collapsed margin. This algorithm is recursive, so when we finish lay
out() |
| 363 // our block knows its current maximal positive/negative values. | 365 // our block knows its current maximal positive/negative values. |
| (...skipping 2433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2797 RenderBlockFlow::RenderBlockFlowRareData& RenderBlockFlow::ensureRareData() | 2799 RenderBlockFlow::RenderBlockFlowRareData& RenderBlockFlow::ensureRareData() |
| 2798 { | 2800 { |
| 2799 if (m_rareData) | 2801 if (m_rareData) |
| 2800 return *m_rareData; | 2802 return *m_rareData; |
| 2801 | 2803 |
| 2802 m_rareData = adoptPtr(new RenderBlockFlowRareData(this)); | 2804 m_rareData = adoptPtr(new RenderBlockFlowRareData(this)); |
| 2803 return *m_rareData; | 2805 return *m_rareData; |
| 2804 } | 2806 } |
| 2805 | 2807 |
| 2806 } // namespace WebCore | 2808 } // namespace WebCore |
| OLD | NEW |