Index: third_party/WebKit/Source/core/paint/PaintLayer.cpp |
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.cpp b/third_party/WebKit/Source/core/paint/PaintLayer.cpp |
index 71c699920159b8cfb6b664a842bb261c24c6ff37..5b7a5b6e56e267f6b06e757578a24b4872735f19 100644 |
--- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp |
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp |
@@ -747,7 +747,7 @@ bool PaintLayer::updateLayerPosition() |
} |
// Subtract our parent's scroll offset. |
- if (PaintLayer* positionedParent = layoutObject()->isOutOfFlowPositioned() ? enclosingPositionedAncestor() : nullptr) { |
+ if (PaintLayer* positionedParent = layoutObject()->isOutOfFlowPositioned() ? enclosingPositionedOrContainedAncestor() : nullptr) { |
// For positioned layers, we subtract out the enclosing positioned layer's scroll offset. |
if (positionedParent->layoutObject()->hasOverflowClip()) { |
IntSize offset = positionedParent->layoutBox()->scrolledContentOffset(); |
@@ -818,7 +818,7 @@ static inline bool isFixedPositionedContainer(PaintLayer* layer) |
return layer->isRootLayer() || layer->hasTransformRelatedProperty(); |
} |
-PaintLayer* PaintLayer::enclosingPositionedAncestor(const PaintLayer* ancestor, bool* skippedAncestor) const |
+PaintLayer* PaintLayer::enclosingPositionedOrContainedAncestor(const PaintLayer* ancestor, bool* skippedAncestor) const |
{ |
ASSERT(!ancestor || skippedAncestor); // If we have specified an ancestor, surely the caller needs to know whether we skipped it. |
if (skippedAncestor) |
@@ -1272,7 +1272,7 @@ static inline const PaintLayer* accumulateOffsetTowardsAncestor(const PaintLayer |
PaintLayer* parentLayer; |
if (position == AbsolutePosition || position == FixedPosition) { |
bool foundAncestorFirst; |
- parentLayer = layer->enclosingPositionedAncestor(ancestorLayer, &foundAncestorFirst); |
+ parentLayer = layer->enclosingPositionedOrContainedAncestor(ancestorLayer, &foundAncestorFirst); |
if (foundAncestorFirst) { |
// Found ancestorLayer before the container of the out-of-flow object, so compute offset |
@@ -2358,7 +2358,7 @@ bool PaintLayer::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) |
// We can't consult child layers if we clip, since they might cover |
// parts of the rect that are clipped out. |
- if (layoutObject()->hasOverflowClip()) |
+ if (layoutObject()->hasOverflowClip() || layoutObject()->style()->containsPaint()) |
return false; |
return childBackgroundIsKnownToBeOpaqueInRect(localRect); |