| OLD | NEW |
| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 InPerformLayout, | 58 InPerformLayout, |
| 59 AfterPerformLayout, | 59 AfterPerformLayout, |
| 60 LayoutClean, | 60 LayoutClean, |
| 61 | 61 |
| 62 InCompositingUpdate, | 62 InCompositingUpdate, |
| 63 CompositingClean, | 63 CompositingClean, |
| 64 | 64 |
| 65 InPaintInvalidation, | 65 InPaintInvalidation, |
| 66 PaintInvalidationClean, | 66 PaintInvalidationClean, |
| 67 | 67 |
| 68 InPaintForSlimmingPaintV2, |
| 69 PaintForSlimmingPaintV2Clean, |
| 70 |
| 71 InCompositingForSlimmingPaintV2, |
| 72 CompositingForSlimmingPaintV2Clean, |
| 73 |
| 68 // Once the document starts shuting down, we cannot return | 74 // Once the document starts shuting down, we cannot return |
| 69 // to the style/layout/compositing states. | 75 // to the style/layout/compositing states. |
| 70 Stopping, | 76 Stopping, |
| 71 Stopped, | 77 Stopped, |
| 72 Disposed, | 78 Disposed, |
| 73 }; | 79 }; |
| 74 | 80 |
| 75 class Scope { | 81 class Scope { |
| 76 WTF_MAKE_NONCOPYABLE(Scope); | 82 WTF_MAKE_NONCOPYABLE(Scope); |
| 77 public: | 83 public: |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 State m_state; | 156 State m_state; |
| 151 int m_detachCount; | 157 int m_detachCount; |
| 152 }; | 158 }; |
| 153 | 159 |
| 154 inline bool DocumentLifecycle::stateAllowsTreeMutations() const | 160 inline bool DocumentLifecycle::stateAllowsTreeMutations() const |
| 155 { | 161 { |
| 156 // FIXME: We should not allow mutations in InPreLayout or AfterPerformLayout
either, | 162 // FIXME: We should not allow mutations in InPreLayout or AfterPerformLayout
either, |
| 157 // but we need to fix MediaList listeners and plugins first. | 163 // but we need to fix MediaList listeners and plugins first. |
| 158 return m_state != InStyleRecalc | 164 return m_state != InStyleRecalc |
| 159 && m_state != InPerformLayout | 165 && m_state != InPerformLayout |
| 160 && m_state != InCompositingUpdate; | 166 && m_state != InCompositingUpdate |
| 167 && m_state != InPaintForSlimmingPaintV2 |
| 168 && m_state != InCompositingForSlimmingPaintV2; |
| 161 } | 169 } |
| 162 | 170 |
| 163 inline bool DocumentLifecycle::stateAllowsLayoutTreeMutations() const | 171 inline bool DocumentLifecycle::stateAllowsLayoutTreeMutations() const |
| 164 { | 172 { |
| 165 return m_detachCount || m_state == InStyleRecalc || m_state == InLayoutSubtr
eeChange; | 173 return m_detachCount || m_state == InStyleRecalc || m_state == InLayoutSubtr
eeChange; |
| 166 } | 174 } |
| 167 | 175 |
| 168 inline bool DocumentLifecycle::stateAllowsLayoutTreeNotifications() const | 176 inline bool DocumentLifecycle::stateAllowsLayoutTreeNotifications() const |
| 169 { | 177 { |
| 170 return m_state == InLayoutSubtreeChange; | 178 return m_state == InLayoutSubtreeChange; |
| 171 } | 179 } |
| 172 | 180 |
| 173 inline bool DocumentLifecycle::stateAllowsDetach() const | 181 inline bool DocumentLifecycle::stateAllowsDetach() const |
| 174 { | 182 { |
| 175 return m_state == VisualUpdatePending | 183 return m_state == VisualUpdatePending |
| 176 || m_state == InStyleRecalc | 184 || m_state == InStyleRecalc |
| 177 || m_state == StyleClean | 185 || m_state == StyleClean |
| 178 || m_state == LayoutSubtreeChangeClean | 186 || m_state == LayoutSubtreeChangeClean |
| 179 || m_state == InPreLayout | 187 || m_state == InPreLayout |
| 180 || m_state == LayoutClean | 188 || m_state == LayoutClean |
| 181 || m_state == CompositingClean | 189 || m_state == CompositingClean |
| 182 || m_state == PaintInvalidationClean | 190 || m_state == PaintInvalidationClean |
| 191 || m_state == PaintForSlimmingPaintV2Clean |
| 192 || m_state == CompositingForSlimmingPaintV2Clean |
| 183 || m_state == Stopping; | 193 || m_state == Stopping; |
| 184 } | 194 } |
| 185 | 195 |
| 186 inline bool DocumentLifecycle::stateAllowsLayoutInvalidation() const | 196 inline bool DocumentLifecycle::stateAllowsLayoutInvalidation() const |
| 187 { | 197 { |
| 188 return m_state != InPerformLayout | 198 return m_state != InPerformLayout |
| 189 && m_state != InCompositingUpdate | 199 && m_state != InCompositingUpdate |
| 190 && m_state != InPaintInvalidation; | 200 && m_state != InPaintInvalidation |
| 201 && m_state != InPaintForSlimmingPaintV2 |
| 202 && m_state != InCompositingForSlimmingPaintV2; |
| 191 } | 203 } |
| 192 | 204 |
| 193 } // namespace blink | 205 } // namespace blink |
| 194 | 206 |
| 195 #endif | 207 #endif |
| OLD | NEW |