| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 Style, | 42 Style, |
| 43 Charset, // Not used. These are internally strings owned by the style sh
eet. | 43 Charset, // Not used. These are internally strings owned by the style sh
eet. |
| 44 Import, | 44 Import, |
| 45 Media, | 45 Media, |
| 46 FontFace, | 46 FontFace, |
| 47 Page, | 47 Page, |
| 48 Keyframes, | 48 Keyframes, |
| 49 Keyframe, // Not used. These are internally non-rule StyleKeyframe objec
ts. | 49 Keyframe, // Not used. These are internally non-rule StyleKeyframe objec
ts. |
| 50 Supports = 12, | 50 Supports = 12, |
| 51 Viewport = 15, | 51 Viewport = 15, |
| 52 Region = 16, | |
| 53 Filter = 17 | 52 Filter = 17 |
| 54 }; | 53 }; |
| 55 | 54 |
| 56 Type type() const { return static_cast<Type>(m_type); } | 55 Type type() const { return static_cast<Type>(m_type); } |
| 57 | 56 |
| 58 bool isCharsetRule() const { return type() == Charset; } | 57 bool isCharsetRule() const { return type() == Charset; } |
| 59 bool isFontFaceRule() const { return type() == FontFace; } | 58 bool isFontFaceRule() const { return type() == FontFace; } |
| 60 bool isKeyframesRule() const { return type() == Keyframes; } | 59 bool isKeyframesRule() const { return type() == Keyframes; } |
| 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 isRegionRule() const { return type() == Region; } | |
| 65 bool isSupportsRule() const { return type() == Supports; } | 63 bool isSupportsRule() const { return type() == Supports; } |
| 66 bool isViewportRule() const { return type() == Viewport; } | 64 bool isViewportRule() const { return type() == Viewport; } |
| 67 bool isImportRule() const { return type() == Import; } | 65 bool isImportRule() const { return type() == Import; } |
| 68 bool isFilterRule() const { return type() == Filter; } | 66 bool isFilterRule() const { return type() == Filter; } |
| 69 | 67 |
| 70 PassRefPtr<StyleRuleBase> copy() const; | 68 PassRefPtr<StyleRuleBase> copy() const; |
| 71 | 69 |
| 72 void deref() | 70 void deref() |
| 73 { | 71 { |
| 74 if (derefBase()) | 72 if (derefBase()) |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 PassRefPtr<StyleRuleSupports> copy() const { return adoptRef(new StyleRuleSu
pports(*this)); } | 207 PassRefPtr<StyleRuleSupports> copy() const { return adoptRef(new StyleRuleSu
pports(*this)); } |
| 210 | 208 |
| 211 private: | 209 private: |
| 212 StyleRuleSupports(const String& conditionText, bool conditionIsSupported, Ve
ctor<RefPtr<StyleRuleBase> >& adoptRules); | 210 StyleRuleSupports(const String& conditionText, bool conditionIsSupported, Ve
ctor<RefPtr<StyleRuleBase> >& adoptRules); |
| 213 StyleRuleSupports(const StyleRuleSupports&); | 211 StyleRuleSupports(const StyleRuleSupports&); |
| 214 | 212 |
| 215 String m_conditionText; | 213 String m_conditionText; |
| 216 bool m_conditionIsSupported; | 214 bool m_conditionIsSupported; |
| 217 }; | 215 }; |
| 218 | 216 |
| 219 class StyleRuleRegion : public StyleRuleGroup { | |
| 220 public: | |
| 221 static PassRefPtr<StyleRuleRegion> create(Vector<OwnPtr<CSSParserSelector> >
* selectors, Vector<RefPtr<StyleRuleBase> >& adoptRules) | |
| 222 { | |
| 223 return adoptRef(new StyleRuleRegion(selectors, adoptRules)); | |
| 224 } | |
| 225 | |
| 226 const CSSSelectorList& selectorList() const { return m_selectorList; } | |
| 227 | |
| 228 PassRefPtr<StyleRuleRegion> copy() const { return adoptRef(new StyleRuleRegi
on(*this)); } | |
| 229 | |
| 230 private: | |
| 231 StyleRuleRegion(Vector<OwnPtr<CSSParserSelector> >*, Vector<RefPtr<StyleRule
Base> >& adoptRules); | |
| 232 StyleRuleRegion(const StyleRuleRegion&); | |
| 233 | |
| 234 CSSSelectorList m_selectorList; | |
| 235 }; | |
| 236 | |
| 237 class StyleRuleViewport : public StyleRuleBase { | 217 class StyleRuleViewport : public StyleRuleBase { |
| 238 public: | 218 public: |
| 239 static PassRefPtr<StyleRuleViewport> create() { return adoptRef(new StyleRul
eViewport); } | 219 static PassRefPtr<StyleRuleViewport> create() { return adoptRef(new StyleRul
eViewport); } |
| 240 | 220 |
| 241 ~StyleRuleViewport(); | 221 ~StyleRuleViewport(); |
| 242 | 222 |
| 243 const StylePropertySet* properties() const { return m_properties.get(); } | 223 const StylePropertySet* properties() const { return m_properties.get(); } |
| 244 MutableStylePropertySet* mutableProperties(); | 224 MutableStylePropertySet* mutableProperties(); |
| 245 | 225 |
| 246 void setProperties(PassRefPtr<StylePropertySet>); | 226 void setProperties(PassRefPtr<StylePropertySet>); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 }; | 258 }; |
| 279 | 259 |
| 280 #define DEFINE_STYLE_RULE_TYPE_CASTS(Type) \ | 260 #define DEFINE_STYLE_RULE_TYPE_CASTS(Type) \ |
| 281 DEFINE_TYPE_CASTS(StyleRule##Type, StyleRuleBase, rule, rule->is##Type##Rule
(), rule.is##Type##Rule()) | 261 DEFINE_TYPE_CASTS(StyleRule##Type, StyleRuleBase, rule, rule->is##Type##Rule
(), rule.is##Type##Rule()) |
| 282 | 262 |
| 283 DEFINE_TYPE_CASTS(StyleRule, StyleRuleBase, rule, rule->isStyleRule(), rule.isSt
yleRule()); | 263 DEFINE_TYPE_CASTS(StyleRule, StyleRuleBase, rule, rule->isStyleRule(), rule.isSt
yleRule()); |
| 284 DEFINE_STYLE_RULE_TYPE_CASTS(FontFace); | 264 DEFINE_STYLE_RULE_TYPE_CASTS(FontFace); |
| 285 DEFINE_STYLE_RULE_TYPE_CASTS(Page); | 265 DEFINE_STYLE_RULE_TYPE_CASTS(Page); |
| 286 DEFINE_STYLE_RULE_TYPE_CASTS(Media); | 266 DEFINE_STYLE_RULE_TYPE_CASTS(Media); |
| 287 DEFINE_STYLE_RULE_TYPE_CASTS(Supports); | 267 DEFINE_STYLE_RULE_TYPE_CASTS(Supports); |
| 288 DEFINE_STYLE_RULE_TYPE_CASTS(Region); | |
| 289 DEFINE_STYLE_RULE_TYPE_CASTS(Viewport); | 268 DEFINE_STYLE_RULE_TYPE_CASTS(Viewport); |
| 290 DEFINE_STYLE_RULE_TYPE_CASTS(Filter); | 269 DEFINE_STYLE_RULE_TYPE_CASTS(Filter); |
| 291 | 270 |
| 292 } // namespace WebCore | 271 } // namespace WebCore |
| 293 | 272 |
| 294 #endif // StyleRule_h | 273 #endif // StyleRule_h |
| OLD | NEW |