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

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

Issue 204873003: Factor the style invalidation tree walk out of RuleFeatureSet, and make it generic. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Final tweaks. Created 6 years, 9 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
« no previous file with comments | « Source/core/css/RuleFeature.cpp ('k') | 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef StyleInvalidator_h
6 #define StyleInvalidator_h
7
8 #include "core/css/RuleFeature.h"
9 #include "heap/Heap.h"
10
11 namespace WebCore {
12
13 class StyleInvalidator {
14 STACK_ALLOCATED();
15 public:
16 StyleInvalidator(Document&);
esprehn 2014/03/20 00:33:03 explicit
chrishtr 2014/03/20 03:46:33 Done.
17 void invalidate();
18
19 private:
20 bool invalidate(Element&);
21 bool invalidateChildren(Element&);
22
23 bool checkInvalidationSetsAgainstElement(Element&);
24
25 struct RecursionData {
26 RecursionData() : m_foundInvalidationSet(false) { }
27 void pushInvalidationSet(const DescendantInvalidationSet&);
28 bool matchesCurrentInvalidationSets(Element&);
29 bool foundInvalidationSet() { return m_foundInvalidationSet; }
30
31 Vector<AtomicString> m_invalidationClasses;
32 bool m_foundInvalidationSet;
33 };
34
35 class RecursionCheckpoint {
36 public:
37 RecursionCheckpoint(RecursionData* data)
38 : m_prevClassLength(data->m_invalidationClasses.size()),
39 m_prevFoundInvalidationSet(data->m_foundInvalidationSet),
40 m_data(data)
41 { }
42 ~RecursionCheckpoint()
43 {
44 m_data->m_invalidationClasses.remove(m_prevClassLength, m_data->m_in validationClasses.size() - m_prevClassLength);
45 m_data->m_foundInvalidationSet = m_prevFoundInvalidationSet;
46 }
47
48 private:
49 int m_prevClassLength;
50 bool m_prevFoundInvalidationSet;
51 RecursionData* m_data;
52 };
53
54 Document& m_document;
55 RuleFeatureSet::PendingInvalidationMap& m_pendingInvalidationMap;
56 RecursionData m_recursionData;
57 };
58
59 } // namespace WebCore
60
61 #endif // StyleInvalidator_h
OLDNEW
« no previous file with comments | « Source/core/css/RuleFeature.cpp ('k') | Source/core/css/invalidation/StyleInvalidator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698