Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 5 * | 5 * |
| 6 * Other contributors: | 6 * Other contributors: |
| 7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
| 9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
| 10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 176 } | 176 } |
| 177 | 177 |
| 178 void RenderLayerStackingNode::updateNormalFlowList() | 178 void RenderLayerStackingNode::updateNormalFlowList() |
| 179 { | 179 { |
| 180 if (!m_normalFlowListDirty) | 180 if (!m_normalFlowListDirty) |
| 181 return; | 181 return; |
| 182 | 182 |
| 183 ASSERT(m_layerListMutationAllowed); | 183 ASSERT(m_layerListMutationAllowed); |
| 184 | 184 |
| 185 for (RenderLayer* child = layer()->firstChild(); child; child = child->nextS ibling()) { | 185 for (RenderLayer* child = layer()->firstChild(); child; child = child->nextS ibling()) { |
| 186 // Ignore non-overflow layers and reflections. | 186 // Ignore non-overflow layers and reflections. |
|
Julien - ping for review
2014/06/06 17:31:25
Let's remove / update this comment as it's not rel
| |
| 187 if (child->stackingNode()->isNormalFlowOnly() && (!layer()->reflectionIn fo() || layer()->reflectionInfo()->reflectionLayer() != child)) { | 187 if (child->stackingNode()->isNormalFlowOnly() && (!layer()->reflectionIn fo() || layer()->reflectionInfo()->reflectionLayer() != child)) { |
| 188 if (!m_normalFlowList) | 188 if (!m_normalFlowList) |
| 189 m_normalFlowList = adoptPtr(new Vector<RenderLayerStackingNode*> ); | 189 m_normalFlowList = adoptPtr(new Vector<RenderLayerStackingNode*> ); |
| 190 m_normalFlowList->append(child->stackingNode()); | 190 m_normalFlowList->append(child->stackingNode()); |
| 191 } | 191 } |
| 192 } | 192 } |
| 193 | 193 |
| 194 #if !ASSERT_DISABLED | 194 #if !ASSERT_DISABLED |
| 195 updateStackingParentForNormalFlowList(this); | 195 updateStackingParentForNormalFlowList(this); |
| 196 #endif | 196 #endif |
| 197 | 197 |
| 198 m_normalFlowListDirty = false; | 198 m_normalFlowListDirty = false; |
| 199 } | 199 } |
| 200 | 200 |
| 201 void RenderLayerStackingNode::collectLayers(OwnPtr<Vector<RenderLayerStackingNod e*> >& posBuffer, OwnPtr<Vector<RenderLayerStackingNode*> >& negBuffer) | 201 void RenderLayerStackingNode::collectLayers(OwnPtr<Vector<RenderLayerStackingNod e*> >& posBuffer, OwnPtr<Vector<RenderLayerStackingNode*> >& negBuffer) |
| 202 { | 202 { |
| 203 if (layer()->isInTopLayer()) | 203 if (layer()->isInTopLayer()) |
| 204 return; | 204 return; |
| 205 | 205 |
| 206 layer()->updateDescendantDependentFlags(); | 206 layer()->updateDescendantDependentFlags(); |
| 207 | 207 |
| 208 // Overflow layers are just painted by their enclosing layers, so they don't get put in zorder lists. | 208 // Overflow layers are just painted by their enclosing layers, so they don't get put in zorder lists. |
|
Julien - ping for review
2014/06/06 17:31:25
Ditto.
| |
| 209 if (!isNormalFlowOnly()) { | 209 if (!isNormalFlowOnly()) { |
| 210 // Determine which buffer the child should be in. | 210 // Determine which buffer the child should be in. |
| 211 OwnPtr<Vector<RenderLayerStackingNode*> >& buffer = (zIndex() >= 0) ? po sBuffer : negBuffer; | 211 OwnPtr<Vector<RenderLayerStackingNode*> >& buffer = (zIndex() >= 0) ? po sBuffer : negBuffer; |
| 212 | 212 |
| 213 // Create the buffer if it doesn't exist yet. | 213 // Create the buffer if it doesn't exist yet. |
| 214 if (!buffer) | 214 if (!buffer) |
| 215 buffer = adoptPtr(new Vector<RenderLayerStackingNode*>); | 215 buffer = adoptPtr(new Vector<RenderLayerStackingNode*>); |
| 216 | 216 |
| 217 // Append ourselves at the end of the appropriate buffer. | 217 // Append ourselves at the end of the appropriate buffer. |
| 218 buffer->append(this); | 218 buffer->append(this); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 299 return; | 299 return; |
| 300 | 300 |
| 301 dirtyStackingContextZOrderLists(); | 301 dirtyStackingContextZOrderLists(); |
| 302 | 302 |
| 303 if (isStackingContext) | 303 if (isStackingContext) |
| 304 dirtyZOrderLists(); | 304 dirtyZOrderLists(); |
| 305 else | 305 else |
| 306 clearZOrderLists(); | 306 clearZOrderLists(); |
| 307 } | 307 } |
| 308 | 308 |
| 309 bool RenderLayerStackingNode::shouldBeNormalFlowOnly() const | 309 bool RenderLayerStackingNode::shouldBeNormalFlowOnly() const |
|
Julien - ping for review
2014/06/06 17:31:25
Let's put a FIXME to rename it to something else (
| |
| 310 { | 310 { |
| 311 RenderLayerModelObject* renderer = this->renderer(); | 311 return !isStackingContext() && !renderer()->isPositioned(); |
| 312 | |
| 313 const bool couldBeNormalFlow = renderer->hasOverflowClip() | |
| 314 || renderer->hasReflection() | |
| 315 || renderer->hasMask() | |
| 316 || renderer->isCanvas() | |
| 317 || renderer->isVideo() | |
| 318 || renderer->isEmbeddedObject() | |
| 319 || renderer->isRenderIFrame() | |
| 320 || (renderer->style()->specifiesColumns() && !layer()->isRootLayer()); | |
| 321 | |
| 322 const bool preventsElementFromBeingNormalFlow = renderer->isPositioned() | |
| 323 || renderer->hasTransform() | |
| 324 || renderer->hasClipPath() | |
| 325 || renderer->hasFilter() | |
| 326 || renderer->hasBlendMode() | |
| 327 || layer()->isTransparent(); | |
| 328 | |
| 329 return couldBeNormalFlow && !preventsElementFromBeingNormalFlow; | |
| 330 } | 312 } |
| 331 | 313 |
| 332 void RenderLayerStackingNode::updateIsNormalFlowOnly() | 314 void RenderLayerStackingNode::updateIsNormalFlowOnly() |
| 333 { | 315 { |
| 334 bool isNormalFlowOnly = shouldBeNormalFlowOnly(); | 316 bool isNormalFlowOnly = shouldBeNormalFlowOnly(); |
| 335 if (isNormalFlowOnly == this->isNormalFlowOnly()) | 317 if (isNormalFlowOnly == this->isNormalFlowOnly()) |
| 336 return; | 318 return; |
| 337 | 319 |
| 338 m_isNormalFlowOnly = isNormalFlowOnly; | 320 m_isNormalFlowOnly = isNormalFlowOnly; |
| 339 if (RenderLayer* p = layer()->parent()) | 321 if (RenderLayer* p = layer()->parent()) |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 350 } | 332 } |
| 351 return 0; | 333 return 0; |
| 352 } | 334 } |
| 353 | 335 |
| 354 RenderLayerModelObject* RenderLayerStackingNode::renderer() const | 336 RenderLayerModelObject* RenderLayerStackingNode::renderer() const |
| 355 { | 337 { |
| 356 return m_layer->renderer(); | 338 return m_layer->renderer(); |
| 357 } | 339 } |
| 358 | 340 |
| 359 } // namespace WebCore | 341 } // namespace WebCore |
| OLD | NEW |