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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 | 242 |
243 bool StyleInvalidator::SiblingData::MatchCurrentInvalidationSets( | 243 bool StyleInvalidator::SiblingData::MatchCurrentInvalidationSets( |
244 Element& element, | 244 Element& element, |
245 RecursionData& recursion_data) { | 245 RecursionData& recursion_data) { |
246 bool this_element_needs_style_recalc = false; | 246 bool this_element_needs_style_recalc = false; |
247 DCHECK(!recursion_data.WholeSubtreeInvalid()); | 247 DCHECK(!recursion_data.WholeSubtreeInvalid()); |
248 | 248 |
249 unsigned index = 0; | 249 unsigned index = 0; |
250 while (index < invalidation_entries_.size()) { | 250 while (index < invalidation_entries_.size()) { |
251 if (element_index_ > invalidation_entries_[index].invalidation_limit_) { | 251 if (element_index_ > invalidation_entries_[index].invalidation_limit_) { |
252 // m_invalidationEntries[index] only applies to earlier siblings. Remove | 252 // invalidation_entries_[index] only applies to earlier siblings. Remove |
253 // it. | 253 // it. |
254 invalidation_entries_[index] = invalidation_entries_.back(); | 254 invalidation_entries_[index] = invalidation_entries_.back(); |
255 invalidation_entries_.pop_back(); | 255 invalidation_entries_.pop_back(); |
256 continue; | 256 continue; |
257 } | 257 } |
258 | 258 |
259 const SiblingInvalidationSet& invalidation_set = | 259 const SiblingInvalidationSet& invalidation_set = |
260 *invalidation_entries_[index].invalidation_set_; | 260 *invalidation_entries_[index].invalidation_set_; |
261 ++index; | 261 ++index; |
262 if (!invalidation_set.InvalidatesElement(element)) | 262 if (!invalidation_set.InvalidatesElement(element)) |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 continue; | 441 continue; |
442 if (recursion_data.MatchesCurrentInvalidationSetsAsSlotted( | 442 if (recursion_data.MatchesCurrentInvalidationSetsAsSlotted( |
443 ToElement(*distributed_node))) | 443 ToElement(*distributed_node))) |
444 distributed_node->SetNeedsStyleRecalc( | 444 distributed_node->SetNeedsStyleRecalc( |
445 kLocalStyleChange, StyleChangeReasonForTracing::Create( | 445 kLocalStyleChange, StyleChangeReasonForTracing::Create( |
446 StyleChangeReason::kStyleInvalidator)); | 446 StyleChangeReason::kStyleInvalidator)); |
447 } | 447 } |
448 } | 448 } |
449 | 449 |
450 } // namespace blink | 450 } // namespace blink |
OLD | NEW |