OLD | NEW |
1 /* | 1 /* |
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
3 * (C) 2002-2003 Dirk Mueller (mueller@kde.org) | 3 * (C) 2002-2003 Dirk Mueller (mueller@kde.org) |
4 * Copyright (C) 2002, 2006, 2008, 2012, 2013 Apple Inc. All rights reserved. | 4 * Copyright (C) 2002, 2006, 2008, 2012, 2013 Apple 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 19 matching lines...) Expand all Loading... |
30 #include "wtf/RefPtr.h" | 30 #include "wtf/RefPtr.h" |
31 | 31 |
32 namespace blink { | 32 namespace blink { |
33 | 33 |
34 class CSSRule; | 34 class CSSRule; |
35 class CSSStyleSheet; | 35 class CSSStyleSheet; |
36 | 36 |
37 class CORE_EXPORT StyleRuleBase : public RefCountedWillBeGarbageCollectedFinaliz
ed<StyleRuleBase> { | 37 class CORE_EXPORT StyleRuleBase : public RefCountedWillBeGarbageCollectedFinaliz
ed<StyleRuleBase> { |
38 USING_FAST_MALLOC_WITH_TYPE_NAME_WILL_BE_REMOVED(blink::StyleRuleBase); | 38 USING_FAST_MALLOC_WITH_TYPE_NAME_WILL_BE_REMOVED(blink::StyleRuleBase); |
39 public: | 39 public: |
40 enum Type { | 40 enum RuleType { |
41 Charset, | 41 Charset, |
42 Style, | 42 Style, |
43 Import, | 43 Import, |
44 Media, | 44 Media, |
45 FontFace, | 45 FontFace, |
46 Page, | 46 Page, |
47 Keyframes, | 47 Keyframes, |
48 Keyframe, | 48 Keyframe, |
49 Namespace, | 49 Namespace, |
50 Supports, | 50 Supports, |
51 Viewport, | 51 Viewport, |
52 }; | 52 }; |
53 | 53 |
54 Type type() const { return static_cast<Type>(m_type); } | 54 RuleType type() const { return static_cast<RuleType>(m_type); } |
55 | 55 |
56 bool isCharsetRule() const { return type() == Charset; } | 56 bool isCharsetRule() const { return type() == Charset; } |
57 bool isFontFaceRule() const { return type() == FontFace; } | 57 bool isFontFaceRule() const { return type() == FontFace; } |
58 bool isKeyframesRule() const { return type() == Keyframes; } | 58 bool isKeyframesRule() const { return type() == Keyframes; } |
59 bool isKeyframeRule() const { return type() == Keyframe; } | 59 bool isKeyframeRule() const { return type() == Keyframe; } |
60 bool isNamespaceRule() const { return type() == Namespace; } | 60 bool isNamespaceRule() const { return type() == Namespace; } |
61 bool isMediaRule() const { return type() == Media; } | 61 bool isMediaRule() const { return type() == Media; } |
62 bool isPageRule() const { return type() == Page; } | 62 bool isPageRule() const { return type() == Page; } |
63 bool isStyleRule() const { return type() == Style; } | 63 bool isStyleRule() const { return type() == Style; } |
64 bool isSupportsRule() const { return type() == Supports; } | 64 bool isSupportsRule() const { return type() == Supports; } |
(...skipping 18 matching lines...) Expand all Loading... |
83 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { } | 83 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { } |
84 void finalizeGarbageCollectedObject(); | 84 void finalizeGarbageCollectedObject(); |
85 | 85 |
86 // ~StyleRuleBase should be public, because non-public ~StyleRuleBase | 86 // ~StyleRuleBase should be public, because non-public ~StyleRuleBase |
87 // causes C2248 error : 'blink::StyleRuleBase::~StyleRuleBase' : cannot | 87 // causes C2248 error : 'blink::StyleRuleBase::~StyleRuleBase' : cannot |
88 // access protected member declared in class 'blink::StyleRuleBase' when | 88 // access protected member declared in class 'blink::StyleRuleBase' when |
89 // compiling 'source\wtf\refcounted.h' by using msvc. | 89 // compiling 'source\wtf\refcounted.h' by using msvc. |
90 ~StyleRuleBase() { } | 90 ~StyleRuleBase() { } |
91 | 91 |
92 protected: | 92 protected: |
93 StyleRuleBase(Type type) : m_type(type) { } | 93 StyleRuleBase(RuleType type) : m_type(type) { } |
94 StyleRuleBase(const StyleRuleBase& o) : m_type(o.m_type) { } | 94 StyleRuleBase(const StyleRuleBase& o) : m_type(o.m_type) { } |
95 | 95 |
96 private: | 96 private: |
97 void destroy(); | 97 void destroy(); |
98 | 98 |
99 PassRefPtrWillBeRawPtr<CSSRule> createCSSOMWrapper(CSSStyleSheet* parentShee
t, CSSRule* parentRule) const; | 99 PassRefPtrWillBeRawPtr<CSSRule> createCSSOMWrapper(CSSStyleSheet* parentShee
t, CSSRule* parentRule) const; |
100 | 100 |
101 unsigned m_type : 5; | 101 unsigned m_type : 5; |
102 }; | 102 }; |
103 | 103 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 class StyleRuleGroup : public StyleRuleBase { | 186 class StyleRuleGroup : public StyleRuleBase { |
187 public: | 187 public: |
188 const WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>>& childRules() cons
t { return m_childRules; } | 188 const WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>>& childRules() cons
t { return m_childRules; } |
189 | 189 |
190 void wrapperInsertRule(unsigned, PassRefPtrWillBeRawPtr<StyleRuleBase>); | 190 void wrapperInsertRule(unsigned, PassRefPtrWillBeRawPtr<StyleRuleBase>); |
191 void wrapperRemoveRule(unsigned); | 191 void wrapperRemoveRule(unsigned); |
192 | 192 |
193 DECLARE_TRACE_AFTER_DISPATCH(); | 193 DECLARE_TRACE_AFTER_DISPATCH(); |
194 | 194 |
195 protected: | 195 protected: |
196 StyleRuleGroup(Type, WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>>& ad
optRule); | 196 StyleRuleGroup(RuleType, WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>>
& adoptRule); |
197 StyleRuleGroup(const StyleRuleGroup&); | 197 StyleRuleGroup(const StyleRuleGroup&); |
198 | 198 |
199 private: | 199 private: |
200 WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>> m_childRules; | 200 WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>> m_childRules; |
201 }; | 201 }; |
202 | 202 |
203 class StyleRuleMedia : public StyleRuleGroup { | 203 class StyleRuleMedia : public StyleRuleGroup { |
204 public: | 204 public: |
205 static PassRefPtrWillBeRawPtr<StyleRuleMedia> create(PassRefPtrWillBeRawPtr<
MediaQuerySet> media, WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>>& adopt
Rules) | 205 static PassRefPtrWillBeRawPtr<StyleRuleMedia> create(PassRefPtrWillBeRawPtr<
MediaQuerySet> media, WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>>& adopt
Rules) |
206 { | 206 { |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 DEFINE_STYLE_RULE_TYPE_CASTS(FontFace); | 283 DEFINE_STYLE_RULE_TYPE_CASTS(FontFace); |
284 DEFINE_STYLE_RULE_TYPE_CASTS(Page); | 284 DEFINE_STYLE_RULE_TYPE_CASTS(Page); |
285 DEFINE_STYLE_RULE_TYPE_CASTS(Media); | 285 DEFINE_STYLE_RULE_TYPE_CASTS(Media); |
286 DEFINE_STYLE_RULE_TYPE_CASTS(Supports); | 286 DEFINE_STYLE_RULE_TYPE_CASTS(Supports); |
287 DEFINE_STYLE_RULE_TYPE_CASTS(Viewport); | 287 DEFINE_STYLE_RULE_TYPE_CASTS(Viewport); |
288 DEFINE_STYLE_RULE_TYPE_CASTS(Charset); | 288 DEFINE_STYLE_RULE_TYPE_CASTS(Charset); |
289 | 289 |
290 } // namespace blink | 290 } // namespace blink |
291 | 291 |
292 #endif // StyleRule_h | 292 #endif // StyleRule_h |
OLD | NEW |