| 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 "core/css/invalidation/StyleInvalidator.h" | 5 #include "core/css/invalidation/StyleInvalidator.h" |
| 6 | 6 |
| 7 #include "core/css/invalidation/InvalidationSet.h" | 7 #include "core/css/invalidation/InvalidationSet.h" |
| 8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
| 9 #include "core/dom/Element.h" | 9 #include "core/dom/Element.h" |
| 10 #include "core/dom/ElementTraversal.h" | 10 #include "core/dom/ElementTraversal.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 toSiblingInvalidationSet(*invalidationSet).siblingDescendants()) { | 147 toSiblingInvalidationSet(*invalidationSet).siblingDescendants()) { |
| 148 invalidationLists.descendants.push_back(descendants); | 148 invalidationLists.descendants.push_back(descendants); |
| 149 } | 149 } |
| 150 } | 150 } |
| 151 scheduleInvalidationSetsForNode(invalidationLists, *element.parentNode()); | 151 scheduleInvalidationSetsForNode(invalidationLists, *element.parentNode()); |
| 152 } | 152 } |
| 153 | 153 |
| 154 void StyleInvalidator::clearInvalidation(ContainerNode& node) { | 154 void StyleInvalidator::clearInvalidation(ContainerNode& node) { |
| 155 if (!node.needsStyleInvalidation()) | 155 if (!node.needsStyleInvalidation()) |
| 156 return; | 156 return; |
| 157 m_pendingInvalidationMap.remove(&node); | 157 m_pendingInvalidationMap.erase(&node); |
| 158 node.clearNeedsStyleInvalidation(); | 158 node.clearNeedsStyleInvalidation(); |
| 159 } | 159 } |
| 160 | 160 |
| 161 PendingInvalidations& StyleInvalidator::ensurePendingInvalidations( | 161 PendingInvalidations& StyleInvalidator::ensurePendingInvalidations( |
| 162 ContainerNode& node) { | 162 ContainerNode& node) { |
| 163 PendingInvalidationMap::AddResult addResult = | 163 PendingInvalidationMap::AddResult addResult = |
| 164 m_pendingInvalidationMap.add(&node, nullptr); | 164 m_pendingInvalidationMap.add(&node, nullptr); |
| 165 if (addResult.isNewEntry) | 165 if (addResult.isNewEntry) |
| 166 addResult.storedValue->value = WTF::makeUnique<PendingInvalidations>(); | 166 addResult.storedValue->value = WTF::makeUnique<PendingInvalidations>(); |
| 167 return *addResult.storedValue->value; | 167 return *addResult.storedValue->value; |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 continue; | 428 continue; |
| 429 if (recursionData.matchesCurrentInvalidationSetsAsSlotted( | 429 if (recursionData.matchesCurrentInvalidationSetsAsSlotted( |
| 430 toElement(*distributedNode))) | 430 toElement(*distributedNode))) |
| 431 distributedNode->setNeedsStyleRecalc( | 431 distributedNode->setNeedsStyleRecalc( |
| 432 LocalStyleChange, StyleChangeReasonForTracing::create( | 432 LocalStyleChange, StyleChangeReasonForTracing::create( |
| 433 StyleChangeReason::StyleInvalidator)); | 433 StyleChangeReason::StyleInvalidator)); |
| 434 } | 434 } |
| 435 } | 435 } |
| 436 | 436 |
| 437 } // namespace blink | 437 } // namespace blink |
| OLD | NEW |