Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(248)

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayer.cpp

Issue 1490063002: Implement Paint Containment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove unnecessary adjustStyleForContainment declaration Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698