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

Unified Diff: Source/core/paint/DeprecatedPaintLayer.cpp

Issue 1179403002: Update hasVisibleContent() to include visibility of non-self-painting layers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 months 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
« no previous file with comments | « LayoutTests/paint/deprecatedpaintlayer/non-self-painting-layer-overrides-visibility-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/DeprecatedPaintLayer.cpp
diff --git a/Source/core/paint/DeprecatedPaintLayer.cpp b/Source/core/paint/DeprecatedPaintLayer.cpp
index 35816c7fce8fc8f7916048454bae7897b8e2df9d..6f5bdee05d3d6792ca247ddacf3b4d089af655e2 100644
--- a/Source/core/paint/DeprecatedPaintLayer.cpp
+++ b/Source/core/paint/DeprecatedPaintLayer.cpp
@@ -594,6 +594,9 @@ void DeprecatedPaintLayer::dirtyVisibleContentStatus()
m_visibleContentStatusDirty = true;
if (parent())
parent()->dirtyAncestorChainVisibleDescendantStatus();
+ // Non-self-painting layers paint into their ancestor layer, and count as part of the "visible contents" of the parent, so we need to dirty it.
+ if (!isSelfPaintingLayer())
+ parent()->dirtyVisibleContentStatus();
}
void DeprecatedPaintLayer::potentiallyDirtyVisibleContentStatus(EVisibility visibility)
@@ -664,12 +667,12 @@ void DeprecatedPaintLayer::updateDescendantDependentFlags()
m_hasVisibleContent = false;
LayoutObject* r = layoutObject()->slowFirstChild();
while (r) {
- if (r->style()->visibility() == VISIBLE && !r->hasLayer()) {
+ if (r->style()->visibility() == VISIBLE && (!r->hasLayer() || !r->enclosingLayer()->isSelfPaintingLayer())) {
m_hasVisibleContent = true;
break;
}
LayoutObject* layoutObjectFirstChild = r->slowFirstChild();
- if (layoutObjectFirstChild && !r->hasLayer()) {
+ if (layoutObjectFirstChild && (!r->hasLayer() || !r->enclosingLayer()->isSelfPaintingLayer())) {
r = layoutObjectFirstChild;
} else if (r->nextSibling()) {
r = r->nextSibling();
@@ -1150,6 +1153,10 @@ void DeprecatedPaintLayer::addChild(DeprecatedPaintLayer* child, DeprecatedPaint
child->stackingNode()->dirtyStackingContextZOrderLists();
}
+ // Non-self-painting children paint into this layer, so the visible contents status of this layer is affected.
+ if (!child->isSelfPaintingLayer())
+ dirtyVisibleContentStatus();
+
dirtyAncestorChainVisibleDescendantStatus();
dirtyAncestorChainHasSelfPaintingLayerDescendantStatus();
« no previous file with comments | « LayoutTests/paint/deprecatedpaintlayer/non-self-painting-layer-overrides-visibility-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698