Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(733)

Side by Side Diff: Source/core/paint/DeprecatedPaintLayerStackingNode.h

Issue 1176503002: Rename isNormalFlowOnly to something meaningful (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Nittified! Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 class LayoutBoxModelObject; 59 class LayoutBoxModelObject;
60 60
61 class CORE_EXPORT DeprecatedPaintLayerStackingNode { 61 class CORE_EXPORT DeprecatedPaintLayerStackingNode {
62 WTF_MAKE_NONCOPYABLE(DeprecatedPaintLayerStackingNode); 62 WTF_MAKE_NONCOPYABLE(DeprecatedPaintLayerStackingNode);
63 public: 63 public:
64 explicit DeprecatedPaintLayerStackingNode(DeprecatedPaintLayer*); 64 explicit DeprecatedPaintLayerStackingNode(DeprecatedPaintLayer*);
65 ~DeprecatedPaintLayerStackingNode(); 65 ~DeprecatedPaintLayerStackingNode();
66 66
67 int zIndex() const { return layoutObject()->style()->zIndex(); } 67 int zIndex() const { return layoutObject()->style()->zIndex(); }
68 68
69 // A stacking context is a layer that has a non-auto z-index. 69 bool isStackingContext() const { return layoutObject()->style()->isStackingC ontext(); }
70 bool isStackingContext() const { return !layoutObject()->style()->hasAutoZIn dex(); }
71 70
72 // Update our normal and z-index lists. 71 // Update our normal and z-index lists.
73 void updateLayerListsIfNeeded(); 72 void updateLayerListsIfNeeded();
74 73
75 bool zOrderListsDirty() const { return m_zOrderListsDirty; } 74 bool zOrderListsDirty() const { return m_zOrderListsDirty; }
76 void dirtyZOrderLists(); 75 void dirtyZOrderLists();
77 void updateZOrderLists(); 76 void updateZOrderLists();
78 void clearZOrderLists(); 77 void clearZOrderLists();
79 void dirtyStackingContextZOrderLists(); 78 void dirtyStackingContextZOrderLists();
80 79
81 bool hasPositiveZOrderList() const { return posZOrderList() && posZOrderList ()->size(); } 80 bool hasPositiveZOrderList() const { return posZOrderList() && posZOrderList ()->size(); }
82 bool hasNegativeZOrderList() const { return negZOrderList() && negZOrderList ()->size(); } 81 bool hasNegativeZOrderList() const { return negZOrderList() && negZOrderList ()->size(); }
83 82
84 // FIXME: should check for dirtiness here? 83 // FIXME: should check for dirtiness here?
85 bool isNormalFlowOnly() const { return m_isNormalFlowOnly; } 84 bool isNormalFlowOnly() const { return !isTreatedAsStackingContextForPaintin g(); }
86 void updateIsNormalFlowOnly(); 85 bool isTreatedAsStackingContextForPainting() const { return m_isTreatedAsSta ckingContextForPainting; }
86 void updateIsTreatedAsStackingContextForPainting();
87 bool normalFlowListDirty() const { return m_normalFlowListDirty; } 87 bool normalFlowListDirty() const { return m_normalFlowListDirty; }
88 void dirtyNormalFlowList(); 88 void dirtyNormalFlowList();
89 89
90 void updateStackingNodesAfterStyleChange(const ComputedStyle* oldStyle); 90 void updateStackingNodesAfterStyleChange(const ComputedStyle* oldStyle);
91 91
92 DeprecatedPaintLayerStackingNode* ancestorStackingContextNode() const; 92 DeprecatedPaintLayerStackingNode* ancestorStackingContextNode() const;
93 93
94 DeprecatedPaintLayer* layer() const { return m_layer; } 94 DeprecatedPaintLayer* layer() const { return m_layer; }
95 95
96 #if ENABLE(ASSERT) 96 #if ENABLE(ASSERT)
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 void collectLayers(OwnPtr<Vector<DeprecatedPaintLayerStackingNode*>>& posZOr derList, OwnPtr<Vector<DeprecatedPaintLayerStackingNode*>>& negZOrderList); 131 void collectLayers(OwnPtr<Vector<DeprecatedPaintLayerStackingNode*>>& posZOr derList, OwnPtr<Vector<DeprecatedPaintLayerStackingNode*>>& negZOrderList);
132 132
133 #if ENABLE(ASSERT) 133 #if ENABLE(ASSERT)
134 bool isInStackingParentZOrderLists() const; 134 bool isInStackingParentZOrderLists() const;
135 bool isInStackingParentNormalFlowList() const; 135 bool isInStackingParentNormalFlowList() const;
136 void updateStackingParentForZOrderLists(DeprecatedPaintLayerStackingNode* st ackingParent); 136 void updateStackingParentForZOrderLists(DeprecatedPaintLayerStackingNode* st ackingParent);
137 void updateStackingParentForNormalFlowList(DeprecatedPaintLayerStackingNode* stackingParent); 137 void updateStackingParentForNormalFlowList(DeprecatedPaintLayerStackingNode* stackingParent);
138 void setStackingParent(DeprecatedPaintLayerStackingNode* stackingParent) { m _stackingParent = stackingParent; } 138 void setStackingParent(DeprecatedPaintLayerStackingNode* stackingParent) { m _stackingParent = stackingParent; }
139 #endif 139 #endif
140 140
141 bool shouldBeNormalFlowOnly() const; 141 bool shouldBeTreatedAsStackingContextForPainting() const { return layoutObje ct()->style()->isTreatedAsStackingContextForPainting(); }
142 142
143 void updateNormalFlowList(); 143 void updateNormalFlowList();
144 144
145 bool isDirtyStackingContext() const { return m_zOrderListsDirty && isStackin gContext(); } 145 bool isDirtyStackingContext() const { return m_zOrderListsDirty && isStackin gContext(); }
146 146
147 DeprecatedPaintLayerCompositor* compositor() const; 147 DeprecatedPaintLayerCompositor* compositor() const;
148 // We can't return a LayoutBox as LayoutInline can be a stacking context. 148 // We can't return a LayoutBox as LayoutInline can be a stacking context.
149 LayoutBoxModelObject* layoutObject() const; 149 LayoutBoxModelObject* layoutObject() const;
150 150
151 DeprecatedPaintLayer* m_layer; 151 DeprecatedPaintLayer* m_layer;
152 152
153 // m_posZOrderList holds a sorted list of all the descendant nodes within 153 // m_posZOrderList holds a sorted list of all the descendant nodes within
154 // that have z-indices of 0 or greater (auto will count as 0). 154 // that have z-indices of 0 or greater (auto will count as 0).
155 // m_negZOrderList holds descendants within our stacking context with 155 // m_negZOrderList holds descendants within our stacking context with
156 // negative z-indices. 156 // negative z-indices.
157 OwnPtr<Vector<DeprecatedPaintLayerStackingNode*>> m_posZOrderList; 157 OwnPtr<Vector<DeprecatedPaintLayerStackingNode*>> m_posZOrderList;
158 OwnPtr<Vector<DeprecatedPaintLayerStackingNode*>> m_negZOrderList; 158 OwnPtr<Vector<DeprecatedPaintLayerStackingNode*>> m_negZOrderList;
159 159
160 // This list contains child nodes that cannot create stacking contexts. 160 // This list contains child nodes that cannot create stacking contexts.
161 OwnPtr<Vector<DeprecatedPaintLayerStackingNode*>> m_normalFlowList; 161 OwnPtr<Vector<DeprecatedPaintLayerStackingNode*>> m_normalFlowList;
162 162
163 unsigned m_zOrderListsDirty : 1; 163 unsigned m_zOrderListsDirty : 1;
164 unsigned m_normalFlowListDirty: 1; 164 unsigned m_normalFlowListDirty: 1;
165 unsigned m_isNormalFlowOnly : 1; 165 unsigned m_isTreatedAsStackingContextForPainting : 1;
166 166
167 #if ENABLE(ASSERT) 167 #if ENABLE(ASSERT)
168 unsigned m_layerListMutationAllowed : 1; 168 unsigned m_layerListMutationAllowed : 1;
169 DeprecatedPaintLayerStackingNode* m_stackingParent; 169 DeprecatedPaintLayerStackingNode* m_stackingParent;
170 #endif 170 #endif
171 }; 171 };
172 172
173 inline void DeprecatedPaintLayerStackingNode::clearZOrderLists() 173 inline void DeprecatedPaintLayerStackingNode::clearZOrderLists()
174 { 174 {
175 ASSERT(!isStackingContext()); 175 ASSERT(!isStackingContext());
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 213
214 private: 214 private:
215 DeprecatedPaintLayerStackingNode* m_stackingNode; 215 DeprecatedPaintLayerStackingNode* m_stackingNode;
216 bool m_previousMutationAllowedState; 216 bool m_previousMutationAllowedState;
217 }; 217 };
218 #endif 218 #endif
219 219
220 } // namespace blink 220 } // namespace blink
221 221
222 #endif // DeprecatedPaintLayerStackingNode_h 222 #endif // DeprecatedPaintLayerStackingNode_h
OLDNEW
« no previous file with comments | « Source/core/paint/DeprecatedPaintLayer.cpp ('k') | Source/core/paint/DeprecatedPaintLayerStackingNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698