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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSGlobalRuleSet.h

Issue 2451893003: Move Document global rule data to CSSGlobalRuleSet. (Closed)
Patch Set: Rebased. Created 4 years, 1 month 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
OLDNEW
(Empty)
1 // Copyright 2016 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 CSSGlobalRuleSet_h
6 #define CSSGlobalRuleSet_h
7
8 #include "core/css/RuleFeature.h"
9
10 namespace blink {
11
12 class Document;
13 class RuleSet;
14
15 // A per Document collection of CSS metadata used for style matching and
16 // invalidation. The data is aggregated from author rulesets from all TreeScopes
17 // in the whole Document as well as UA stylesheets and watched selectors which
18 // apply to elements in all TreeScopes.
19 //
20 // TODO(rune@opera.com): We would like to move as much of this data as possible
21 // to the ScopedStyleResolver as possible to avoid full reconstruction of these
22 // rulesets on shadow tree changes. See https://crbug.com/401359
23
24 class CSSGlobalRuleSet {
25 DISALLOW_NEW();
26 WTF_MAKE_NONCOPYABLE(CSSGlobalRuleSet);
27
28 public:
29 CSSGlobalRuleSet() {}
30
31 void initWatchedSelectorsRuleSet(Document&);
32 void markDirty() { m_isDirty = true; }
33 bool isDirty() const { return m_isDirty; }
34 void update(Document&);
35
36 const RuleFeatureSet& ruleFeatureSet() const {
37 RELEASE_ASSERT(m_features.isAlive());
38 return m_features;
39 }
40 RuleSet* siblingRuleSet() const { return m_siblingRuleSet; }
41 RuleSet* uncommonAttributeRuleSet() const {
42 return m_uncommonAttributeRuleSet;
43 }
44 RuleSet* watchedSelectorsRuleSet() const { return m_watchedSelectorsRuleSet; }
45 bool hasFullscreenUAStyle() const { return m_hasFullscreenUAStyle; }
46
47 DECLARE_TRACE();
48
49 private:
50 // Constructed from rules in all TreeScopes including UA style and style
51 // injected from extensions.
52 RuleFeatureSet m_features;
53 Member<RuleSet> m_siblingRuleSet;
54 Member<RuleSet> m_uncommonAttributeRuleSet;
55
56 // Rules injected from extensions.
57 Member<RuleSet> m_watchedSelectorsRuleSet;
58
59 bool m_hasFullscreenUAStyle = false;
60 bool m_isDirty = true;
61 };
62
63 } // namespace blink
64
65 #endif // CSSGlobalRuleSet_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSDefaultStyleSheets.cpp ('k') | third_party/WebKit/Source/core/css/CSSGlobalRuleSet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698