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 3341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3352 FloatingObject& floatingObject = **it; | 3352 FloatingObject& floatingObject = **it; |
3353 if (!floatBoxIsSelfPaintingLayer) { | 3353 if (!floatBoxIsSelfPaintingLayer) { |
3354 // This repeats the logic in addOverhangingFloats() about shouldPain
t flag: | 3354 // This repeats the logic in addOverhangingFloats() about shouldPain
t flag: |
3355 // - The nearest enclosing block in which the float doesn't overhang
paints the float; | 3355 // - The nearest enclosing block in which the float doesn't overhang
paints the float; |
3356 // - Or even if the float overhangs, if the ancestor block has self-
painting layer, it | 3356 // - Or even if the float overhangs, if the ancestor block has self-
painting layer, it |
3357 // paints the float. | 3357 // paints the float. |
3358 if (ancestorBlock->hasSelfPaintingLayer() || !ancestorBlock->isOverh
angingFloat(floatingObject)) { | 3358 if (ancestorBlock->hasSelfPaintingLayer() || !ancestorBlock->isOverh
angingFloat(floatingObject)) { |
3359 floatingObject.setShouldPaint(true); | 3359 floatingObject.setShouldPaint(true); |
3360 return; | 3360 return; |
3361 } | 3361 } |
3362 } else if (floatingObject.shouldPaint()) { | 3362 } else { |
3363 floatingObject.setShouldPaint(false); | 3363 floatingObject.setShouldPaint(false); |
3364 return; | |
3365 } | 3364 } |
3366 } | 3365 } |
3367 // We should have found the ancestor to update shouldPaint flag. | |
3368 ASSERT_NOT_REACHED(); | |
3369 } | 3366 } |
3370 | 3367 |
3371 bool LayoutBlockFlow::allowsPaginationStrut() const | 3368 bool LayoutBlockFlow::allowsPaginationStrut() const |
3372 { | 3369 { |
3373 // The block needs to be contained by a LayoutBlockFlow (and not by e.g. a f
lexbox, grid, or a | 3370 // The block needs to be contained by a LayoutBlockFlow (and not by e.g. a f
lexbox, grid, or a |
3374 // table (the latter being the case for table cell or table caption)). The r
eason for this | 3371 // table (the latter being the case for table cell or table caption)). The r
eason for this |
3375 // limitation is simply that LayoutBlockFlow child layout code is the only p
lace where we pick | 3372 // limitation is simply that LayoutBlockFlow child layout code is the only p
lace where we pick |
3376 // up the struts and handle them. We handle floats and regular in-flow child
ren, and that's | 3373 // up the struts and handle them. We handle floats and regular in-flow child
ren, and that's |
3377 // all. We could handle this in other layout modes as well (and even for out
-of-flow children), | 3374 // all. We could handle this in other layout modes as well (and even for out
-of-flow children), |
3378 // but currently we don't. | 3375 // but currently we don't. |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3773 | 3770 |
3774 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState); | 3771 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState); |
3775 } | 3772 } |
3776 | 3773 |
3777 void LayoutBlockFlow::invalidateDisplayItemClients(PaintInvalidationReason inval
idationReason) const | 3774 void LayoutBlockFlow::invalidateDisplayItemClients(PaintInvalidationReason inval
idationReason) const |
3778 { | 3775 { |
3779 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients(invalidationRe
ason); | 3776 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients(invalidationRe
ason); |
3780 } | 3777 } |
3781 | 3778 |
3782 } // namespace blink | 3779 } // namespace blink |
OLD | NEW |