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

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

Issue 286903024: Skip child ShadowRoots when invalidation does not have boundary crossing rules (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix build Created 6 years, 6 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
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 "platform/heap/Handle.h" 8 #include "platform/heap/Handle.h"
9 9
10 namespace WebCore { 10 namespace WebCore {
(...skipping 20 matching lines...) Expand all
31 private: 31 private:
32 bool invalidate(Element&); 32 bool invalidate(Element&);
33 bool invalidateChildren(Element&); 33 bool invalidateChildren(Element&);
34 34
35 bool checkInvalidationSetsAgainstElement(Element&); 35 bool checkInvalidationSetsAgainstElement(Element&);
36 36
37 struct RecursionData { 37 struct RecursionData {
38 RecursionData() 38 RecursionData()
39 : m_invalidateCustomPseudo(false) 39 : m_invalidateCustomPseudo(false)
40 , m_wholeSubtreeInvalid(false) 40 , m_wholeSubtreeInvalid(false)
41 , m_treeBoundaryCrossing(false)
41 { } 42 { }
43
42 void pushInvalidationSet(const DescendantInvalidationSet&); 44 void pushInvalidationSet(const DescendantInvalidationSet&);
43 bool matchesCurrentInvalidationSets(Element&); 45 bool matchesCurrentInvalidationSets(Element&);
44 bool hasInvalidationSets() const { return m_invalidationSets.size(); } 46 bool hasInvalidationSets() const { return m_invalidationSets.size(); }
47
45 bool wholeSubtreeInvalid() const { return m_wholeSubtreeInvalid; } 48 bool wholeSubtreeInvalid() const { return m_wholeSubtreeInvalid; }
46 void setWholeSubtreeInvalid() { m_wholeSubtreeInvalid = true; } 49 void setWholeSubtreeInvalid() { m_wholeSubtreeInvalid = true; }
47 50
51 bool treeBoundaryCrossing() const { return m_treeBoundaryCrossing; }
52
48 typedef Vector<const DescendantInvalidationSet*, 16> InvalidationSets; 53 typedef Vector<const DescendantInvalidationSet*, 16> InvalidationSets;
49 InvalidationSets m_invalidationSets; 54 InvalidationSets m_invalidationSets;
50 bool m_invalidateCustomPseudo; 55 bool m_invalidateCustomPseudo;
51 bool m_wholeSubtreeInvalid; 56 bool m_wholeSubtreeInvalid;
57 bool m_treeBoundaryCrossing;
52 }; 58 };
53 59
54 class RecursionCheckpoint { 60 class RecursionCheckpoint {
55 public: 61 public:
56 RecursionCheckpoint(RecursionData* data) 62 RecursionCheckpoint(RecursionData* data)
57 : m_prevInvalidationSetsSize(data->m_invalidationSets.size()) 63 : m_prevInvalidationSetsSize(data->m_invalidationSets.size())
58 , m_prevInvalidateCustomPseudo(data->m_invalidateCustomPseudo) 64 , m_prevInvalidateCustomPseudo(data->m_invalidateCustomPseudo)
59 , m_prevWholeSubtreeInvalid(data->m_wholeSubtreeInvalid) 65 , m_prevWholeSubtreeInvalid(data->m_wholeSubtreeInvalid)
66 , m_treeBoundaryCrossing(data->m_treeBoundaryCrossing)
60 , m_data(data) 67 , m_data(data)
61 { } 68 { }
62 ~RecursionCheckpoint() 69 ~RecursionCheckpoint()
63 { 70 {
64 m_data->m_invalidationSets.remove(m_prevInvalidationSetsSize, m_data ->m_invalidationSets.size() - m_prevInvalidationSetsSize); 71 m_data->m_invalidationSets.remove(m_prevInvalidationSetsSize, m_data ->m_invalidationSets.size() - m_prevInvalidationSetsSize);
65 m_data->m_invalidateCustomPseudo = m_prevInvalidateCustomPseudo; 72 m_data->m_invalidateCustomPseudo = m_prevInvalidateCustomPseudo;
66 m_data->m_wholeSubtreeInvalid = m_prevWholeSubtreeInvalid; 73 m_data->m_wholeSubtreeInvalid = m_prevWholeSubtreeInvalid;
74 m_data->m_treeBoundaryCrossing = m_treeBoundaryCrossing;
67 } 75 }
68 76
69 private: 77 private:
70 int m_prevInvalidationSetsSize; 78 int m_prevInvalidationSetsSize;
71 bool m_prevInvalidateCustomPseudo; 79 bool m_prevInvalidateCustomPseudo;
72 bool m_prevWholeSubtreeInvalid; 80 bool m_prevWholeSubtreeInvalid;
81 bool m_treeBoundaryCrossing;
73 RecursionData* m_data; 82 RecursionData* m_data;
74 }; 83 };
75 84
76 typedef WillBeHeapVector<RefPtrWillBeMember<DescendantInvalidationSet> > Inv alidationList; 85 typedef WillBeHeapVector<RefPtrWillBeMember<DescendantInvalidationSet> > Inv alidationList;
77 typedef WillBeHeapHashMap<RawPtrWillBeMember<Element>, OwnPtrWillBeMember<In validationList> > PendingInvalidationMap; 86 typedef WillBeHeapHashMap<RawPtrWillBeMember<Element>, OwnPtrWillBeMember<In validationList> > PendingInvalidationMap;
78 87
79 InvalidationList& ensurePendingInvalidationList(Element&); 88 InvalidationList& ensurePendingInvalidationList(Element&);
80 89
81 PendingInvalidationMap m_pendingInvalidationMap; 90 PendingInvalidationMap m_pendingInvalidationMap;
82 RecursionData m_recursionData; 91 RecursionData m_recursionData;
83 }; 92 };
84 93
85 } // namespace WebCore 94 } // namespace WebCore
86 95
87 #endif // StyleInvalidator_h 96 #endif // StyleInvalidator_h
OLDNEW
« no previous file with comments | « Source/core/css/invalidation/DescendantInvalidationSet.cpp ('k') | Source/core/css/invalidation/StyleInvalidator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698