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

Side by Side Diff: sky/engine/core/dom/DocumentLifecycle.h

Issue 755843003: Remove compositing states from DocumentLifeCycle. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 VisualUpdatePending, 48 VisualUpdatePending,
49 49
50 InStyleRecalc, 50 InStyleRecalc,
51 StyleClean, 51 StyleClean,
52 52
53 InPreLayout, 53 InPreLayout,
54 InPerformLayout, 54 InPerformLayout,
55 AfterPerformLayout, 55 AfterPerformLayout,
56 LayoutClean, 56 LayoutClean,
57 57
58 InCompositingUpdate,
59 CompositingClean,
60
61 InPaintInvalidation, 58 InPaintInvalidation,
62 PaintInvalidationClean, 59 PaintInvalidationClean,
63 60
64 // Once the document starts shuting down, we cannot return 61 // Once the document starts shuting down, we cannot return
65 // to the style/layout/rendering states. 62 // to the style/layout/rendering states.
66 Stopping, 63 Stopping,
67 Stopped, 64 Stopped,
68 Disposed, 65 Disposed,
69 }; 66 };
70 67
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 bool canAdvanceTo(State) const; 136 bool canAdvanceTo(State) const;
140 bool canRewindTo(State) const; 137 bool canRewindTo(State) const;
141 #endif 138 #endif
142 139
143 State m_state; 140 State m_state;
144 int m_detachCount; 141 int m_detachCount;
145 }; 142 };
146 143
147 inline bool DocumentLifecycle::stateAllowsTreeMutations() const 144 inline bool DocumentLifecycle::stateAllowsTreeMutations() const
148 { 145 {
149 // FIXME: We should not allow mutations in InPreLayout or AfterPerformLayout either, 146 return m_state != InStyleRecalc && m_state != InPerformLayout;
150 // but we need to fix MediaList listeners and plugins first.
151 return m_state != InStyleRecalc
152 && m_state != InPerformLayout
153 && m_state != InCompositingUpdate;
154 } 147 }
155 148
156 inline bool DocumentLifecycle::stateAllowsRenderTreeMutations() const 149 inline bool DocumentLifecycle::stateAllowsRenderTreeMutations() const
157 { 150 {
158 return m_detachCount || m_state == InStyleRecalc; 151 return m_detachCount || m_state == InStyleRecalc;
159 } 152 }
160 153
161 inline bool DocumentLifecycle::stateAllowsDetach() const 154 inline bool DocumentLifecycle::stateAllowsDetach() const
162 { 155 {
163 return m_state == VisualUpdatePending 156 return m_state == VisualUpdatePending
164 || m_state == InStyleRecalc 157 || m_state == InStyleRecalc
165 || m_state == StyleClean 158 || m_state == StyleClean
166 || m_state == InPreLayout 159 || m_state == InPreLayout
167 || m_state == LayoutClean 160 || m_state == LayoutClean
168 || m_state == CompositingClean
169 || m_state == PaintInvalidationClean 161 || m_state == PaintInvalidationClean
170 || m_state == Stopping; 162 || m_state == Stopping;
171 } 163 }
172 164
173 } 165 }
174 166
175 #endif // SKY_ENGINE_CORE_DOM_DOCUMENTLIFECYCLE_H_ 167 #endif // SKY_ENGINE_CORE_DOM_DOCUMENTLIFECYCLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698