Commit 0a2c8161 authored by abarth@chromium.org's avatar abarth@chromium.org

Restore sanity to RenderLayerStackingNode::shouldBeNormalFlowOnly

This code evolved and grew over the years, but it seems to be trying to compute
something very simple.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@175704 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent b5685cc6
...@@ -226,6 +226,11 @@ crbug.com/378919 [ Linux Android ] fast/forms/suggestion-picker/datetimelocal-su ...@@ -226,6 +226,11 @@ crbug.com/378919 [ Linux Android ] fast/forms/suggestion-picker/datetimelocal-su
# Probably just needs new baseline, but image_diff is failing - investigate that. # Probably just needs new baseline, but image_diff is failing - investigate that.
crbug.com/318980 [ Linux x86 ] fast/text/international/hindi-spacing.html [ ImageOnlyFailure ] crbug.com/318980 [ Linux x86 ] fast/text/international/hindi-spacing.html [ ImageOnlyFailure ]
Bug(abarth) media/audio-controls-rendering.html [ NeedsRebaseline ]
Bug(abarth) media/media-controls-clone.html [ NeedsRebaseline ]
Bug(abarth) media/audio-repaint.html [ NeedsRebaseline ]
Bug(abarth) media/track/track-cue-rendering-vertical.html [ NeedsRebaseline ]
# Untriaged Mavericks failures # Untriaged Mavericks failures
crbug.com/314947 [ Mavericks ] fast/scrolling/scrollbar-tickmarks-hittest.html [ Timeout ] crbug.com/314947 [ Mavericks ] fast/scrolling/scrollbar-tickmarks-hittest.html [ Timeout ]
......
...@@ -13,7 +13,7 @@ Compositing reasons for div#backface-visibility: assumedOverlap,backfaceVisibili ...@@ -13,7 +13,7 @@ Compositing reasons for div#backface-visibility: assumedOverlap,backfaceVisibili
Compositing reasons for div#animation: activeAnimation,assumedOverlap Compositing reasons for div#animation: activeAnimation,assumedOverlap
Compositing reasons for div#transformWithCompositedDescendants: assumedOverlap,transformWithCompositedDescendants Compositing reasons for div#transformWithCompositedDescendants: assumedOverlap,transformWithCompositedDescendants
Compositing reasons for div#opacityWithCompositedDescendants: assumedOverlap,opacityWithCompositedDescendants Compositing reasons for div#opacityWithCompositedDescendants: assumedOverlap,opacityWithCompositedDescendants
Compositing reasons for div#reflectionWithCompositedDescendants: reflectionWithCompositedDescendants Compositing reasons for div#reflectionWithCompositedDescendants: assumedOverlap,reflectionWithCompositedDescendants
Compositing reasons for div#perspective: assumedOverlap,perspectiveWith3DDescendants Compositing reasons for div#perspective: assumedOverlap,perspectiveWith3DDescendants
Compositing reasons for div#preserve3d: assumedOverlap,preserve3DWith3DDescendants Compositing reasons for div#preserve3d: assumedOverlap,preserve3DWith3DDescendants
...@@ -183,7 +183,6 @@ void RenderLayerStackingNode::updateNormalFlowList() ...@@ -183,7 +183,6 @@ void RenderLayerStackingNode::updateNormalFlowList()
ASSERT(m_layerListMutationAllowed); ASSERT(m_layerListMutationAllowed);
for (RenderLayer* child = layer()->firstChild(); child; child = child->nextSibling()) { for (RenderLayer* child = layer()->firstChild(); child; child = child->nextSibling()) {
// Ignore non-overflow layers and reflections.
if (child->stackingNode()->isNormalFlowOnly() && (!layer()->reflectionInfo() || layer()->reflectionInfo()->reflectionLayer() != child)) { if (child->stackingNode()->isNormalFlowOnly() && (!layer()->reflectionInfo() || layer()->reflectionInfo()->reflectionLayer() != child)) {
if (!m_normalFlowList) if (!m_normalFlowList)
m_normalFlowList = adoptPtr(new Vector<RenderLayerStackingNode*>); m_normalFlowList = adoptPtr(new Vector<RenderLayerStackingNode*>);
...@@ -205,23 +204,15 @@ void RenderLayerStackingNode::collectLayers(OwnPtr<Vector<RenderLayerStackingNod ...@@ -205,23 +204,15 @@ void RenderLayerStackingNode::collectLayers(OwnPtr<Vector<RenderLayerStackingNod
layer()->updateDescendantDependentFlags(); layer()->updateDescendantDependentFlags();
// Overflow layers are just painted by their enclosing layers, so they don't get put in zorder lists.
if (!isNormalFlowOnly()) { if (!isNormalFlowOnly()) {
// Determine which buffer the child should be in.
OwnPtr<Vector<RenderLayerStackingNode*> >& buffer = (zIndex() >= 0) ? posBuffer : negBuffer; OwnPtr<Vector<RenderLayerStackingNode*> >& buffer = (zIndex() >= 0) ? posBuffer : negBuffer;
// Create the buffer if it doesn't exist yet.
if (!buffer) if (!buffer)
buffer = adoptPtr(new Vector<RenderLayerStackingNode*>); buffer = adoptPtr(new Vector<RenderLayerStackingNode*>);
// Append ourselves at the end of the appropriate buffer.
buffer->append(this); buffer->append(this);
} }
// Recur into our children to collect more layers, but only if we don't establish a stacking context.
if (!isStackingContext()) { if (!isStackingContext()) {
for (RenderLayer* child = layer()->firstChild(); child; child = child->nextSibling()) { for (RenderLayer* child = layer()->firstChild(); child; child = child->nextSibling()) {
// Ignore reflections.
if (!layer()->reflectionInfo() || layer()->reflectionInfo()->reflectionLayer() != child) if (!layer()->reflectionInfo() || layer()->reflectionInfo()->reflectionLayer() != child)
child->stackingNode()->collectLayers(posBuffer, negBuffer); child->stackingNode()->collectLayers(posBuffer, negBuffer);
} }
...@@ -303,27 +294,11 @@ void RenderLayerStackingNode::updateStackingNodesAfterStyleChange(const RenderSt ...@@ -303,27 +294,11 @@ void RenderLayerStackingNode::updateStackingNodesAfterStyleChange(const RenderSt
clearZOrderLists(); clearZOrderLists();
} }
// FIXME: Rename shouldBeNormalFlowOnly to something more accurate now that CSS
// 2.1 defines the term "normal flow".
bool RenderLayerStackingNode::shouldBeNormalFlowOnly() const bool RenderLayerStackingNode::shouldBeNormalFlowOnly() const
{ {
RenderLayerModelObject* renderer = this->renderer(); return !isStackingContext() && !renderer()->isPositioned();
const bool couldBeNormalFlow = renderer->hasOverflowClip()
|| renderer->hasReflection()
|| renderer->hasMask()
|| renderer->isCanvas()
|| renderer->isVideo()
|| renderer->isEmbeddedObject()
|| renderer->isRenderIFrame()
|| (renderer->style()->specifiesColumns() && !layer()->isRootLayer());
const bool preventsElementFromBeingNormalFlow = renderer->isPositioned()
|| renderer->hasTransform()
|| renderer->hasClipPath()
|| renderer->hasFilter()
|| renderer->hasBlendMode()
|| layer()->isTransparent();
return couldBeNormalFlow && !preventsElementFromBeingNormalFlow;
} }
void RenderLayerStackingNode::updateIsNormalFlowOnly() void RenderLayerStackingNode::updateIsNormalFlowOnly()
......
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