OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. |
3 * Copyright (C) 2013 Intel Corporation. All rights reserved. | 3 * Copyright (C) 2013 Intel Corporation. All rights reserved. |
4 * | 4 * |
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
6 * | 6 * |
7 * Other contributors: | 7 * Other contributors: |
8 * Robert O'Callahan <roc+@cs.cmu.edu> | 8 * Robert O'Callahan <roc+@cs.cmu.edu> |
9 * David Baron <dbaron@fas.harvard.edu> | 9 * David Baron <dbaron@fas.harvard.edu> |
10 * Christian Biesinger <cbiesinger@web.de> | 10 * Christian Biesinger <cbiesinger@web.de> |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 void updateStackingNodesAfterStyleChange(const RenderStyle* oldStyle); | 88 void updateStackingNodesAfterStyleChange(const RenderStyle* oldStyle); |
89 | 89 |
90 RenderLayerStackingNode* ancestorStackingContextNode() const; | 90 RenderLayerStackingNode* ancestorStackingContextNode() const; |
91 | 91 |
92 // Gets the enclosing stacking context for this node, possibly the node | 92 // Gets the enclosing stacking context for this node, possibly the node |
93 // itself, if it is a stacking context. | 93 // itself, if it is a stacking context. |
94 RenderLayerStackingNode* enclosingStackingContextNode() { return isStackingC
ontext() ? this : ancestorStackingContextNode(); } | 94 RenderLayerStackingNode* enclosingStackingContextNode() { return isStackingC
ontext() ? this : ancestorStackingContextNode(); } |
95 | 95 |
96 RenderLayer* layer() const { return m_layer; } | 96 RenderLayer* layer() const { return m_layer; } |
97 | 97 |
98 #if !ASSERT_DISABLED | 98 #if ASSERT_ENABLED |
99 bool layerListMutationAllowed() const { return m_layerListMutationAllowed; } | 99 bool layerListMutationAllowed() const { return m_layerListMutationAllowed; } |
100 void setLayerListMutationAllowed(bool flag) { m_layerListMutationAllowed = f
lag; } | 100 void setLayerListMutationAllowed(bool flag) { m_layerListMutationAllowed = f
lag; } |
101 #endif | 101 #endif |
102 | 102 |
103 private: | 103 private: |
104 friend class RenderLayerStackingNodeIterator; | 104 friend class RenderLayerStackingNodeIterator; |
105 friend class RenderLayerStackingNodeReverseIterator; | 105 friend class RenderLayerStackingNodeReverseIterator; |
106 friend class RenderTreeAsText; | 106 friend class RenderTreeAsText; |
107 | 107 |
108 Vector<RenderLayerStackingNode*>* posZOrderList() const | 108 Vector<RenderLayerStackingNode*>* posZOrderList() const |
(...skipping 12 matching lines...) Expand all Loading... |
121 Vector<RenderLayerStackingNode*>* negZOrderList() const | 121 Vector<RenderLayerStackingNode*>* negZOrderList() const |
122 { | 122 { |
123 ASSERT(!m_zOrderListsDirty); | 123 ASSERT(!m_zOrderListsDirty); |
124 ASSERT(isStackingContext() || !m_negZOrderList); | 124 ASSERT(isStackingContext() || !m_negZOrderList); |
125 return m_negZOrderList.get(); | 125 return m_negZOrderList.get(); |
126 } | 126 } |
127 | 127 |
128 void rebuildZOrderLists(); | 128 void rebuildZOrderLists(); |
129 void collectLayers(OwnPtr<Vector<RenderLayerStackingNode*> >& posZOrderList,
OwnPtr<Vector<RenderLayerStackingNode*> >& negZOrderList); | 129 void collectLayers(OwnPtr<Vector<RenderLayerStackingNode*> >& posZOrderList,
OwnPtr<Vector<RenderLayerStackingNode*> >& negZOrderList); |
130 | 130 |
131 #if !ASSERT_DISABLED | 131 #if ASSERT_ENABLED |
132 bool isInStackingParentZOrderLists() const; | 132 bool isInStackingParentZOrderLists() const; |
133 bool isInStackingParentNormalFlowList() const; | 133 bool isInStackingParentNormalFlowList() const; |
134 void updateStackingParentForZOrderLists(RenderLayerStackingNode* stackingPar
ent); | 134 void updateStackingParentForZOrderLists(RenderLayerStackingNode* stackingPar
ent); |
135 void updateStackingParentForNormalFlowList(RenderLayerStackingNode* stacking
Parent); | 135 void updateStackingParentForNormalFlowList(RenderLayerStackingNode* stacking
Parent); |
136 void setStackingParent(RenderLayerStackingNode* stackingParent) { m_stacking
Parent = stackingParent; } | 136 void setStackingParent(RenderLayerStackingNode* stackingParent) { m_stacking
Parent = stackingParent; } |
137 #endif | 137 #endif |
138 | 138 |
139 bool shouldBeNormalFlowOnly() const; | 139 bool shouldBeNormalFlowOnly() const; |
140 | 140 |
141 void updateNormalFlowList(); | 141 void updateNormalFlowList(); |
(...skipping 13 matching lines...) Expand all Loading... |
155 OwnPtr<Vector<RenderLayerStackingNode*> > m_posZOrderList; | 155 OwnPtr<Vector<RenderLayerStackingNode*> > m_posZOrderList; |
156 OwnPtr<Vector<RenderLayerStackingNode*> > m_negZOrderList; | 156 OwnPtr<Vector<RenderLayerStackingNode*> > m_negZOrderList; |
157 | 157 |
158 // This list contains child nodes that cannot create stacking contexts. | 158 // This list contains child nodes that cannot create stacking contexts. |
159 OwnPtr<Vector<RenderLayerStackingNode*> > m_normalFlowList; | 159 OwnPtr<Vector<RenderLayerStackingNode*> > m_normalFlowList; |
160 | 160 |
161 unsigned m_zOrderListsDirty : 1; | 161 unsigned m_zOrderListsDirty : 1; |
162 unsigned m_normalFlowListDirty: 1; | 162 unsigned m_normalFlowListDirty: 1; |
163 unsigned m_isNormalFlowOnly : 1; | 163 unsigned m_isNormalFlowOnly : 1; |
164 | 164 |
165 #if !ASSERT_DISABLED | 165 #if ASSERT_ENABLED |
166 unsigned m_layerListMutationAllowed : 1; | 166 unsigned m_layerListMutationAllowed : 1; |
167 RenderLayerStackingNode* m_stackingParent; | 167 RenderLayerStackingNode* m_stackingParent; |
168 #endif | 168 #endif |
169 }; | 169 }; |
170 | 170 |
171 inline void RenderLayerStackingNode::clearZOrderLists() | 171 inline void RenderLayerStackingNode::clearZOrderLists() |
172 { | 172 { |
173 ASSERT(!isStackingContext()); | 173 ASSERT(!isStackingContext()); |
174 | 174 |
175 #if !ASSERT_DISABLED | 175 #if ASSERT_ENABLED |
176 updateStackingParentForZOrderLists(0); | 176 updateStackingParentForZOrderLists(0); |
177 #endif | 177 #endif |
178 | 178 |
179 m_posZOrderList.clear(); | 179 m_posZOrderList.clear(); |
180 m_negZOrderList.clear(); | 180 m_negZOrderList.clear(); |
181 } | 181 } |
182 | 182 |
183 inline void RenderLayerStackingNode::updateZOrderLists() | 183 inline void RenderLayerStackingNode::updateZOrderLists() |
184 { | 184 { |
185 if (!m_zOrderListsDirty) | 185 if (!m_zOrderListsDirty) |
186 return; | 186 return; |
187 | 187 |
188 if (!isStackingContext()) { | 188 if (!isStackingContext()) { |
189 clearZOrderLists(); | 189 clearZOrderLists(); |
190 m_zOrderListsDirty = false; | 190 m_zOrderListsDirty = false; |
191 return; | 191 return; |
192 } | 192 } |
193 | 193 |
194 rebuildZOrderLists(); | 194 rebuildZOrderLists(); |
195 } | 195 } |
196 | 196 |
197 #if !ASSERT_DISABLED | 197 #if ASSERT_ENABLED |
198 class LayerListMutationDetector { | 198 class LayerListMutationDetector { |
199 public: | 199 public: |
200 explicit LayerListMutationDetector(RenderLayerStackingNode* stackingNode) | 200 explicit LayerListMutationDetector(RenderLayerStackingNode* stackingNode) |
201 : m_stackingNode(stackingNode) | 201 : m_stackingNode(stackingNode) |
202 , m_previousMutationAllowedState(stackingNode->layerListMutationAllowed(
)) | 202 , m_previousMutationAllowedState(stackingNode->layerListMutationAllowed(
)) |
203 { | 203 { |
204 m_stackingNode->setLayerListMutationAllowed(false); | 204 m_stackingNode->setLayerListMutationAllowed(false); |
205 } | 205 } |
206 | 206 |
207 ~LayerListMutationDetector() | 207 ~LayerListMutationDetector() |
208 { | 208 { |
209 m_stackingNode->setLayerListMutationAllowed(m_previousMutationAllowedSta
te); | 209 m_stackingNode->setLayerListMutationAllowed(m_previousMutationAllowedSta
te); |
210 } | 210 } |
211 | 211 |
212 private: | 212 private: |
213 RenderLayerStackingNode* m_stackingNode; | 213 RenderLayerStackingNode* m_stackingNode; |
214 bool m_previousMutationAllowedState; | 214 bool m_previousMutationAllowedState; |
215 }; | 215 }; |
216 #endif | 216 #endif |
217 | 217 |
218 } // namespace WebCore | 218 } // namespace WebCore |
219 | 219 |
220 #endif // RenderLayerStackingNode_h | 220 #endif // RenderLayerStackingNode_h |
OLD | NEW |