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) 2012 Google Inc. All rights reserved. | 4 * Copyright (C) 2012 Google Inc. All rights reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 27 matching lines...) Expand all Loading... |
38 namespace blink { | 38 namespace blink { |
39 | 39 |
40 class PageRuleCollector; | 40 class PageRuleCollector; |
41 class StyleSheetContents; | 41 class StyleSheetContents; |
42 class ViewportStyleResolver; | 42 class ViewportStyleResolver; |
43 | 43 |
44 // This class selects a ComputedStyle for a given element based on a collection
of stylesheets. | 44 // This class selects a ComputedStyle for a given element based on a collection
of stylesheets. |
45 class ScopedStyleResolver final : public GarbageCollected<ScopedStyleResolver> { | 45 class ScopedStyleResolver final : public GarbageCollected<ScopedStyleResolver> { |
46 WTF_MAKE_NONCOPYABLE(ScopedStyleResolver); | 46 WTF_MAKE_NONCOPYABLE(ScopedStyleResolver); |
47 public: | 47 public: |
48 static RawPtr<ScopedStyleResolver> create(TreeScope& scope) | 48 static ScopedStyleResolver* create(TreeScope& scope) |
49 { | 49 { |
50 return new ScopedStyleResolver(scope); | 50 return new ScopedStyleResolver(scope); |
51 } | 51 } |
52 | 52 |
53 const TreeScope& treeScope() const { return *m_scope; } | 53 const TreeScope& treeScope() const { return *m_scope; } |
54 ScopedStyleResolver* parent() const; | 54 ScopedStyleResolver* parent() const; |
55 | 55 |
56 StyleRuleKeyframes* keyframeStylesForAnimation(const StringImpl* animationNa
me); | 56 StyleRuleKeyframes* keyframeStylesForAnimation(const StringImpl* animationNa
me); |
57 | 57 |
58 void appendCSSStyleSheet(CSSStyleSheet&, const MediaQueryEvaluator&); | 58 void appendCSSStyleSheet(CSSStyleSheet&, const MediaQueryEvaluator&); |
(...skipping 10 matching lines...) Expand all Loading... |
69 | 69 |
70 private: | 70 private: |
71 explicit ScopedStyleResolver(TreeScope& scope) | 71 explicit ScopedStyleResolver(TreeScope& scope) |
72 : m_scope(scope) | 72 : m_scope(scope) |
73 { | 73 { |
74 } | 74 } |
75 | 75 |
76 void addTreeBoundaryCrossingRules(const RuleSet&, CSSStyleSheet*, unsigned s
heetIndex); | 76 void addTreeBoundaryCrossingRules(const RuleSet&, CSSStyleSheet*, unsigned s
heetIndex); |
77 void addKeyframeRules(const RuleSet&); | 77 void addKeyframeRules(const RuleSet&); |
78 void addFontFaceRules(const RuleSet&); | 78 void addFontFaceRules(const RuleSet&); |
79 void addKeyframeStyle(RawPtr<StyleRuleKeyframes>); | 79 void addKeyframeStyle(StyleRuleKeyframes*); |
80 | 80 |
81 Member<TreeScope> m_scope; | 81 Member<TreeScope> m_scope; |
82 | 82 |
83 HeapVector<Member<CSSStyleSheet>> m_authorStyleSheets; | 83 HeapVector<Member<CSSStyleSheet>> m_authorStyleSheets; |
84 | 84 |
85 using KeyframesRuleMap = HeapHashMap<const StringImpl*, Member<StyleRuleKeyf
rames>>; | 85 using KeyframesRuleMap = HeapHashMap<const StringImpl*, Member<StyleRuleKeyf
rames>>; |
86 KeyframesRuleMap m_keyframesRuleMap; | 86 KeyframesRuleMap m_keyframesRuleMap; |
87 | 87 |
88 class RuleSubSet final : public GarbageCollected<RuleSubSet> { | 88 class RuleSubSet final : public GarbageCollected<RuleSubSet> { |
89 public: | 89 public: |
90 static RawPtr<RuleSubSet> create(CSSStyleSheet* sheet, unsigned index, R
awPtr<RuleSet> rules) | 90 static RuleSubSet* create(CSSStyleSheet* sheet, unsigned index, RuleSet*
rules) |
91 { | 91 { |
92 return new RuleSubSet(sheet, index, rules); | 92 return new RuleSubSet(sheet, index, rules); |
93 } | 93 } |
94 | 94 |
95 Member<CSSStyleSheet> m_parentStyleSheet; | 95 Member<CSSStyleSheet> m_parentStyleSheet; |
96 unsigned m_parentIndex; | 96 unsigned m_parentIndex; |
97 Member<RuleSet> m_ruleSet; | 97 Member<RuleSet> m_ruleSet; |
98 | 98 |
99 DECLARE_TRACE(); | 99 DECLARE_TRACE(); |
100 | 100 |
101 private: | 101 private: |
102 RuleSubSet(CSSStyleSheet* sheet, unsigned index, RawPtr<RuleSet> rules) | 102 RuleSubSet(CSSStyleSheet* sheet, unsigned index, RuleSet* rules) |
103 : m_parentStyleSheet(sheet) | 103 : m_parentStyleSheet(sheet) |
104 , m_parentIndex(index) | 104 , m_parentIndex(index) |
105 , m_ruleSet(rules) | 105 , m_ruleSet(rules) |
106 { | 106 { |
107 } | 107 } |
108 }; | 108 }; |
109 using CSSStyleSheetRuleSubSet = HeapVector<Member<RuleSubSet>>; | 109 using CSSStyleSheetRuleSubSet = HeapVector<Member<RuleSubSet>>; |
110 | 110 |
111 Member<CSSStyleSheetRuleSubSet> m_treeBoundaryCrossingRuleSet; | 111 Member<CSSStyleSheetRuleSubSet> m_treeBoundaryCrossingRuleSet; |
112 bool m_hasDeepOrShadowSelector = false; | 112 bool m_hasDeepOrShadowSelector = false; |
113 }; | 113 }; |
114 | 114 |
115 } // namespace blink | 115 } // namespace blink |
116 | 116 |
117 #endif // ScopedStyleResolver_h | 117 #endif // ScopedStyleResolver_h |
OLD | NEW |