Commit 85fbeaaa authored by abarth@chromium.org's avatar abarth@chromium.org

Simplify CompositedLayerMapping's hasVisibleNonCompositingDescendant

This CL moves the early out to the top of the function, which lets us merge the
two stacking node iterations.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/183973017

git-svn-id: svn://svn.chromium.org/blink/trunk@168360 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 57ce9164
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment