| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "core/css/invalidation/StyleInvalidator.h" | 7 #include "core/css/invalidation/StyleInvalidator.h" |
| 8 | 8 |
| 9 #include "core/css/invalidation/InvalidationSet.h" | 9 #include "core/css/invalidation/InvalidationSet.h" |
| 10 #include "core/dom/Document.h" | 10 #include "core/dom/Document.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 } | 54 } |
| 55 | 55 |
| 56 if (invalidationSet->invalidatesSelf()) | 56 if (invalidationSet->invalidatesSelf()) |
| 57 element.setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonF
orTracing::create(StyleChangeReason::StyleInvalidator)); | 57 element.setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonF
orTracing::create(StyleChangeReason::StyleInvalidator)); |
| 58 | 58 |
| 59 if (!invalidationSet->isEmpty()) | 59 if (!invalidationSet->isEmpty()) |
| 60 requiresDescendantInvalidation = true; | 60 requiresDescendantInvalidation = true; |
| 61 } | 61 } |
| 62 } | 62 } |
| 63 | 63 |
| 64 if (invalidationLists.siblings.isEmpty() && !requiresDescendantInvalidation) | 64 if (!requiresDescendantInvalidation && (invalidationLists.siblings.isEmpty()
|| !element.nextSibling())) |
| 65 return; | 65 return; |
| 66 | 66 |
| 67 element.setNeedsStyleInvalidation(); | 67 element.setNeedsStyleInvalidation(); |
| 68 |
| 68 PendingInvalidations& pendingInvalidations = ensurePendingInvalidations(elem
ent); | 69 PendingInvalidations& pendingInvalidations = ensurePendingInvalidations(elem
ent); |
| 69 for (auto& invalidationSet : invalidationLists.siblings) | 70 if (element.nextSibling()) { |
| 70 pendingInvalidations.siblings().append(invalidationSet); | 71 for (auto& invalidationSet : invalidationLists.siblings) |
| 72 pendingInvalidations.siblings().append(invalidationSet); |
| 73 } |
| 71 | 74 |
| 72 if (!requiresDescendantInvalidation) | 75 if (!requiresDescendantInvalidation) |
| 73 return; | 76 return; |
| 74 | 77 |
| 75 for (auto& invalidationSet : invalidationLists.descendants) { | 78 for (auto& invalidationSet : invalidationLists.descendants) { |
| 76 ASSERT(!invalidationSet->wholeSubtreeInvalid()); | 79 ASSERT(!invalidationSet->wholeSubtreeInvalid()); |
| 77 if (!invalidationSet->isEmpty()) | 80 if (!invalidationSet->isEmpty()) |
| 78 pendingInvalidations.descendants().append(invalidationSet); | 81 pendingInvalidations.descendants().append(invalidationSet); |
| 79 } | 82 } |
| 80 } | 83 } |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 } | 291 } |
| 289 | 292 |
| 290 DEFINE_TRACE(StyleInvalidator) | 293 DEFINE_TRACE(StyleInvalidator) |
| 291 { | 294 { |
| 292 #if ENABLE(OILPAN) | 295 #if ENABLE(OILPAN) |
| 293 visitor->trace(m_pendingInvalidationMap); | 296 visitor->trace(m_pendingInvalidationMap); |
| 294 #endif | 297 #endif |
| 295 } | 298 } |
| 296 | 299 |
| 297 } // namespace blink | 300 } // namespace blink |
| OLD | NEW |