 Chromium Code Reviews
 Chromium Code Reviews| Index: Source/core/paint/DeprecatedPaintLayerStackingNode.h | 
| diff --git a/Source/core/paint/DeprecatedPaintLayerStackingNode.h b/Source/core/paint/DeprecatedPaintLayerStackingNode.h | 
| index 8a9bab8a7dc437fb6886f95718102ac83fd35fb2..069a0fa727015dd426d46ab699523142d19fe276 100644 | 
| --- a/Source/core/paint/DeprecatedPaintLayerStackingNode.h | 
| +++ b/Source/core/paint/DeprecatedPaintLayerStackingNode.h | 
| @@ -61,12 +61,12 @@ class LayoutBoxModelObject; | 
| class CORE_EXPORT DeprecatedPaintLayerStackingNode { | 
| WTF_MAKE_NONCOPYABLE(DeprecatedPaintLayerStackingNode); | 
| public: | 
| - explicit DeprecatedPaintLayerStackingNode(DeprecatedPaintLayer*); | 
| + explicit DeprecatedPaintLayerStackingNode(LayoutBoxModelObject&); | 
| ~DeprecatedPaintLayerStackingNode(); | 
| - int zIndex() const { return layoutObject()->style()->zIndex(); } | 
| + int zIndex() const { return layoutObject().style()->zIndex(); } | 
| - bool isStackingContext() const { return layoutObject()->style()->isStackingContext(); } | 
| + bool isStackingContext() const { return layoutObject().style()->isStackingContext(); } | 
| // Update our normal and z-index lists. | 
| void updateLayerListsIfNeeded(); | 
| @@ -91,7 +91,9 @@ public: | 
| DeprecatedPaintLayerStackingNode* ancestorStackingContextNode() const; | 
| - DeprecatedPaintLayer* layer() const { return m_layer; } | 
| + // FIXME: A lot of code depends on this function but shouldn't. We should | 
| + // build our code on top of LayoutBoxModelObject, not DeprecatedPaintLayer. | 
| + DeprecatedPaintLayer* layer() const; | 
| 
dsinclair
2015/06/24 19:40:50
Should we consider adding an ASSERT in here and a
 
Julien - ping for review
2015/06/24 21:40:00
We could make it private and whitelist the classes
 | 
| #if ENABLE(ASSERT) | 
| bool layerListMutationAllowed() const { return m_layerListMutationAllowed; } | 
| @@ -124,7 +126,6 @@ private: | 
| } | 
| void rebuildZOrderLists(); | 
| - void collectLayers(OwnPtr<Vector<DeprecatedPaintLayerStackingNode*>>& posZOrderList, OwnPtr<Vector<DeprecatedPaintLayerStackingNode*>>& negZOrderList); | 
| #if ENABLE(ASSERT) | 
| bool isInStackingParentZOrderLists() const; | 
| @@ -134,7 +135,7 @@ private: | 
| void setStackingParent(DeprecatedPaintLayerStackingNode* stackingParent) { m_stackingParent = stackingParent; } | 
| #endif | 
| - bool shouldBeTreatedAsStackingContextForPainting() const { return layoutObject()->style()->isTreatedAsStackingContextForPainting(); } | 
| + bool shouldBeTreatedAsStackingContextForPainting() const { return layoutObject().style()->isTreatedAsStackingContextForPainting(); } | 
| void updateNormalFlowList(); | 
| @@ -142,9 +143,9 @@ private: | 
| DeprecatedPaintLayerCompositor* compositor() const; | 
| // We can't return a LayoutBox as LayoutInline can be a stacking context. | 
| - LayoutBoxModelObject* layoutObject() const; | 
| + LayoutBoxModelObject& layoutObject() const { return m_layoutObject; } | 
| - DeprecatedPaintLayer* m_layer; | 
| + LayoutBoxModelObject& m_layoutObject; | 
| // m_posZOrderList holds a sorted list of all the descendant nodes within | 
| // that have z-indices of 0 or greater (auto will count as 0). |