| 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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 LayoutAnalyzer::BlockScope analyzer(*this); | 448 LayoutAnalyzer::BlockScope analyzer(*this); |
| 449 SubtreeLayoutScope layoutScope(*this); | 449 SubtreeLayoutScope layoutScope(*this); |
| 450 | 450 |
| 451 // Multiple passes might be required for column based layout. | 451 // Multiple passes might be required for column based layout. |
| 452 // The number of passes could be as high as the number of columns. | 452 // The number of passes could be as high as the number of columns. |
| 453 bool done = false; | 453 bool done = false; |
| 454 LayoutUnit pageLogicalHeight; | 454 LayoutUnit pageLogicalHeight; |
| 455 while (!done) | 455 while (!done) |
| 456 done = layoutBlockFlow(relayoutChildren, pageLogicalHeight, layoutScope); | 456 done = layoutBlockFlow(relayoutChildren, pageLogicalHeight, layoutScope); |
| 457 | 457 |
| 458 LayoutView* layoutView = view(); | |
| 459 if (layoutView->layoutState()->pageLogicalHeight()) | |
| 460 setPageLogicalOffset( | |
| 461 layoutView->layoutState()->pageLogicalOffset(*this, logicalTop())); | |
| 462 | |
| 463 updateLayerTransformAfterLayout(); | 458 updateLayerTransformAfterLayout(); |
| 464 | 459 |
| 465 updateAfterLayout(); | 460 updateAfterLayout(); |
| 466 | 461 |
| 467 if (isHTMLDialogElement(node()) && isOutOfFlowPositioned()) | 462 if (isHTMLDialogElement(node()) && isOutOfFlowPositioned()) |
| 468 positionDialog(); | 463 positionDialog(); |
| 469 | 464 |
| 470 clearNeedsLayout(); | 465 clearNeedsLayout(); |
| 471 updateIsSelfCollapsing(); | 466 updateIsSelfCollapsing(); |
| 472 } | 467 } |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 773 if (newLogicalTop != oldLogicalTop && child.shrinkToAvoidFloats()) { | 768 if (newLogicalTop != oldLogicalTop && child.shrinkToAvoidFloats()) { |
| 774 // The child's width is affected by adjacent floats. When the child shifts | 769 // The child's width is affected by adjacent floats. When the child shifts |
| 775 // to clear an item, its width can change (because it has more available | 770 // to clear an item, its width can change (because it has more available |
| 776 // width). | 771 // width). |
| 777 layoutScope.setChildNeedsLayout(&child); | 772 layoutScope.setChildNeedsLayout(&child); |
| 778 } else { | 773 } else { |
| 779 markChildForPaginationRelayoutIfNeeded(child, layoutScope); | 774 markChildForPaginationRelayoutIfNeeded(child, layoutScope); |
| 780 } | 775 } |
| 781 } | 776 } |
| 782 | 777 |
| 783 if (!child.needsLayout()) | 778 bool neededLayout = child.needsLayout(); |
| 784 return false; | 779 if (neededLayout) |
| 785 child.layout(); | 780 child.layout(); |
| 786 return true; | 781 if (view()->layoutState()->isPaginated()) |
| 782 updateFragmentationInfoForChild(child); |
| 783 return neededLayout; |
| 787 } | 784 } |
| 788 | 785 |
| 789 void LayoutBlockFlow::insertForcedBreakBeforeChildIfNeeded( | 786 void LayoutBlockFlow::insertForcedBreakBeforeChildIfNeeded( |
| 790 LayoutBox& child, | 787 LayoutBox& child, |
| 791 BlockChildrenLayoutInfo& layoutInfo) { | 788 BlockChildrenLayoutInfo& layoutInfo) { |
| 792 if (layoutInfo.isAtFirstInFlowChild()) { | 789 if (layoutInfo.isAtFirstInFlowChild()) { |
| 793 // There's no class A break point before the first child (only *between* | 790 // There's no class A break point before the first child (only *between* |
| 794 // siblings), so steal its break value and join it with what we already have | 791 // siblings), so steal its break value and join it with what we already have |
| 795 // here. | 792 // here. |
| 796 setBreakBefore( | 793 setBreakBefore( |
| (...skipping 3758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4555 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState); | 4552 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState); |
| 4556 } | 4553 } |
| 4557 | 4554 |
| 4558 void LayoutBlockFlow::invalidateDisplayItemClients( | 4555 void LayoutBlockFlow::invalidateDisplayItemClients( |
| 4559 PaintInvalidationReason invalidationReason) const { | 4556 PaintInvalidationReason invalidationReason) const { |
| 4560 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients( | 4557 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients( |
| 4561 invalidationReason); | 4558 invalidationReason); |
| 4562 } | 4559 } |
| 4563 | 4560 |
| 4564 } // namespace blink | 4561 } // namespace blink |
| OLD | NEW |