| OLD | NEW |
| 1 | 1 |
| 2 // Copyright 2014 The Chromium Authors. All rights reserved. | 2 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
| 4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
| 5 | 5 |
| 6 #include "config.h" | 6 #include "config.h" |
| 7 | 7 |
| 8 #include "core/css/invalidation/StyleInvalidator.h" | 8 #include "core/css/invalidation/StyleInvalidator.h" |
| 9 | 9 |
| 10 #include "core/css/invalidation/DescendantInvalidationSet.h" | 10 #include "core/css/invalidation/DescendantInvalidationSet.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 m_invalidateCustomPseudo = invalidationSet.customPseudoInvalid(); | 82 m_invalidateCustomPseudo = invalidationSet.customPseudoInvalid(); |
| 83 } | 83 } |
| 84 | 84 |
| 85 bool StyleInvalidator::RecursionData::matchesCurrentInvalidationSets(Element& el
ement) | 85 bool StyleInvalidator::RecursionData::matchesCurrentInvalidationSets(Element& el
ement) |
| 86 { | 86 { |
| 87 ASSERT(!m_wholeSubtreeInvalid); | 87 ASSERT(!m_wholeSubtreeInvalid); |
| 88 | 88 |
| 89 if (m_invalidateCustomPseudo && element.shadowPseudoId() != nullAtom) | 89 if (m_invalidateCustomPseudo && element.shadowPseudoId() != nullAtom) |
| 90 return true; | 90 return true; |
| 91 | 91 |
| 92 for (InvalidationSets::iterator it = m_invalidationSets.begin(); it != m_inv
alidationSets.end(); ++it) { | 92 for (const auto& invalidationSet : m_invalidationSets) { |
| 93 if ((*it)->invalidatesElement(element)) | 93 if (invalidationSet->invalidatesElement(element)) |
| 94 return true; | 94 return true; |
| 95 } | 95 } |
| 96 | 96 |
| 97 return false; | 97 return false; |
| 98 } | 98 } |
| 99 | 99 |
| 100 bool StyleInvalidator::checkInvalidationSetsAgainstElement(Element& element, Sty
leInvalidator::RecursionData& recursionData) | 100 bool StyleInvalidator::checkInvalidationSetsAgainstElement(Element& element, Sty
leInvalidator::RecursionData& recursionData) |
| 101 { | 101 { |
| 102 if (element.styleChangeType() >= SubtreeStyleChange || recursionData.wholeSu
btreeInvalid()) { | 102 if (element.styleChangeType() >= SubtreeStyleChange || recursionData.wholeSu
btreeInvalid()) { |
| 103 recursionData.setWholeSubtreeInvalid(); | 103 recursionData.setWholeSubtreeInvalid(); |
| 104 return false; | 104 return false; |
| 105 } | 105 } |
| 106 if (element.needsStyleInvalidation()) { | 106 if (element.needsStyleInvalidation()) { |
| 107 if (InvalidationList* invalidationList = m_pendingInvalidationMap.get(&e
lement)) { | 107 if (InvalidationList* invalidationList = m_pendingInvalidationMap.get(&e
lement)) { |
| 108 for (InvalidationList::const_iterator it = invalidationList->begin()
; it != invalidationList->end(); ++it) | 108 for (const auto& invalidationSet : *invalidationList) |
| 109 recursionData.pushInvalidationSet(**it); | 109 recursionData.pushInvalidationSet(*invalidationSet); |
| 110 // FIXME: It's really only necessary to clone the render style for t
his element, not full style recalc. | 110 // FIXME: It's really only necessary to clone the render style for t
his element, not full style recalc. |
| 111 return true; | 111 return true; |
| 112 } | 112 } |
| 113 } | 113 } |
| 114 return recursionData.matchesCurrentInvalidationSets(element); | 114 return recursionData.matchesCurrentInvalidationSets(element); |
| 115 } | 115 } |
| 116 | 116 |
| 117 bool StyleInvalidator::invalidateChildren(Element& element, StyleInvalidator::Re
cursionData& recursionData) | 117 bool StyleInvalidator::invalidateChildren(Element& element, StyleInvalidator::Re
cursionData& recursionData) |
| 118 { | 118 { |
| 119 bool someChildrenNeedStyleRecalc = false; | 119 bool someChildrenNeedStyleRecalc = false; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 } | 161 } |
| 162 | 162 |
| 163 void StyleInvalidator::trace(Visitor* visitor) | 163 void StyleInvalidator::trace(Visitor* visitor) |
| 164 { | 164 { |
| 165 #if ENABLE(OILPAN) | 165 #if ENABLE(OILPAN) |
| 166 visitor->trace(m_pendingInvalidationMap); | 166 visitor->trace(m_pendingInvalidationMap); |
| 167 #endif | 167 #endif |
| 168 } | 168 } |
| 169 | 169 |
| 170 } // namespace blink | 170 } // namespace blink |
| OLD | NEW |