OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. | 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. |
4 * Copyright (C) 2013 Google Inc. All rights reserved. | 4 * Copyright (C) 2013 Google Inc. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 29 matching lines...) Expand all Loading... |
40 class MediaQueryEvaluator; | 40 class MediaQueryEvaluator; |
41 class RuleSet; | 41 class RuleSet; |
42 class StyleScopeResolver; | 42 class StyleScopeResolver; |
43 | 43 |
44 class ShadowDistributedRules { | 44 class ShadowDistributedRules { |
45 public: | 45 public: |
46 void addRule(StyleRule*, size_t selectorIndex, ContainerNode* scope, AddRule
Flags); | 46 void addRule(StyleRule*, size_t selectorIndex, ContainerNode* scope, AddRule
Flags); |
47 void collectMatchRequests(bool includeEmptyRules, Vector<MatchRequest>&); | 47 void collectMatchRequests(bool includeEmptyRules, Vector<MatchRequest>&); |
48 void clear() { m_shadowDistributedRuleSetMap.clear(); } | 48 void clear() { m_shadowDistributedRuleSetMap.clear(); } |
49 bool isEmpty() const { return m_shadowDistributedRuleSetMap.isEmpty(); } | 49 bool isEmpty() const { return m_shadowDistributedRuleSetMap.isEmpty(); } |
50 void reportMemoryUsage(MemoryObjectInfo*) const; | |
51 private: | 50 private: |
52 typedef HashMap<const ContainerNode*, OwnPtr<RuleSet> > ShadowDistributedRul
eSetMap; | 51 typedef HashMap<const ContainerNode*, OwnPtr<RuleSet> > ShadowDistributedRul
eSetMap; |
53 ShadowDistributedRuleSetMap m_shadowDistributedRuleSetMap; | 52 ShadowDistributedRuleSetMap m_shadowDistributedRuleSetMap; |
54 }; | 53 }; |
55 | 54 |
56 class DocumentRuleSets { | 55 class DocumentRuleSets { |
57 public: | 56 public: |
58 DocumentRuleSets(); | 57 DocumentRuleSets(); |
59 ~DocumentRuleSets(); | 58 ~DocumentRuleSets(); |
60 RuleSet* authorStyle() const { return m_authorStyle.get(); } | 59 RuleSet* authorStyle() const { return m_authorStyle.get(); } |
61 RuleSet* userStyle() const { return m_userStyle.get(); } | 60 RuleSet* userStyle() const { return m_userStyle.get(); } |
62 RuleFeatureSet& features() { return m_features; } | 61 RuleFeatureSet& features() { return m_features; } |
63 const RuleFeatureSet& features() const { return m_features; } | 62 const RuleFeatureSet& features() const { return m_features; } |
64 RuleSet* sibling() const { return m_siblingRuleSet.get(); } | 63 RuleSet* sibling() const { return m_siblingRuleSet.get(); } |
65 RuleSet* uncommonAttribute() const { return m_uncommonAttributeRuleSet.get()
; } | 64 RuleSet* uncommonAttribute() const { return m_uncommonAttributeRuleSet.get()
; } |
66 | 65 |
67 void initUserStyle(DocumentStyleSheetCollection*, const MediaQueryEvaluator&
, StyleResolver&); | 66 void initUserStyle(DocumentStyleSheetCollection*, const MediaQueryEvaluator&
, StyleResolver&); |
68 void resetAuthorStyle(); | 67 void resetAuthorStyle(); |
69 void appendAuthorStyleSheets(unsigned firstNew, const Vector<RefPtr<CSSStyle
Sheet> >&, MediaQueryEvaluator*, InspectorCSSOMWrappers&, bool isViewSource, Sty
leResolver*); | 68 void appendAuthorStyleSheets(unsigned firstNew, const Vector<RefPtr<CSSStyle
Sheet> >&, MediaQueryEvaluator*, InspectorCSSOMWrappers&, bool isViewSource, Sty
leResolver*); |
70 | 69 |
71 void collectFeatures(bool isViewSource, StyleScopeResolver*); | 70 void collectFeatures(bool isViewSource, StyleScopeResolver*); |
72 void reportMemoryUsage(MemoryObjectInfo*) const; | |
73 ShadowDistributedRules& shadowDistributedRules() { return m_shadowDistribute
dRules; } | 71 ShadowDistributedRules& shadowDistributedRules() { return m_shadowDistribute
dRules; } |
74 | 72 |
75 private: | 73 private: |
76 void collectRulesFromUserStyleSheets(const Vector<RefPtr<CSSStyleSheet> >&,
RuleSet& userStyle, const MediaQueryEvaluator&, StyleResolver&); | 74 void collectRulesFromUserStyleSheets(const Vector<RefPtr<CSSStyleSheet> >&,
RuleSet& userStyle, const MediaQueryEvaluator&, StyleResolver&); |
77 OwnPtr<RuleSet> m_authorStyle; | 75 OwnPtr<RuleSet> m_authorStyle; |
78 OwnPtr<RuleSet> m_userStyle; | 76 OwnPtr<RuleSet> m_userStyle; |
79 RuleFeatureSet m_features; | 77 RuleFeatureSet m_features; |
80 OwnPtr<RuleSet> m_siblingRuleSet; | 78 OwnPtr<RuleSet> m_siblingRuleSet; |
81 OwnPtr<RuleSet> m_uncommonAttributeRuleSet; | 79 OwnPtr<RuleSet> m_uncommonAttributeRuleSet; |
82 ShadowDistributedRules m_shadowDistributedRules; | 80 ShadowDistributedRules m_shadowDistributedRules; |
83 }; | 81 }; |
84 | 82 |
85 } // namespace WebCore | 83 } // namespace WebCore |
86 | 84 |
87 #endif // DocumentRuleSets_h | 85 #endif // DocumentRuleSets_h |
OLD | NEW |