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