| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 if (state == InPerformLayout) | 120 if (state == InPerformLayout) |
| 121 return true; | 121 return true; |
| 122 // We can redundant arrive in the layout clean state. This situation | 122 // We can redundant arrive in the layout clean state. This situation |
| 123 // can happen when we call layout recursively and we unwind the stack. | 123 // can happen when we call layout recursively and we unwind the stack. |
| 124 if (state == LayoutClean) | 124 if (state == LayoutClean) |
| 125 return true; | 125 return true; |
| 126 if (state == StyleClean) | 126 if (state == StyleClean) |
| 127 return true; | 127 return true; |
| 128 return false; | 128 return false; |
| 129 } | 129 } |
| 130 if (m_state == CompositingClean) { | |
| 131 if (state == InStyleRecalc) | |
| 132 return true; | |
| 133 if (state == InCompositingUpdate) | |
| 134 return true; | |
| 135 if (state == InPaintInvalidation) | |
| 136 return true; | |
| 137 return false; | |
| 138 } | |
| 139 if (m_state == InPaintInvalidation) { | 130 if (m_state == InPaintInvalidation) { |
| 140 if (state == PaintInvalidationClean) | 131 if (state == PaintInvalidationClean) |
| 141 return true; | 132 return true; |
| 142 return false; | 133 return false; |
| 143 } | 134 } |
| 144 if (m_state == PaintInvalidationClean) { | 135 if (m_state == PaintInvalidationClean) { |
| 145 if (state == InStyleRecalc) | 136 if (state == InStyleRecalc) |
| 146 return true; | 137 return true; |
| 147 if (state == InPreLayout) | 138 if (state == InPreLayout) |
| 148 return true; | 139 return true; |
| 149 if (state == InCompositingUpdate) | 140 if (state == InPaintInvalidation) |
| 150 return true; | 141 return true; |
| 151 return false; | 142 return false; |
| 152 } | 143 } |
| 153 return false; | 144 return false; |
| 154 } | 145 } |
| 155 | 146 |
| 156 bool DocumentLifecycle::canRewindTo(State state) const | 147 bool DocumentLifecycle::canRewindTo(State state) const |
| 157 { | 148 { |
| 158 // This transition is bogus, but we've whitelisted it anyway. | 149 // This transition is bogus, but we've whitelisted it anyway. |
| 159 if (s_deprecatedTransitionStack && m_state == s_deprecatedTransitionStack->f
rom() && state == s_deprecatedTransitionStack->to()) | 150 if (s_deprecatedTransitionStack && m_state == s_deprecatedTransitionStack->f
rom() && state == s_deprecatedTransitionStack->to()) |
| 160 return true; | 151 return true; |
| 161 return m_state == StyleClean || m_state == AfterPerformLayout || m_state ==
LayoutClean || m_state == CompositingClean || m_state == PaintInvalidationClean; | 152 return m_state == StyleClean || m_state == AfterPerformLayout || m_state ==
LayoutClean || m_state == PaintInvalidationClean; |
| 162 } | 153 } |
| 163 | 154 |
| 164 #endif | 155 #endif |
| 165 | 156 |
| 166 void DocumentLifecycle::advanceTo(State state) | 157 void DocumentLifecycle::advanceTo(State state) |
| 167 { | 158 { |
| 168 ASSERT(canAdvanceTo(state)); | 159 ASSERT(canAdvanceTo(state)); |
| 169 m_state = state; | 160 m_state = state; |
| 170 } | 161 } |
| 171 | 162 |
| 172 void DocumentLifecycle::ensureStateAtMost(State state) | 163 void DocumentLifecycle::ensureStateAtMost(State state) |
| 173 { | 164 { |
| 174 ASSERT(state == VisualUpdatePending || state == StyleClean || state == Layou
tClean); | 165 ASSERT(state == VisualUpdatePending || state == StyleClean || state == Layou
tClean); |
| 175 if (m_state <= state) | 166 if (m_state <= state) |
| 176 return; | 167 return; |
| 177 ASSERT(canRewindTo(state)); | 168 ASSERT(canRewindTo(state)); |
| 178 m_state = state; | 169 m_state = state; |
| 179 } | 170 } |
| 180 | 171 |
| 181 } | 172 } |
| OLD | NEW |