| 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 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 LayoutUnit oldLogicalTop = logicalTopForChild(child); | 660 LayoutUnit oldLogicalTop = logicalTopForChild(child); |
| 661 setLogicalTopForChild(child, newLogicalTop); | 661 setLogicalTopForChild(child, newLogicalTop); |
| 662 | 662 |
| 663 SubtreeLayoutScope layoutScope(child); | 663 SubtreeLayoutScope layoutScope(child); |
| 664 if (!child.needsLayout()) { | 664 if (!child.needsLayout()) { |
| 665 if (newLogicalTop != oldLogicalTop && child.shrinkToAvoidFloats()) { | 665 if (newLogicalTop != oldLogicalTop && child.shrinkToAvoidFloats()) { |
| 666 // The child's width is affected by adjacent floats. When the child
shifts to clear an | 666 // The child's width is affected by adjacent floats. When the child
shifts to clear an |
| 667 // item, its width can change (because it has more available width). | 667 // item, its width can change (because it has more available width). |
| 668 layoutScope.setChildNeedsLayout(&child); | 668 layoutScope.setChildNeedsLayout(&child); |
| 669 } else { | 669 } else { |
| 670 child.markForPaginationRelayoutIfNeeded(layoutScope); | 670 markChildForPaginationRelayoutIfNeeded(child, layoutScope); |
| 671 } | 671 } |
| 672 } | 672 } |
| 673 | 673 |
| 674 if (!child.needsLayout()) | 674 if (!child.needsLayout()) |
| 675 return false; | 675 return false; |
| 676 child.layout(); | 676 child.layout(); |
| 677 return true; | 677 return true; |
| 678 } | 678 } |
| 679 | 679 |
| 680 void LayoutBlockFlow::insertForcedBreakBeforeChildIfNeeded(LayoutBox& child, Blo
ckChildrenLayoutInfo& layoutInfo) | 680 void LayoutBlockFlow::insertForcedBreakBeforeChildIfNeeded(LayoutBox& child, Blo
ckChildrenLayoutInfo& layoutInfo) |
| (...skipping 2397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3078 | 3078 |
| 3079 LayoutPoint floatLogicalLocation = computeLogicalLocationForFloat(floati
ngObject, logicalTop); | 3079 LayoutPoint floatLogicalLocation = computeLogicalLocationForFloat(floati
ngObject, logicalTop); |
| 3080 | 3080 |
| 3081 setLogicalLeftForFloat(floatingObject, floatLogicalLocation.x()); | 3081 setLogicalLeftForFloat(floatingObject, floatLogicalLocation.x()); |
| 3082 | 3082 |
| 3083 setLogicalLeftForChild(*childBox, floatLogicalLocation.x() + childLogica
lLeftMargin); | 3083 setLogicalLeftForChild(*childBox, floatLogicalLocation.x() + childLogica
lLeftMargin); |
| 3084 setLogicalTopForChild(*childBox, floatLogicalLocation.y() + marginBefore
ForChild(*childBox)); | 3084 setLogicalTopForChild(*childBox, floatLogicalLocation.y() + marginBefore
ForChild(*childBox)); |
| 3085 | 3085 |
| 3086 SubtreeLayoutScope layoutScope(*childBox); | 3086 SubtreeLayoutScope layoutScope(*childBox); |
| 3087 if (isPaginated && !childBox->needsLayout()) | 3087 if (isPaginated && !childBox->needsLayout()) |
| 3088 childBox->markForPaginationRelayoutIfNeeded(layoutScope); | 3088 markChildForPaginationRelayoutIfNeeded(*childBox, layoutScope); |
| 3089 | 3089 |
| 3090 childBox->layoutIfNeeded(); | 3090 childBox->layoutIfNeeded(); |
| 3091 | 3091 |
| 3092 if (isPaginated) { | 3092 if (isPaginated) { |
| 3093 LayoutBlockFlow* childBlockFlow = childBox->isLayoutBlockFlow() ? to
LayoutBlockFlow(childBox) : nullptr; | 3093 LayoutBlockFlow* childBlockFlow = childBox->isLayoutBlockFlow() ? to
LayoutBlockFlow(childBox) : nullptr; |
| 3094 // The first piece of content inside the child may have set a strut
during layout. | 3094 // The first piece of content inside the child may have set a strut
during layout. |
| 3095 LayoutUnit strut = childBlockFlow ? childBlockFlow->paginationStrutP
ropagatedFromChild() : LayoutUnit(); | 3095 LayoutUnit strut = childBlockFlow ? childBlockFlow->paginationStrutP
ropagatedFromChild() : LayoutUnit(); |
| 3096 if (!strut) { | 3096 if (!strut) { |
| 3097 // Otherwise, if we are unsplittable and don't fit, move to the
next page or column | 3097 // Otherwise, if we are unsplittable and don't fit, move to the
next page or column |
| 3098 // if that helps the situation. | 3098 // if that helps the situation. |
| (...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3777 | 3777 |
| 3778 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState); | 3778 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState); |
| 3779 } | 3779 } |
| 3780 | 3780 |
| 3781 void LayoutBlockFlow::invalidateDisplayItemClients(PaintInvalidationReason inval
idationReason) const | 3781 void LayoutBlockFlow::invalidateDisplayItemClients(PaintInvalidationReason inval
idationReason) const |
| 3782 { | 3782 { |
| 3783 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients(invalidationRe
ason); | 3783 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients(invalidationRe
ason); |
| 3784 } | 3784 } |
| 3785 | 3785 |
| 3786 } // namespace blink | 3786 } // namespace blink |
| OLD | NEW |