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 #ifndef StyleInvalidator_h | 5 #ifndef StyleInvalidator_h |
6 #define StyleInvalidator_h | 6 #define StyleInvalidator_h |
7 | 7 |
8 #include "core/css/RuleFeature.h" | 8 #include "core/css/RuleFeature.h" |
9 #include "heap/Heap.h" | 9 #include "heap/Heap.h" |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 bool checkInvalidationSetsAgainstElement(Element&); | 23 bool checkInvalidationSetsAgainstElement(Element&); |
24 | 24 |
25 struct RecursionData { | 25 struct RecursionData { |
26 RecursionData() : m_foundInvalidationSet(false) { } | 26 RecursionData() : m_foundInvalidationSet(false) { } |
27 void pushInvalidationSet(const DescendantInvalidationSet&); | 27 void pushInvalidationSet(const DescendantInvalidationSet&); |
28 bool matchesCurrentInvalidationSets(Element&); | 28 bool matchesCurrentInvalidationSets(Element&); |
29 bool foundInvalidationSet() { return m_foundInvalidationSet; } | 29 bool foundInvalidationSet() { return m_foundInvalidationSet; } |
30 | 30 |
31 Vector<AtomicString> m_invalidationClasses; | 31 Vector<AtomicString> m_invalidationClasses; |
| 32 Vector<AtomicString> m_invalidationAttributes; |
32 bool m_foundInvalidationSet; | 33 bool m_foundInvalidationSet; |
33 }; | 34 }; |
34 | 35 |
35 class RecursionCheckpoint { | 36 class RecursionCheckpoint { |
36 public: | 37 public: |
37 RecursionCheckpoint(RecursionData* data) | 38 RecursionCheckpoint(RecursionData* data) |
38 : m_prevClassLength(data->m_invalidationClasses.size()), | 39 : m_prevClassLength(data->m_invalidationClasses.size()), |
| 40 m_prevAttributeLength(data->m_invalidationAttributes.size()), |
39 m_prevFoundInvalidationSet(data->m_foundInvalidationSet), | 41 m_prevFoundInvalidationSet(data->m_foundInvalidationSet), |
40 m_data(data) | 42 m_data(data) |
41 { } | 43 { } |
42 ~RecursionCheckpoint() | 44 ~RecursionCheckpoint() |
43 { | 45 { |
44 m_data->m_invalidationClasses.remove(m_prevClassLength, m_data->m_in
validationClasses.size() - m_prevClassLength); | 46 m_data->m_invalidationClasses.remove(m_prevClassLength, m_data->m_in
validationClasses.size() - m_prevClassLength); |
45 m_data->m_foundInvalidationSet = m_prevFoundInvalidationSet; | 47 m_data->m_foundInvalidationSet = m_prevFoundInvalidationSet; |
46 } | 48 } |
47 | 49 |
48 private: | 50 private: |
49 int m_prevClassLength; | 51 int m_prevClassLength; |
| 52 int m_prevAttributeLength; |
50 bool m_prevFoundInvalidationSet; | 53 bool m_prevFoundInvalidationSet; |
51 RecursionData* m_data; | 54 RecursionData* m_data; |
52 }; | 55 }; |
53 | 56 |
54 Document& m_document; | 57 Document& m_document; |
55 RuleFeatureSet::PendingInvalidationMap& m_pendingInvalidationMap; | 58 RuleFeatureSet::PendingInvalidationMap& m_pendingInvalidationMap; |
56 RecursionData m_recursionData; | 59 RecursionData m_recursionData; |
57 }; | 60 }; |
58 | 61 |
59 } // namespace WebCore | 62 } // namespace WebCore |
60 | 63 |
61 #endif // StyleInvalidator_h | 64 #endif // StyleInvalidator_h |
OLD | NEW |