Chromium Code Reviews| 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" | |
| 9 #include "heap/Heap.h" | 8 #include "heap/Heap.h" |
| 10 | 9 |
| 11 namespace WebCore { | 10 namespace WebCore { |
| 12 | 11 |
| 12 class DescendantInvalidationSet; | |
| 13 class Document; | |
| 14 class Element; | |
| 15 | |
| 13 class StyleInvalidator { | 16 class StyleInvalidator { |
| 14 STACK_ALLOCATED(); | |
| 15 public: | 17 public: |
| 16 explicit StyleInvalidator(Document&); | 18 explicit StyleInvalidator(); |
|
esprehn
2014/03/31 19:45:33
You don't need explicit since this doesn't take an
chrishtr
2014/03/31 20:07:37
Done.
| |
| 17 void invalidate(); | 19 void invalidate(Document&); |
| 20 void scheduleInvalidation(PassRefPtr<DescendantInvalidationSet>, Element&); | |
| 21 | |
| 22 // Clears all style invalidation state for the passed node. | |
| 23 void clearInvalidation(Node&); | |
| 24 | |
| 25 void clearPendingInvalidations(); | |
| 18 | 26 |
| 19 private: | 27 private: |
| 20 bool invalidate(Element&); | 28 bool invalidate(Element&); |
| 21 bool invalidateChildren(Element&); | 29 bool invalidateChildren(Element&); |
| 22 | 30 |
| 23 bool checkInvalidationSetsAgainstElement(Element&); | 31 bool checkInvalidationSetsAgainstElement(Element&); |
| 24 | 32 |
| 25 struct RecursionData { | 33 struct RecursionData { |
| 26 RecursionData() : m_foundInvalidationSet(false) { } | 34 RecursionData() : m_foundInvalidationSet(false) { } |
| 27 void pushInvalidationSet(const DescendantInvalidationSet&); | 35 void pushInvalidationSet(const DescendantInvalidationSet&); |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 48 m_data->m_foundInvalidationSet = m_prevFoundInvalidationSet; | 56 m_data->m_foundInvalidationSet = m_prevFoundInvalidationSet; |
| 49 } | 57 } |
| 50 | 58 |
| 51 private: | 59 private: |
| 52 int m_prevClassLength; | 60 int m_prevClassLength; |
| 53 int m_prevAttributeLength; | 61 int m_prevAttributeLength; |
| 54 bool m_prevFoundInvalidationSet; | 62 bool m_prevFoundInvalidationSet; |
| 55 RecursionData* m_data; | 63 RecursionData* m_data; |
| 56 }; | 64 }; |
| 57 | 65 |
| 58 Document& m_document; | 66 typedef Vector<RefPtr<DescendantInvalidationSet> > InvalidationList; |
| 59 RuleFeatureSet::PendingInvalidationMap& m_pendingInvalidationMap; | 67 typedef HashMap<Element*, OwnPtr<InvalidationList> > PendingInvalidationMap; |
| 68 | |
| 69 InvalidationList& ensurePendingInvalidationList(Element&); | |
| 70 | |
| 71 PendingInvalidationMap m_pendingInvalidationMap; | |
| 60 RecursionData m_recursionData; | 72 RecursionData m_recursionData; |
| 61 }; | 73 }; |
| 62 | 74 |
| 63 } // namespace WebCore | 75 } // namespace WebCore |
| 64 | 76 |
| 65 #endif // StyleInvalidator_h | 77 #endif // StyleInvalidator_h |
| OLD | NEW |