| 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 16 matching lines...) Expand all Loading... |
| 27 #include "core/css/MediaList.h" | 27 #include "core/css/MediaList.h" |
| 28 #include "core/css/StylePropertySet.h" | 28 #include "core/css/StylePropertySet.h" |
| 29 #include "platform/heap/Handle.h" | 29 #include "platform/heap/Handle.h" |
| 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 GarbageCollectedFinalized<StyleRuleBase
> { |
| 38 USING_FAST_MALLOC_WITH_TYPE_NAME_WILL_BE_REMOVED(blink::StyleRuleBase); | |
| 39 public: | 38 public: |
| 40 enum RuleType { | 39 enum RuleType { |
| 41 Charset, | 40 Charset, |
| 42 Style, | 41 Style, |
| 43 Import, | 42 Import, |
| 44 Media, | 43 Media, |
| 45 FontFace, | 44 FontFace, |
| 46 Page, | 45 Page, |
| 47 Keyframes, | 46 Keyframes, |
| 48 Keyframe, | 47 Keyframe, |
| 49 Namespace, | 48 Namespace, |
| 50 Supports, | 49 Supports, |
| 51 Viewport, | 50 Viewport, |
| 52 }; | 51 }; |
| 53 | 52 |
| 54 RuleType type() const { return static_cast<RuleType>(m_type); } | 53 RuleType type() const { return static_cast<RuleType>(m_type); } |
| 55 | 54 |
| 56 bool isCharsetRule() const { return type() == Charset; } | 55 bool isCharsetRule() const { return type() == Charset; } |
| 57 bool isFontFaceRule() const { return type() == FontFace; } | 56 bool isFontFaceRule() const { return type() == FontFace; } |
| 58 bool isKeyframesRule() const { return type() == Keyframes; } | 57 bool isKeyframesRule() const { return type() == Keyframes; } |
| 59 bool isKeyframeRule() const { return type() == Keyframe; } | 58 bool isKeyframeRule() const { return type() == Keyframe; } |
| 60 bool isNamespaceRule() const { return type() == Namespace; } | 59 bool isNamespaceRule() const { return type() == Namespace; } |
| 61 bool isMediaRule() const { return type() == Media; } | 60 bool isMediaRule() const { return type() == Media; } |
| 62 bool isPageRule() const { return type() == Page; } | 61 bool isPageRule() const { return type() == Page; } |
| 63 bool isStyleRule() const { return type() == Style; } | 62 bool isStyleRule() const { return type() == Style; } |
| 64 bool isSupportsRule() const { return type() == Supports; } | 63 bool isSupportsRule() const { return type() == Supports; } |
| 65 bool isViewportRule() const { return type() == Viewport; } | 64 bool isViewportRule() const { return type() == Viewport; } |
| 66 bool isImportRule() const { return type() == Import; } | 65 bool isImportRule() const { return type() == Import; } |
| 67 | 66 |
| 68 PassRefPtrWillBeRawPtr<StyleRuleBase> copy() const; | 67 RawPtr<StyleRuleBase> copy() const; |
| 69 | 68 |
| 70 #if !ENABLE(OILPAN) | 69 #if !ENABLE(OILPAN) |
| 71 void deref() | 70 void deref() |
| 72 { | 71 { |
| 73 if (derefBase()) | 72 if (derefBase()) |
| 74 destroy(); | 73 destroy(); |
| 75 } | 74 } |
| 76 #endif // !ENABLE(OILPAN) | 75 #endif // !ENABLE(OILPAN) |
| 77 | 76 |
| 78 // FIXME: There shouldn't be any need for the null parent version. | 77 // FIXME: There shouldn't be any need for the null parent version. |
| 79 PassRefPtrWillBeRawPtr<CSSRule> createCSSOMWrapper(CSSStyleSheet* parentShee
t = 0) const; | 78 RawPtr<CSSRule> createCSSOMWrapper(CSSStyleSheet* parentSheet = 0) const; |
| 80 PassRefPtrWillBeRawPtr<CSSRule> createCSSOMWrapper(CSSRule* parentRule) cons
t; | 79 RawPtr<CSSRule> createCSSOMWrapper(CSSRule* parentRule) const; |
| 81 | 80 |
| 82 DECLARE_TRACE(); | 81 DECLARE_TRACE(); |
| 83 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { } | 82 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { } |
| 84 void finalizeGarbageCollectedObject(); | 83 void finalizeGarbageCollectedObject(); |
| 85 | 84 |
| 86 // ~StyleRuleBase should be public, because non-public ~StyleRuleBase | 85 // ~StyleRuleBase should be public, because non-public ~StyleRuleBase |
| 87 // causes C2248 error : 'blink::StyleRuleBase::~StyleRuleBase' : cannot | 86 // causes C2248 error : 'blink::StyleRuleBase::~StyleRuleBase' : cannot |
| 88 // access protected member declared in class 'blink::StyleRuleBase' when | 87 // access protected member declared in class 'blink::StyleRuleBase' when |
| 89 // compiling 'source\wtf\refcounted.h' by using msvc. | 88 // compiling 'source\wtf\refcounted.h' by using msvc. |
| 90 ~StyleRuleBase() { } | 89 ~StyleRuleBase() { } |
| 91 | 90 |
| 92 protected: | 91 protected: |
| 93 StyleRuleBase(RuleType type) : m_type(type) { } | 92 StyleRuleBase(RuleType type) : m_type(type) { } |
| 94 StyleRuleBase(const StyleRuleBase& o) : m_type(o.m_type) { } | 93 StyleRuleBase(const StyleRuleBase& o) : m_type(o.m_type) { } |
| 95 | 94 |
| 96 private: | 95 private: |
| 97 void destroy(); | 96 void destroy(); |
| 98 | 97 |
| 99 PassRefPtrWillBeRawPtr<CSSRule> createCSSOMWrapper(CSSStyleSheet* parentShee
t, CSSRule* parentRule) const; | 98 RawPtr<CSSRule> createCSSOMWrapper(CSSStyleSheet* parentSheet, CSSRule* pare
ntRule) const; |
| 100 | 99 |
| 101 unsigned m_type : 5; | 100 unsigned m_type : 5; |
| 102 }; | 101 }; |
| 103 | 102 |
| 104 class CORE_EXPORT StyleRule : public StyleRuleBase { | 103 class CORE_EXPORT StyleRule : public StyleRuleBase { |
| 105 USING_FAST_MALLOC_WITH_TYPE_NAME_WILL_BE_REMOVED(blink::StyleRule); | |
| 106 public: | 104 public: |
| 107 // Adopts the selector list | 105 // Adopts the selector list |
| 108 static PassRefPtrWillBeRawPtr<StyleRule> create(CSSSelectorList selectorList
, PassRefPtrWillBeRawPtr<StylePropertySet> properties) | 106 static RawPtr<StyleRule> create(CSSSelectorList selectorList, RawPtr<StylePr
opertySet> properties) |
| 109 { | 107 { |
| 110 return adoptRefWillBeNoop(new StyleRule(std::move(selectorList), propert
ies)); | 108 return new StyleRule(std::move(selectorList), properties); |
| 111 } | 109 } |
| 112 | 110 |
| 113 ~StyleRule(); | 111 ~StyleRule(); |
| 114 | 112 |
| 115 const CSSSelectorList& selectorList() const { return m_selectorList; } | 113 const CSSSelectorList& selectorList() const { return m_selectorList; } |
| 116 const StylePropertySet& properties() const { return *m_properties; } | 114 const StylePropertySet& properties() const { return *m_properties; } |
| 117 MutableStylePropertySet& mutableProperties(); | 115 MutableStylePropertySet& mutableProperties(); |
| 118 | 116 |
| 119 void wrapperAdoptSelectorList(CSSSelectorList selectors) { m_selectorList =
std::move(selectors); } | 117 void wrapperAdoptSelectorList(CSSSelectorList selectors) { m_selectorList =
std::move(selectors); } |
| 120 | 118 |
| 121 PassRefPtrWillBeRawPtr<StyleRule> copy() const { return adoptRefWillBeNoop(n
ew StyleRule(*this)); } | 119 RawPtr<StyleRule> copy() const { return new StyleRule(*this); } |
| 122 | 120 |
| 123 static unsigned averageSizeInBytes(); | 121 static unsigned averageSizeInBytes(); |
| 124 | 122 |
| 125 DECLARE_TRACE_AFTER_DISPATCH(); | 123 DECLARE_TRACE_AFTER_DISPATCH(); |
| 126 | 124 |
| 127 private: | 125 private: |
| 128 StyleRule(CSSSelectorList, PassRefPtrWillBeRawPtr<StylePropertySet>); | 126 StyleRule(CSSSelectorList, RawPtr<StylePropertySet>); |
| 129 StyleRule(const StyleRule&); | 127 StyleRule(const StyleRule&); |
| 130 | 128 |
| 131 RefPtrWillBeMember<StylePropertySet> m_properties; // Cannot be null. | 129 Member<StylePropertySet> m_properties; // Cannot be null. |
| 132 CSSSelectorList m_selectorList; | 130 CSSSelectorList m_selectorList; |
| 133 }; | 131 }; |
| 134 | 132 |
| 135 class StyleRuleFontFace : public StyleRuleBase { | 133 class StyleRuleFontFace : public StyleRuleBase { |
| 136 public: | 134 public: |
| 137 static PassRefPtrWillBeRawPtr<StyleRuleFontFace> create(PassRefPtrWillBeRawP
tr<StylePropertySet> properties) | 135 static RawPtr<StyleRuleFontFace> create(RawPtr<StylePropertySet> properties) |
| 138 { | 136 { |
| 139 return adoptRefWillBeNoop(new StyleRuleFontFace(properties)); | 137 return new StyleRuleFontFace(properties); |
| 140 } | 138 } |
| 141 | 139 |
| 142 ~StyleRuleFontFace(); | 140 ~StyleRuleFontFace(); |
| 143 | 141 |
| 144 const StylePropertySet& properties() const { return *m_properties; } | 142 const StylePropertySet& properties() const { return *m_properties; } |
| 145 MutableStylePropertySet& mutableProperties(); | 143 MutableStylePropertySet& mutableProperties(); |
| 146 | 144 |
| 147 PassRefPtrWillBeRawPtr<StyleRuleFontFace> copy() const { return adoptRefWill
BeNoop(new StyleRuleFontFace(*this)); } | 145 RawPtr<StyleRuleFontFace> copy() const { return new StyleRuleFontFace(*this)
; } |
| 148 | 146 |
| 149 DECLARE_TRACE_AFTER_DISPATCH(); | 147 DECLARE_TRACE_AFTER_DISPATCH(); |
| 150 | 148 |
| 151 private: | 149 private: |
| 152 StyleRuleFontFace(PassRefPtrWillBeRawPtr<StylePropertySet>); | 150 StyleRuleFontFace(RawPtr<StylePropertySet>); |
| 153 StyleRuleFontFace(const StyleRuleFontFace&); | 151 StyleRuleFontFace(const StyleRuleFontFace&); |
| 154 | 152 |
| 155 RefPtrWillBeMember<StylePropertySet> m_properties; // Cannot be null. | 153 Member<StylePropertySet> m_properties; // Cannot be null. |
| 156 }; | 154 }; |
| 157 | 155 |
| 158 class StyleRulePage : public StyleRuleBase { | 156 class StyleRulePage : public StyleRuleBase { |
| 159 public: | 157 public: |
| 160 // Adopts the selector list | 158 // Adopts the selector list |
| 161 static PassRefPtrWillBeRawPtr<StyleRulePage> create(CSSSelectorList selector
List, PassRefPtrWillBeRawPtr<StylePropertySet> properties) | 159 static RawPtr<StyleRulePage> create(CSSSelectorList selectorList, RawPtr<Sty
lePropertySet> properties) |
| 162 { | 160 { |
| 163 return adoptRefWillBeNoop(new StyleRulePage(std::move(selectorList), pro
perties)); | 161 return new StyleRulePage(std::move(selectorList), properties); |
| 164 } | 162 } |
| 165 | 163 |
| 166 ~StyleRulePage(); | 164 ~StyleRulePage(); |
| 167 | 165 |
| 168 const CSSSelector* selector() const { return m_selectorList.first(); } | 166 const CSSSelector* selector() const { return m_selectorList.first(); } |
| 169 const StylePropertySet& properties() const { return *m_properties; } | 167 const StylePropertySet& properties() const { return *m_properties; } |
| 170 MutableStylePropertySet& mutableProperties(); | 168 MutableStylePropertySet& mutableProperties(); |
| 171 | 169 |
| 172 void wrapperAdoptSelectorList(CSSSelectorList selectors) { m_selectorList =
std::move(selectors); } | 170 void wrapperAdoptSelectorList(CSSSelectorList selectors) { m_selectorList =
std::move(selectors); } |
| 173 | 171 |
| 174 PassRefPtrWillBeRawPtr<StyleRulePage> copy() const { return adoptRefWillBeNo
op(new StyleRulePage(*this)); } | 172 RawPtr<StyleRulePage> copy() const { return new StyleRulePage(*this); } |
| 175 | 173 |
| 176 DECLARE_TRACE_AFTER_DISPATCH(); | 174 DECLARE_TRACE_AFTER_DISPATCH(); |
| 177 | 175 |
| 178 private: | 176 private: |
| 179 StyleRulePage(CSSSelectorList, PassRefPtrWillBeRawPtr<StylePropertySet>); | 177 StyleRulePage(CSSSelectorList, RawPtr<StylePropertySet>); |
| 180 StyleRulePage(const StyleRulePage&); | 178 StyleRulePage(const StyleRulePage&); |
| 181 | 179 |
| 182 RefPtrWillBeMember<StylePropertySet> m_properties; // Cannot be null. | 180 Member<StylePropertySet> m_properties; // Cannot be null. |
| 183 CSSSelectorList m_selectorList; | 181 CSSSelectorList m_selectorList; |
| 184 }; | 182 }; |
| 185 | 183 |
| 186 class StyleRuleGroup : public StyleRuleBase { | 184 class StyleRuleGroup : public StyleRuleBase { |
| 187 public: | 185 public: |
| 188 const WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>>& childRules() cons
t { return m_childRules; } | 186 const HeapVector<Member<StyleRuleBase>>& childRules() const { return m_child
Rules; } |
| 189 | 187 |
| 190 void wrapperInsertRule(unsigned, PassRefPtrWillBeRawPtr<StyleRuleBase>); | 188 void wrapperInsertRule(unsigned, RawPtr<StyleRuleBase>); |
| 191 void wrapperRemoveRule(unsigned); | 189 void wrapperRemoveRule(unsigned); |
| 192 | 190 |
| 193 DECLARE_TRACE_AFTER_DISPATCH(); | 191 DECLARE_TRACE_AFTER_DISPATCH(); |
| 194 | 192 |
| 195 protected: | 193 protected: |
| 196 StyleRuleGroup(RuleType, WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>>
& adoptRule); | 194 StyleRuleGroup(RuleType, HeapVector<Member<StyleRuleBase>>& adoptRule); |
| 197 StyleRuleGroup(const StyleRuleGroup&); | 195 StyleRuleGroup(const StyleRuleGroup&); |
| 198 | 196 |
| 199 private: | 197 private: |
| 200 WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>> m_childRules; | 198 HeapVector<Member<StyleRuleBase>> m_childRules; |
| 201 }; | 199 }; |
| 202 | 200 |
| 203 class StyleRuleMedia : public StyleRuleGroup { | 201 class StyleRuleMedia : public StyleRuleGroup { |
| 204 public: | 202 public: |
| 205 static PassRefPtrWillBeRawPtr<StyleRuleMedia> create(PassRefPtrWillBeRawPtr<
MediaQuerySet> media, WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>>& adopt
Rules) | 203 static RawPtr<StyleRuleMedia> create(RawPtr<MediaQuerySet> media, HeapVector
<Member<StyleRuleBase>>& adoptRules) |
| 206 { | 204 { |
| 207 return adoptRefWillBeNoop(new StyleRuleMedia(media, adoptRules)); | 205 return new StyleRuleMedia(media, adoptRules); |
| 208 } | 206 } |
| 209 | 207 |
| 210 MediaQuerySet* mediaQueries() const { return m_mediaQueries.get(); } | 208 MediaQuerySet* mediaQueries() const { return m_mediaQueries.get(); } |
| 211 | 209 |
| 212 PassRefPtrWillBeRawPtr<StyleRuleMedia> copy() const { return adoptRefWillBeN
oop(new StyleRuleMedia(*this)); } | 210 RawPtr<StyleRuleMedia> copy() const { return new StyleRuleMedia(*this); } |
| 213 | 211 |
| 214 DECLARE_TRACE_AFTER_DISPATCH(); | 212 DECLARE_TRACE_AFTER_DISPATCH(); |
| 215 | 213 |
| 216 private: | 214 private: |
| 217 StyleRuleMedia(PassRefPtrWillBeRawPtr<MediaQuerySet>, WillBeHeapVector<RefPt
rWillBeMember<StyleRuleBase>>& adoptRules); | 215 StyleRuleMedia(RawPtr<MediaQuerySet>, HeapVector<Member<StyleRuleBase>>& ado
ptRules); |
| 218 StyleRuleMedia(const StyleRuleMedia&); | 216 StyleRuleMedia(const StyleRuleMedia&); |
| 219 | 217 |
| 220 RefPtrWillBeMember<MediaQuerySet> m_mediaQueries; | 218 Member<MediaQuerySet> m_mediaQueries; |
| 221 }; | 219 }; |
| 222 | 220 |
| 223 class StyleRuleSupports : public StyleRuleGroup { | 221 class StyleRuleSupports : public StyleRuleGroup { |
| 224 public: | 222 public: |
| 225 static PassRefPtrWillBeRawPtr<StyleRuleSupports> create(const String& condit
ionText, bool conditionIsSupported, WillBeHeapVector<RefPtrWillBeMember<StyleRul
eBase>>& adoptRules) | 223 static RawPtr<StyleRuleSupports> create(const String& conditionText, bool co
nditionIsSupported, HeapVector<Member<StyleRuleBase>>& adoptRules) |
| 226 { | 224 { |
| 227 return adoptRefWillBeNoop(new StyleRuleSupports(conditionText, condition
IsSupported, adoptRules)); | 225 return new StyleRuleSupports(conditionText, conditionIsSupported, adoptR
ules); |
| 228 } | 226 } |
| 229 | 227 |
| 230 String conditionText() const { return m_conditionText; } | 228 String conditionText() const { return m_conditionText; } |
| 231 bool conditionIsSupported() const { return m_conditionIsSupported; } | 229 bool conditionIsSupported() const { return m_conditionIsSupported; } |
| 232 PassRefPtrWillBeRawPtr<StyleRuleSupports> copy() const { return adoptRefWill
BeNoop(new StyleRuleSupports(*this)); } | 230 RawPtr<StyleRuleSupports> copy() const { return new StyleRuleSupports(*this)
; } |
| 233 | 231 |
| 234 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { StyleRuleGroup::traceAfterDispatch(vi
sitor); } | 232 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { StyleRuleGroup::traceAfterDispatch(vi
sitor); } |
| 235 | 233 |
| 236 private: | 234 private: |
| 237 StyleRuleSupports(const String& conditionText, bool conditionIsSupported, Wi
llBeHeapVector<RefPtrWillBeMember<StyleRuleBase>>& adoptRules); | 235 StyleRuleSupports(const String& conditionText, bool conditionIsSupported, He
apVector<Member<StyleRuleBase>>& adoptRules); |
| 238 StyleRuleSupports(const StyleRuleSupports&); | 236 StyleRuleSupports(const StyleRuleSupports&); |
| 239 | 237 |
| 240 String m_conditionText; | 238 String m_conditionText; |
| 241 bool m_conditionIsSupported; | 239 bool m_conditionIsSupported; |
| 242 }; | 240 }; |
| 243 | 241 |
| 244 class StyleRuleViewport : public StyleRuleBase { | 242 class StyleRuleViewport : public StyleRuleBase { |
| 245 public: | 243 public: |
| 246 static PassRefPtrWillBeRawPtr<StyleRuleViewport> create(PassRefPtrWillBeRawP
tr<StylePropertySet> properties) | 244 static RawPtr<StyleRuleViewport> create(RawPtr<StylePropertySet> properties) |
| 247 { | 245 { |
| 248 return adoptRefWillBeNoop(new StyleRuleViewport(properties)); | 246 return new StyleRuleViewport(properties); |
| 249 } | 247 } |
| 250 | 248 |
| 251 ~StyleRuleViewport(); | 249 ~StyleRuleViewport(); |
| 252 | 250 |
| 253 const StylePropertySet& properties() const { return *m_properties; } | 251 const StylePropertySet& properties() const { return *m_properties; } |
| 254 MutableStylePropertySet& mutableProperties(); | 252 MutableStylePropertySet& mutableProperties(); |
| 255 | 253 |
| 256 PassRefPtrWillBeRawPtr<StyleRuleViewport> copy() const { return adoptRefWill
BeNoop(new StyleRuleViewport(*this)); } | 254 RawPtr<StyleRuleViewport> copy() const { return new StyleRuleViewport(*this)
; } |
| 257 | 255 |
| 258 DECLARE_TRACE_AFTER_DISPATCH(); | 256 DECLARE_TRACE_AFTER_DISPATCH(); |
| 259 | 257 |
| 260 private: | 258 private: |
| 261 StyleRuleViewport(PassRefPtrWillBeRawPtr<StylePropertySet>); | 259 StyleRuleViewport(RawPtr<StylePropertySet>); |
| 262 StyleRuleViewport(const StyleRuleViewport&); | 260 StyleRuleViewport(const StyleRuleViewport&); |
| 263 | 261 |
| 264 RefPtrWillBeMember<StylePropertySet> m_properties; // Cannot be null | 262 Member<StylePropertySet> m_properties; // Cannot be null |
| 265 }; | 263 }; |
| 266 | 264 |
| 267 // This should only be used within the CSS Parser | 265 // This should only be used within the CSS Parser |
| 268 class StyleRuleCharset : public StyleRuleBase { | 266 class StyleRuleCharset : public StyleRuleBase { |
| 269 USING_FAST_MALLOC_WILL_BE_REMOVED(StyleRuleCharset); | |
| 270 public: | 267 public: |
| 271 static PassRefPtrWillBeRawPtr<StyleRuleCharset> create() { return adoptRefWi
llBeNoop(new StyleRuleCharset()); } | 268 static RawPtr<StyleRuleCharset> create() { return new StyleRuleCharset(); } |
| 272 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { StyleRuleBase::traceAfterDispatch(vis
itor); } | 269 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { StyleRuleBase::traceAfterDispatch(vis
itor); } |
| 273 | 270 |
| 274 private: | 271 private: |
| 275 StyleRuleCharset() : StyleRuleBase(Charset) { } | 272 StyleRuleCharset() : StyleRuleBase(Charset) { } |
| 276 }; | 273 }; |
| 277 | 274 |
| 278 | 275 |
| 279 #define DEFINE_STYLE_RULE_TYPE_CASTS(Type) \ | 276 #define DEFINE_STYLE_RULE_TYPE_CASTS(Type) \ |
| 280 DEFINE_TYPE_CASTS(StyleRule##Type, StyleRuleBase, rule, rule->is##Type##Rule
(), rule.is##Type##Rule()) | 277 DEFINE_TYPE_CASTS(StyleRule##Type, StyleRuleBase, rule, rule->is##Type##Rule
(), rule.is##Type##Rule()) |
| 281 | 278 |
| 282 DEFINE_TYPE_CASTS(StyleRule, StyleRuleBase, rule, rule->isStyleRule(), rule.isSt
yleRule()); | 279 DEFINE_TYPE_CASTS(StyleRule, StyleRuleBase, rule, rule->isStyleRule(), rule.isSt
yleRule()); |
| 283 DEFINE_STYLE_RULE_TYPE_CASTS(FontFace); | 280 DEFINE_STYLE_RULE_TYPE_CASTS(FontFace); |
| 284 DEFINE_STYLE_RULE_TYPE_CASTS(Page); | 281 DEFINE_STYLE_RULE_TYPE_CASTS(Page); |
| 285 DEFINE_STYLE_RULE_TYPE_CASTS(Media); | 282 DEFINE_STYLE_RULE_TYPE_CASTS(Media); |
| 286 DEFINE_STYLE_RULE_TYPE_CASTS(Supports); | 283 DEFINE_STYLE_RULE_TYPE_CASTS(Supports); |
| 287 DEFINE_STYLE_RULE_TYPE_CASTS(Viewport); | 284 DEFINE_STYLE_RULE_TYPE_CASTS(Viewport); |
| 288 DEFINE_STYLE_RULE_TYPE_CASTS(Charset); | 285 DEFINE_STYLE_RULE_TYPE_CASTS(Charset); |
| 289 | 286 |
| 290 } // namespace blink | 287 } // namespace blink |
| 291 | 288 |
| 292 #endif // StyleRule_h | 289 #endif // StyleRule_h |
| OLD | NEW |