Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Side by Side Diff: Source/core/css/invalidation/StyleInvalidator.h

Issue 233243003: Avoid looking at invalidation sets in a SubtreeStyleChange subtree (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add ASSERT Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/css/invalidation/StyleInvalidator.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "heap/Handle.h" 8 #include "heap/Handle.h"
9 9
10 namespace WebCore { 10 namespace WebCore {
(...skipping 15 matching lines...) Expand all
26 void clearPendingInvalidations(); 26 void clearPendingInvalidations();
27 27
28 private: 28 private:
29 bool invalidate(Element&); 29 bool invalidate(Element&);
30 bool invalidateChildren(Element&); 30 bool invalidateChildren(Element&);
31 31
32 bool checkInvalidationSetsAgainstElement(Element&); 32 bool checkInvalidationSetsAgainstElement(Element&);
33 33
34 struct RecursionData { 34 struct RecursionData {
35 RecursionData() 35 RecursionData()
36 : m_foundInvalidationSet(false) 36 : m_invalidateCustomPseudo(false)
37 , m_invalidateCustomPseudo(false) 37 , m_wholeSubtreeInvalid(false)
38 { } 38 { }
39 void pushInvalidationSet(const DescendantInvalidationSet&); 39 void pushInvalidationSet(const DescendantInvalidationSet&);
40 bool matchesCurrentInvalidationSets(Element&); 40 bool matchesCurrentInvalidationSets(Element&);
41 bool foundInvalidationSet() { return m_foundInvalidationSet; } 41 bool hasInvalidationSets() const { return m_invalidationSets.size(); }
42 bool wholeSubtreeInvalid() const { return m_wholeSubtreeInvalid; }
42 43
43 typedef Vector<const DescendantInvalidationSet*, 16> InvalidationSets; 44 typedef Vector<const DescendantInvalidationSet*, 16> InvalidationSets;
44 InvalidationSets m_invalidationSets; 45 InvalidationSets m_invalidationSets;
45 bool m_foundInvalidationSet;
46 bool m_invalidateCustomPseudo; 46 bool m_invalidateCustomPseudo;
47 bool m_wholeSubtreeInvalid;
47 }; 48 };
48 49
49 class RecursionCheckpoint { 50 class RecursionCheckpoint {
50 public: 51 public:
51 RecursionCheckpoint(RecursionData* data) 52 RecursionCheckpoint(RecursionData* data)
52 : m_prevInvalidationSetsSize(data->m_invalidationSets.size()) 53 : m_prevInvalidationSetsSize(data->m_invalidationSets.size())
53 , m_prevFoundInvalidationSet(data->m_foundInvalidationSet)
54 , m_prevInvalidateCustomPseudo(data->m_invalidateCustomPseudo) 54 , m_prevInvalidateCustomPseudo(data->m_invalidateCustomPseudo)
55 , m_prevWholeSubtreeInvalid(data->m_wholeSubtreeInvalid)
55 , m_data(data) 56 , m_data(data)
56 { } 57 { }
57 ~RecursionCheckpoint() 58 ~RecursionCheckpoint()
58 { 59 {
59 m_data->m_invalidationSets.remove(m_prevInvalidationSetsSize, m_data ->m_invalidationSets.size() - m_prevInvalidationSetsSize); 60 m_data->m_invalidationSets.remove(m_prevInvalidationSetsSize, m_data ->m_invalidationSets.size() - m_prevInvalidationSetsSize);
60 m_data->m_foundInvalidationSet = m_prevFoundInvalidationSet;
61 m_data->m_invalidateCustomPseudo = m_prevInvalidateCustomPseudo; 61 m_data->m_invalidateCustomPseudo = m_prevInvalidateCustomPseudo;
62 m_data->m_wholeSubtreeInvalid = m_prevWholeSubtreeInvalid;
62 } 63 }
63 64
64 private: 65 private:
65 int m_prevInvalidationSetsSize; 66 int m_prevInvalidationSetsSize;
66 bool m_prevFoundInvalidationSet;
67 bool m_prevInvalidateCustomPseudo; 67 bool m_prevInvalidateCustomPseudo;
68 bool m_prevWholeSubtreeInvalid;
68 RecursionData* m_data; 69 RecursionData* m_data;
69 }; 70 };
70 71
71 typedef Vector<RefPtr<DescendantInvalidationSet> > InvalidationList; 72 typedef Vector<RefPtr<DescendantInvalidationSet> > InvalidationList;
72 typedef HashMap<Element*, OwnPtr<InvalidationList> > PendingInvalidationMap; 73 typedef HashMap<Element*, OwnPtr<InvalidationList> > PendingInvalidationMap;
73 74
74 InvalidationList& ensurePendingInvalidationList(Element&); 75 InvalidationList& ensurePendingInvalidationList(Element&);
75 76
76 PendingInvalidationMap m_pendingInvalidationMap; 77 PendingInvalidationMap m_pendingInvalidationMap;
77 RecursionData m_recursionData; 78 RecursionData m_recursionData;
78 }; 79 };
79 80
80 } // namespace WebCore 81 } // namespace WebCore
81 82
82 #endif // StyleInvalidator_h 83 #endif // StyleInvalidator_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/css/invalidation/StyleInvalidator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698