| 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 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1032 // far only accounts for pushing the top border edge to the next | 1032 // far only accounts for pushing the top border edge to the next |
| 1033 // fragmentainer. We need to push the margin over as well, because | 1033 // fragmentainer. We need to push the margin over as well, because |
| 1034 // there's no break opportunity between margin and border. | 1034 // there's no break opportunity between margin and border. |
| 1035 strut += marginBefore; | 1035 strut += marginBefore; |
| 1036 } else { | 1036 } else { |
| 1037 // Even if we didn't break before the border box to the next | 1037 // Even if we didn't break before the border box to the next |
| 1038 // fragmentainer, we need to check if we can fit the margin before it. | 1038 // fragmentainer, we need to check if we can fit the margin before it. |
| 1039 if (pageLogicalHeightForOffset(logicalTopMarginEdge)) { | 1039 if (pageLogicalHeightForOffset(logicalTopMarginEdge)) { |
| 1040 LayoutUnit remainingSpace = pageRemainingLogicalHeightForOffset( | 1040 LayoutUnit remainingSpace = pageRemainingLogicalHeightForOffset( |
| 1041 logicalTopMarginEdge, AssociateWithLatterPage); | 1041 logicalTopMarginEdge, AssociateWithLatterPage); |
| 1042 if (remainingSpace <= marginBefore) | 1042 if (remainingSpace <= marginBefore) { |
| 1043 strut += remainingSpace; | 1043 strut += calculatePaginationStrutToFitContent( |
| 1044 logicalTopMarginEdge, remainingSpace, marginBefore); |
| 1045 } |
| 1044 } | 1046 } |
| 1045 } | 1047 } |
| 1046 } | 1048 } |
| 1047 if (!strut) { | 1049 if (!strut) { |
| 1048 // If we are unsplittable and don't fit, move to the next page or column | 1050 // If we are unsplittable and don't fit, move to the next page or column |
| 1049 // if that helps the situation. | 1051 // if that helps the situation. |
| 1050 LayoutUnit newLogicalTopMarginEdge = | 1052 LayoutUnit newLogicalTopMarginEdge = |
| 1051 adjustForUnsplittableChild(child, logicalTopMarginEdge); | 1053 adjustForUnsplittableChild(child, logicalTopMarginEdge); |
| 1052 strut = newLogicalTopMarginEdge - logicalTopMarginEdge; | 1054 strut = newLogicalTopMarginEdge - logicalTopMarginEdge; |
| 1053 } | 1055 } |
| (...skipping 3551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4605 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState); | 4607 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState); |
| 4606 } | 4608 } |
| 4607 | 4609 |
| 4608 void LayoutBlockFlow::invalidateDisplayItemClients( | 4610 void LayoutBlockFlow::invalidateDisplayItemClients( |
| 4609 PaintInvalidationReason invalidationReason) const { | 4611 PaintInvalidationReason invalidationReason) const { |
| 4610 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients( | 4612 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients( |
| 4611 invalidationReason); | 4613 invalidationReason); |
| 4612 } | 4614 } |
| 4613 | 4615 |
| 4614 } // namespace blink | 4616 } // namespace blink |
| OLD | NEW |