| 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 Apple Inc. All rights reserved. | 4 * Copyright (C) 2002, 2006, 2008, 2012 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 Page, | 46 Page, |
| 47 Keyframes, | 47 Keyframes, |
| 48 Keyframe, // Not used. These are internally non-rule StyleKeyframe objec
ts. | 48 Keyframe, // Not used. These are internally non-rule StyleKeyframe objec
ts. |
| 49 #if ENABLE(CSS3_CONDITIONAL_RULES) | 49 #if ENABLE(CSS3_CONDITIONAL_RULES) |
| 50 Supports = 12, | 50 Supports = 12, |
| 51 #endif | 51 #endif |
| 52 #if ENABLE(CSS_DEVICE_ADAPTATION) | 52 #if ENABLE(CSS_DEVICE_ADAPTATION) |
| 53 Viewport = 15, | 53 Viewport = 15, |
| 54 #endif | 54 #endif |
| 55 Region = 16, | 55 Region = 16, |
| 56 #if ENABLE(CSS_SHADERS) | |
| 57 Filter = 17, | 56 Filter = 17, |
| 58 #endif | |
| 59 #if ENABLE(SHADOW_DOM) | 57 #if ENABLE(SHADOW_DOM) |
| 60 HostInternal = 18, // Spec says Host = 1001, but we can use only 5 bit f
or type(). | 58 HostInternal = 18, // Spec says Host = 1001, but we can use only 5 bit f
or type(). |
| 61 #endif | 59 #endif |
| 62 }; | 60 }; |
| 63 | 61 |
| 64 Type type() const { return static_cast<Type>(m_type); } | 62 Type type() const { return static_cast<Type>(m_type); } |
| 65 | 63 |
| 66 bool isCharsetRule() const { return type() == Charset; } | 64 bool isCharsetRule() const { return type() == Charset; } |
| 67 bool isFontFaceRule() const { return type() == FontFace; } | 65 bool isFontFaceRule() const { return type() == FontFace; } |
| 68 bool isKeyframesRule() const { return type() == Keyframes; } | 66 bool isKeyframesRule() const { return type() == Keyframes; } |
| 69 bool isMediaRule() const { return type() == Media; } | 67 bool isMediaRule() const { return type() == Media; } |
| 70 bool isPageRule() const { return type() == Page; } | 68 bool isPageRule() const { return type() == Page; } |
| 71 bool isStyleRule() const { return type() == Style; } | 69 bool isStyleRule() const { return type() == Style; } |
| 72 bool isRegionRule() const { return type() == Region; } | 70 bool isRegionRule() const { return type() == Region; } |
| 73 #if ENABLE(CSS3_CONDITIONAL_RULES) | 71 #if ENABLE(CSS3_CONDITIONAL_RULES) |
| 74 bool isSupportsRule() const { return type() == Supports; } | 72 bool isSupportsRule() const { return type() == Supports; } |
| 75 #endif | 73 #endif |
| 76 #if ENABLE(CSS_DEVICE_ADAPTATION) | 74 #if ENABLE(CSS_DEVICE_ADAPTATION) |
| 77 bool isViewportRule() const { return type() == Viewport; } | 75 bool isViewportRule() const { return type() == Viewport; } |
| 78 #endif | 76 #endif |
| 79 bool isImportRule() const { return type() == Import; } | 77 bool isImportRule() const { return type() == Import; } |
| 80 #if ENABLE(SHADOW_DOM) | 78 #if ENABLE(SHADOW_DOM) |
| 81 bool isHostRule() const { return type() == HostInternal; } | 79 bool isHostRule() const { return type() == HostInternal; } |
| 82 #endif | 80 #endif |
| 83 #if ENABLE(CSS_SHADERS) | |
| 84 bool isFilterRule() const { return type() == Filter; } | 81 bool isFilterRule() const { return type() == Filter; } |
| 85 #endif | |
| 86 | 82 |
| 87 PassRefPtr<StyleRuleBase> copy() const; | 83 PassRefPtr<StyleRuleBase> copy() const; |
| 88 | 84 |
| 89 int sourceLine() const { return m_sourceLine; } | 85 int sourceLine() const { return m_sourceLine; } |
| 90 | 86 |
| 91 void deref() | 87 void deref() |
| 92 { | 88 { |
| 93 if (derefBase()) | 89 if (derefBase()) |
| 94 destroy(); | 90 destroy(); |
| 95 } | 91 } |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 return static_cast<const StyleRuleSupports*>(rule); | 318 return static_cast<const StyleRuleSupports*>(rule); |
| 323 } | 319 } |
| 324 #endif | 320 #endif |
| 325 | 321 |
| 326 inline const StyleRuleRegion* toStyleRuleRegion(const StyleRuleGroup* rule) | 322 inline const StyleRuleRegion* toStyleRuleRegion(const StyleRuleGroup* rule) |
| 327 { | 323 { |
| 328 ASSERT_WITH_SECURITY_IMPLICATION(!rule || rule->isRegionRule()); | 324 ASSERT_WITH_SECURITY_IMPLICATION(!rule || rule->isRegionRule()); |
| 329 return static_cast<const StyleRuleRegion*>(rule); | 325 return static_cast<const StyleRuleRegion*>(rule); |
| 330 } | 326 } |
| 331 | 327 |
| 332 #if ENABLE(CSS_SHADERS) | |
| 333 class StyleRuleFilter : public StyleRuleBase { | 328 class StyleRuleFilter : public StyleRuleBase { |
| 334 public: | 329 public: |
| 335 static PassRefPtr<StyleRuleFilter> create(const String& filterName) { return
adoptRef(new StyleRuleFilter(filterName)); } | 330 static PassRefPtr<StyleRuleFilter> create(const String& filterName) { return
adoptRef(new StyleRuleFilter(filterName)); } |
| 336 | 331 |
| 337 ~StyleRuleFilter(); | 332 ~StyleRuleFilter(); |
| 338 | 333 |
| 339 const String& filterName() const { return m_filterName; } | 334 const String& filterName() const { return m_filterName; } |
| 340 | 335 |
| 341 const StylePropertySet* properties() const { return m_properties.get(); } | 336 const StylePropertySet* properties() const { return m_properties.get(); } |
| 342 StylePropertySet* mutableProperties(); | 337 StylePropertySet* mutableProperties(); |
| 343 | 338 |
| 344 void setProperties(PassRefPtr<StylePropertySet>); | 339 void setProperties(PassRefPtr<StylePropertySet>); |
| 345 | 340 |
| 346 PassRefPtr<StyleRuleFilter> copy() const { return adoptRef(new StyleRuleFilt
er(*this)); } | 341 PassRefPtr<StyleRuleFilter> copy() const { return adoptRef(new StyleRuleFilt
er(*this)); } |
| 347 | 342 |
| 348 void reportDescendantMemoryUsage(MemoryObjectInfo*) const; | 343 void reportDescendantMemoryUsage(MemoryObjectInfo*) const; |
| 349 | 344 |
| 350 private: | 345 private: |
| 351 StyleRuleFilter(const String&); | 346 StyleRuleFilter(const String&); |
| 352 StyleRuleFilter(const StyleRuleFilter&); | 347 StyleRuleFilter(const StyleRuleFilter&); |
| 353 | 348 |
| 354 String m_filterName; | 349 String m_filterName; |
| 355 RefPtr<StylePropertySet> m_properties; | 350 RefPtr<StylePropertySet> m_properties; |
| 356 }; | 351 }; |
| 357 #endif // ENABLE(CSS_SHADERS) | |
| 358 | 352 |
| 359 } // namespace WebCore | 353 } // namespace WebCore |
| 360 | 354 |
| 361 #endif // StyleRule_h | 355 #endif // StyleRule_h |
| OLD | NEW |