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

Unified Diff: Source/core/rendering/compositing/CompositedLayerMapping.cpp

Issue 183973017: Simplify CompositedLayerMapping's hasVisibleNonCompositingDescendant (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/compositing/CompositedLayerMapping.cpp
diff --git a/Source/core/rendering/compositing/CompositedLayerMapping.cpp b/Source/core/rendering/compositing/CompositedLayerMapping.cpp
index 090f703860d597673196bba20a46fcad45de5fb2..3ce4290754caaf99725c2b7979cdb3f2ffe5c226 100644
--- a/Source/core/rendering/compositing/CompositedLayerMapping.cpp
+++ b/Source/core/rendering/compositing/CompositedLayerMapping.cpp
@@ -1603,6 +1603,9 @@ bool CompositedLayerMapping::isSimpleContainerCompositingLayer() const
static bool hasVisibleNonCompositingDescendant(RenderLayer* parent)
{
+ if (!parent->hasVisibleDescendant())
+ return false;
+
// FIXME: We shouldn't be called with a stale z-order lists. See bug 85512.
parent->stackingNode()->updateLayerListsIfNeeded();
@@ -1610,22 +1613,12 @@ static bool hasVisibleNonCompositingDescendant(RenderLayer* parent)
LayerListMutationDetector mutationChecker(parent->stackingNode());
#endif
- RenderLayerStackingNodeIterator normalFlowIterator(*parent->stackingNode(), NormalFlowChildren);
+ RenderLayerStackingNodeIterator normalFlowIterator(*parent->stackingNode(), AllChildren);
while (RenderLayerStackingNode* curNode = normalFlowIterator.next()) {
RenderLayer* curLayer = curNode->layer();
- if (!curLayer->hasCompositedLayerMapping()
- && (curLayer->hasVisibleContent() || hasVisibleNonCompositingDescendant(curLayer)))
- return true;
- }
-
- if (!parent->hasVisibleDescendant())
- return false;
-
- RenderLayerStackingNodeIterator zOrderIterator(*parent->stackingNode(), NegativeZOrderChildren | PositiveZOrderChildren);
- while (RenderLayerStackingNode* curNode = zOrderIterator.next()) {
- RenderLayer* curLayer = curNode->layer();
- if (!curLayer->hasCompositedLayerMapping()
- && (curLayer->hasVisibleContent() || hasVisibleNonCompositingDescendant(curLayer)))
+ if (curLayer->hasCompositedLayerMapping())
+ continue;
+ if (curLayer->hasVisibleContent() || hasVisibleNonCompositingDescendant(curLayer))
return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698