OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 #include "core/css/CSSGlobalRuleSet.h" | 5 #include "core/css/CSSGlobalRuleSet.h" |
6 | 6 |
7 #include "core/css/CSSDefaultStyleSheets.h" | 7 #include "core/css/CSSDefaultStyleSheets.h" |
8 #include "core/css/RuleSet.h" | 8 #include "core/css/RuleSet.h" |
9 #include "core/dom/CSSSelectorWatch.h" | 9 #include "core/dom/CSSSelectorWatch.h" |
10 #include "core/dom/Document.h" | 10 #include "core/dom/Document.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
62 | 62 |
63 if (m_watchedSelectorsRuleSet) | 63 if (m_watchedSelectorsRuleSet) |
64 m_features.add(m_watchedSelectorsRuleSet->features()); | 64 m_features.add(m_watchedSelectorsRuleSet->features()); |
65 | 65 |
66 document.styleEngine().collectScopedStyleFeaturesTo(m_features); | 66 document.styleEngine().collectScopedStyleFeaturesTo(m_features); |
67 | 67 |
68 m_siblingRuleSet = makeRuleSet(m_features.siblingRules()); | 68 m_siblingRuleSet = makeRuleSet(m_features.siblingRules()); |
69 m_uncommonAttributeRuleSet = makeRuleSet(m_features.uncommonAttributeRules()); | 69 m_uncommonAttributeRuleSet = makeRuleSet(m_features.uncommonAttributeRules()); |
70 } | 70 } |
71 | 71 |
72 void CSSGlobalRuleSet::reset() { | |
sof
2016/12/20 18:42:09
nit: is this leaving the object in a usable state?
| |
73 m_features.clear(); | |
74 m_siblingRuleSet = nullptr; | |
75 m_uncommonAttributeRuleSet = nullptr; | |
76 m_watchedSelectorsRuleSet = nullptr; | |
77 m_hasFullscreenUAStyle = false; | |
78 m_isDirty = true; | |
79 } | |
80 | |
72 DEFINE_TRACE(CSSGlobalRuleSet) { | 81 DEFINE_TRACE(CSSGlobalRuleSet) { |
73 visitor->trace(m_features); | 82 visitor->trace(m_features); |
74 visitor->trace(m_siblingRuleSet); | 83 visitor->trace(m_siblingRuleSet); |
75 visitor->trace(m_uncommonAttributeRuleSet); | 84 visitor->trace(m_uncommonAttributeRuleSet); |
76 visitor->trace(m_watchedSelectorsRuleSet); | 85 visitor->trace(m_watchedSelectorsRuleSet); |
77 } | 86 } |
78 | 87 |
79 } // namespace blink | 88 } // namespace blink |
OLD | NEW |