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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 73 |
74 bool zOrderListsDirty() const { return m_zOrderListsDirty; } | 74 bool zOrderListsDirty() const { return m_zOrderListsDirty; } |
75 void dirtyZOrderLists(); | 75 void dirtyZOrderLists(); |
76 void updateZOrderLists(); | 76 void updateZOrderLists(); |
77 void clearZOrderLists(); | 77 void clearZOrderLists(); |
78 void dirtyStackingContextZOrderLists(); | 78 void dirtyStackingContextZOrderLists(); |
79 | 79 |
80 bool hasPositiveZOrderList() const { return posZOrderList() && posZOrderList
()->size(); } | 80 bool hasPositiveZOrderList() const { return posZOrderList() && posZOrderList
()->size(); } |
81 bool hasNegativeZOrderList() const { return negZOrderList() && negZOrderList
()->size(); } | 81 bool hasNegativeZOrderList() const { return negZOrderList() && negZOrderList
()->size(); } |
82 | 82 |
83 // FIXME: should check for dirtiness here? | |
84 bool isNormalFlowOnly() const { return !isTreatedAsStackingContextForPaintin
g(); } | |
85 bool isTreatedAsStackingContextForPainting() const { return m_isTreatedAsSta
ckingContextForPainting; } | 83 bool isTreatedAsStackingContextForPainting() const { return m_isTreatedAsSta
ckingContextForPainting; } |
86 void updateIsTreatedAsStackingContextForPainting(); | 84 void updateIsTreatedAsStackingContextForPainting(); |
87 bool normalFlowListDirty() const { return m_normalFlowListDirty; } | |
88 void dirtyNormalFlowList(); | |
89 | 85 |
90 void updateStackingNodesAfterStyleChange(const ComputedStyle* oldStyle); | 86 void updateStackingNodesAfterStyleChange(const ComputedStyle* oldStyle); |
91 | 87 |
92 DeprecatedPaintLayerStackingNode* ancestorStackingContextNode() const; | 88 DeprecatedPaintLayerStackingNode* ancestorStackingContextNode() const; |
93 | 89 |
94 // FIXME: A lot of code depends on this function but shouldn't. We should | 90 // FIXME: A lot of code depends on this function but shouldn't. We should |
95 // build our code on top of LayoutBoxModelObject, not DeprecatedPaintLayer. | 91 // build our code on top of LayoutBoxModelObject, not DeprecatedPaintLayer. |
96 DeprecatedPaintLayer* layer() const; | 92 DeprecatedPaintLayer* layer() const; |
97 | 93 |
98 #if ENABLE(ASSERT) | 94 #if ENABLE(ASSERT) |
99 bool layerListMutationAllowed() const { return m_layerListMutationAllowed; } | 95 bool layerListMutationAllowed() const { return m_layerListMutationAllowed; } |
100 void setLayerListMutationAllowed(bool flag) { m_layerListMutationAllowed = f
lag; } | 96 void setLayerListMutationAllowed(bool flag) { m_layerListMutationAllowed = f
lag; } |
101 #endif | 97 #endif |
102 | 98 |
103 private: | 99 private: |
104 friend class DeprecatedPaintLayerStackingNodeIterator; | 100 friend class DeprecatedPaintLayerStackingNodeIterator; |
105 friend class DeprecatedPaintLayerStackingNodeReverseIterator; | 101 friend class DeprecatedPaintLayerStackingNodeReverseIterator; |
106 friend class LayoutTreeAsText; | 102 friend class LayoutTreeAsText; |
107 | 103 |
108 Vector<DeprecatedPaintLayerStackingNode*>* posZOrderList() const | 104 Vector<DeprecatedPaintLayerStackingNode*>* posZOrderList() const |
109 { | 105 { |
110 ASSERT(!m_zOrderListsDirty); | 106 ASSERT(!m_zOrderListsDirty); |
111 ASSERT(isStackingContext() || !m_posZOrderList); | 107 ASSERT(isStackingContext() || !m_posZOrderList); |
112 return m_posZOrderList.get(); | 108 return m_posZOrderList.get(); |
113 } | 109 } |
114 | 110 |
115 Vector<DeprecatedPaintLayerStackingNode*>* normalFlowList() const | |
116 { | |
117 ASSERT(!m_normalFlowListDirty); | |
118 return m_normalFlowList.get(); | |
119 } | |
120 | |
121 Vector<DeprecatedPaintLayerStackingNode*>* negZOrderList() const | 111 Vector<DeprecatedPaintLayerStackingNode*>* negZOrderList() const |
122 { | 112 { |
123 ASSERT(!m_zOrderListsDirty); | 113 ASSERT(!m_zOrderListsDirty); |
124 ASSERT(isStackingContext() || !m_negZOrderList); | 114 ASSERT(isStackingContext() || !m_negZOrderList); |
125 return m_negZOrderList.get(); | 115 return m_negZOrderList.get(); |
126 } | 116 } |
127 | 117 |
128 void rebuildZOrderLists(); | 118 void rebuildZOrderLists(); |
129 | 119 |
130 #if ENABLE(ASSERT) | 120 #if ENABLE(ASSERT) |
131 bool isInStackingParentZOrderLists() const; | 121 bool isInStackingParentZOrderLists() const; |
132 bool isInStackingParentNormalFlowList() const; | |
133 void updateStackingParentForZOrderLists(DeprecatedPaintLayerStackingNode* st
ackingParent); | 122 void updateStackingParentForZOrderLists(DeprecatedPaintLayerStackingNode* st
ackingParent); |
134 void updateStackingParentForNormalFlowList(DeprecatedPaintLayerStackingNode*
stackingParent); | |
135 void setStackingParent(DeprecatedPaintLayerStackingNode* stackingParent) { m
_stackingParent = stackingParent; } | 123 void setStackingParent(DeprecatedPaintLayerStackingNode* stackingParent) { m
_stackingParent = stackingParent; } |
136 #endif | 124 #endif |
137 | 125 |
138 bool shouldBeTreatedAsStackingContextForPainting() const { return layoutObje
ct().style()->isTreatedAsStackingContextForPainting(); } | 126 bool shouldBeTreatedAsStackingContextForPainting() const { return layoutObje
ct().style()->isTreatedAsStackingContextForPainting(); } |
139 | 127 |
140 void updateNormalFlowList(); | |
141 | |
142 bool isDirtyStackingContext() const { return m_zOrderListsDirty && isStackin
gContext(); } | 128 bool isDirtyStackingContext() const { return m_zOrderListsDirty && isStackin
gContext(); } |
143 | 129 |
144 DeprecatedPaintLayerCompositor* compositor() const; | 130 DeprecatedPaintLayerCompositor* compositor() const; |
145 // We can't return a LayoutBox as LayoutInline can be a stacking context. | 131 // We can't return a LayoutBox as LayoutInline can be a stacking context. |
146 LayoutBoxModelObject& layoutObject() const { return m_layoutObject; } | 132 LayoutBoxModelObject& layoutObject() const { return m_layoutObject; } |
147 | 133 |
148 LayoutBoxModelObject& m_layoutObject; | 134 LayoutBoxModelObject& m_layoutObject; |
149 | 135 |
150 // m_posZOrderList holds a sorted list of all the descendant nodes within | 136 // m_posZOrderList holds a sorted list of all the descendant nodes within |
151 // that have z-indices of 0 or greater (auto will count as 0). | 137 // that have z-indices of 0 or greater (auto will count as 0). |
152 // m_negZOrderList holds descendants within our stacking context with | 138 // m_negZOrderList holds descendants within our stacking context with |
153 // negative z-indices. | 139 // negative z-indices. |
154 OwnPtr<Vector<DeprecatedPaintLayerStackingNode*>> m_posZOrderList; | 140 OwnPtr<Vector<DeprecatedPaintLayerStackingNode*>> m_posZOrderList; |
155 OwnPtr<Vector<DeprecatedPaintLayerStackingNode*>> m_negZOrderList; | 141 OwnPtr<Vector<DeprecatedPaintLayerStackingNode*>> m_negZOrderList; |
156 | 142 |
157 // This list contains child nodes that cannot create stacking contexts. | |
158 OwnPtr<Vector<DeprecatedPaintLayerStackingNode*>> m_normalFlowList; | |
159 | |
160 unsigned m_zOrderListsDirty : 1; | 143 unsigned m_zOrderListsDirty : 1; |
161 unsigned m_normalFlowListDirty: 1; | |
162 unsigned m_isTreatedAsStackingContextForPainting : 1; | 144 unsigned m_isTreatedAsStackingContextForPainting : 1; |
163 | 145 |
164 #if ENABLE(ASSERT) | 146 #if ENABLE(ASSERT) |
165 unsigned m_layerListMutationAllowed : 1; | 147 unsigned m_layerListMutationAllowed : 1; |
166 DeprecatedPaintLayerStackingNode* m_stackingParent; | 148 DeprecatedPaintLayerStackingNode* m_stackingParent; |
167 #endif | 149 #endif |
168 }; | 150 }; |
169 | 151 |
170 inline void DeprecatedPaintLayerStackingNode::clearZOrderLists() | 152 inline void DeprecatedPaintLayerStackingNode::clearZOrderLists() |
171 { | 153 { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 | 192 |
211 private: | 193 private: |
212 DeprecatedPaintLayerStackingNode* m_stackingNode; | 194 DeprecatedPaintLayerStackingNode* m_stackingNode; |
213 bool m_previousMutationAllowedState; | 195 bool m_previousMutationAllowedState; |
214 }; | 196 }; |
215 #endif | 197 #endif |
216 | 198 |
217 } // namespace blink | 199 } // namespace blink |
218 | 200 |
219 #endif // DeprecatedPaintLayerStackingNode_h | 201 #endif // DeprecatedPaintLayerStackingNode_h |
OLD | NEW |