Index: third_party/WebKit/Source/core/paint/PaintInvalidator.cpp |
diff --git a/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp b/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp |
index 47ef71c74eebf919da0864f3e618aaae895a540f..72547e270f605616295f3daf3535b9a8e8f138bb 100644 |
--- a/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp |
+++ b/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp |
@@ -200,8 +200,12 @@ LayoutPoint PaintInvalidator::computeLocationInBacking( |
void PaintInvalidator::updatePaintingLayer(const LayoutObject& object, |
PaintInvalidatorContext& context) { |
if (object.hasLayer() && |
- toLayoutBoxModelObject(object).hasSelfPaintingLayer()) |
+ toLayoutBoxModelObject(object).hasSelfPaintingLayer()) { |
context.paintingLayer = toLayoutBoxModelObject(object).layer(); |
+ } else if (object.isFloating() && !object.parent()->isLayoutBlock()) { |
+ // See LayoutObject::paintingLayer() for specialty of floating objects. |
+ context.paintingLayer = object.paintingLayer(); |
+ } |
if (object.isLayoutBlockFlow() && toLayoutBlockFlow(object).containsFloats()) |
context.paintingLayer->setNeedsPaintPhaseFloat(); |
@@ -283,6 +287,10 @@ void PaintInvalidator::updateContext(const LayoutObject& object, |
if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled()) |
undoFrameViewContentClipAndScroll.emplace( |
*toLayoutView(object).frameView(), context); |
+ } else if (object.isFloating() && !object.parent()->isLayoutBlock()) { |
+ // See LayoutObject::paintingLayer() for specialty of floating objects. |
+ context.paintInvalidationContainer = |
+ &object.containerForPaintInvalidation(); |
} else if (object.styleRef().isStacked() && |
// This is to exclude some objects (e.g. LayoutText) inheriting |
// stacked style from parent but aren't actually stacked. |