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 3719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3730 | 3730 |
3731 SubtreeLayoutScope layoutScope(child); | 3731 SubtreeLayoutScope layoutScope(child); |
3732 | 3732 |
3733 // A new position may mean that we need to insert, move or remove breaks | 3733 // A new position may mean that we need to insert, move or remove breaks |
3734 // inside the float. We may also need to lay out if we just ceased to be | 3734 // inside the float. We may also need to lay out if we just ceased to be |
3735 // fragmented, in order to remove pagination struts inside the child. | 3735 // fragmented, in order to remove pagination struts inside the child. |
3736 markChildForPaginationRelayoutIfNeeded(child, layoutScope); | 3736 markChildForPaginationRelayoutIfNeeded(child, layoutScope); |
3737 child.layoutIfNeeded(); | 3737 child.layoutIfNeeded(); |
3738 | 3738 |
3739 if (isPaginated) { | 3739 if (isPaginated) { |
| 3740 paginatedContentWasLaidOut(child.logicalBottom()); |
| 3741 |
3740 // We may have to insert a break before the float. | 3742 // We may have to insert a break before the float. |
3741 LayoutUnit newLogicalTopMarginEdge = | 3743 LayoutUnit newLogicalTopMarginEdge = |
3742 adjustFloatLogicalTopForPagination(child, logicalTopMarginEdge); | 3744 adjustFloatLogicalTopForPagination(child, logicalTopMarginEdge); |
3743 if (logicalTopMarginEdge != newLogicalTopMarginEdge) { | 3745 if (logicalTopMarginEdge != newLogicalTopMarginEdge) { |
3744 // We had already found a location for the float, but a soft | 3746 // We had already found a location for the float, but a soft |
3745 // fragmentainer break then made us push it further down. This may affect | 3747 // fragmentainer break then made us push it further down. This may affect |
3746 // the inline position of the float (since we may no longer be beside the | 3748 // the inline position of the float (since we may no longer be beside the |
3747 // same floats anymore). Block position will remain unaffected, though. | 3749 // same floats anymore). Block position will remain unaffected, though. |
3748 floatLogicalLocation = computeLogicalLocationForFloat( | 3750 floatLogicalLocation = computeLogicalLocationForFloat( |
3749 floatingObject, newLogicalTopMarginEdge); | 3751 floatingObject, newLogicalTopMarginEdge); |
3750 DCHECK_EQ(floatLogicalLocation.y(), newLogicalTopMarginEdge); | 3752 DCHECK_EQ(floatLogicalLocation.y(), newLogicalTopMarginEdge); |
3751 logicalTopMarginEdge = newLogicalTopMarginEdge; | 3753 logicalTopMarginEdge = newLogicalTopMarginEdge; |
3752 | 3754 |
3753 setLogicalTopForChild(child, logicalTopMarginEdge + marginBefore); | 3755 setLogicalTopForChild(child, logicalTopMarginEdge + marginBefore); |
3754 | 3756 |
3755 // Pushing the child to the next fragmentainer most likely means that we | 3757 // Pushing the child to the next fragmentainer most likely means that we |
3756 // need to recalculate pagination struts inside it. | 3758 // need to recalculate pagination struts inside it. |
3757 if (child.isLayoutBlock()) | 3759 if (child.isLayoutBlock()) |
3758 child.setChildNeedsLayout(MarkOnlyThis); | 3760 child.setChildNeedsLayout(MarkOnlyThis); |
3759 child.layoutIfNeeded(); | 3761 child.layoutIfNeeded(); |
| 3762 paginatedContentWasLaidOut(child.logicalBottom()); |
3760 } | 3763 } |
3761 } | 3764 } |
3762 | 3765 |
3763 LayoutUnit childLogicalLeftMargin = | 3766 LayoutUnit childLogicalLeftMargin = |
3764 style()->isLeftToRightDirection() ? marginStart : marginEnd; | 3767 style()->isLeftToRightDirection() ? marginStart : marginEnd; |
3765 setLogicalLeftForChild(child, | 3768 setLogicalLeftForChild(child, |
3766 floatLogicalLocation.x() + childLogicalLeftMargin); | 3769 floatLogicalLocation.x() + childLogicalLeftMargin); |
3767 setLogicalLeftForFloat(floatingObject, floatLogicalLocation.x()); | 3770 setLogicalLeftForFloat(floatingObject, floatLogicalLocation.x()); |
3768 setLogicalTopForFloat(floatingObject, logicalTopMarginEdge); | 3771 setLogicalTopForFloat(floatingObject, logicalTopMarginEdge); |
3769 setLogicalHeightForFloat(floatingObject, logicalHeightForChild(child) + | 3772 setLogicalHeightForFloat(floatingObject, logicalHeightForChild(child) + |
(...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4605 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState); | 4608 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState); |
4606 } | 4609 } |
4607 | 4610 |
4608 void LayoutBlockFlow::invalidateDisplayItemClients( | 4611 void LayoutBlockFlow::invalidateDisplayItemClients( |
4609 PaintInvalidationReason invalidationReason) const { | 4612 PaintInvalidationReason invalidationReason) const { |
4610 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients( | 4613 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients( |
4611 invalidationReason); | 4614 invalidationReason); |
4612 } | 4615 } |
4613 | 4616 |
4614 } // namespace blink | 4617 } // namespace blink |
OLD | NEW |