| Index: third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
|
| diff --git a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
|
| index 6c63e3e501bae956eefcec22ad1d4cff3840b2d8..c8b74c6cdc332c6ddf1eed63625e5fe44dd2d872 100644
|
| --- a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
|
| @@ -4149,21 +4149,23 @@ void LayoutBlockFlow::UpdateAncestorShouldPaintFloatingObject(
|
| break;
|
|
|
| FloatingObject& floating_object = **it;
|
| - if (!float_box_is_self_painting_layer) {
|
| - // This repeats the logic in addOverhangingFloats() about shouldPaint
|
| - // flag:
|
| - // - The nearest enclosing block in which the float doesn't overhang
|
| - // paints the float;
|
| - // - Or even if the float overhangs, if the ancestor block has
|
| - // self-painting layer, it paints the float.
|
| - if (ancestor_block->HasSelfPaintingLayer() ||
|
| - !ancestor_block->IsOverhangingFloat(floating_object)) {
|
| - floating_object.SetShouldPaint(true);
|
| - return;
|
| - }
|
| - } else {
|
| - floating_object.SetShouldPaint(false);
|
| - }
|
| + // This repeats the logic in addOverhangingFloats() about shouldPaint
|
| + // flag:
|
| + // - The nearest enclosing block in which the float doesn't overhang
|
| + // paints the float;
|
| + // - Or even if the float overhangs, if the ancestor block has
|
| + // self-painting layer, it paints the float.
|
| + LayoutBlockFlow* parent_block =
|
| + ToLayoutBlockFlow(floating_object.GetLayoutObject()->Parent());
|
| + bool is_overhanging_float =
|
| + parent_block && parent_block->IsOverhangingFloat(floating_object);
|
| + bool should_paint =
|
| + !float_box_is_self_painting_layer &&
|
| + (ancestor_block->HasSelfPaintingLayer() || !is_overhanging_float);
|
| + floating_object.SetShouldPaint(should_paint);
|
| +
|
| + if (floating_object.ShouldPaint())
|
| + return;
|
| }
|
| }
|
|
|
|
|