| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 class Element; | 38 class Element; |
| 39 class ExceptionState; | 39 class ExceptionState; |
| 40 class MutableStylePropertySet; | 40 class MutableStylePropertySet; |
| 41 class StyleSheetContents; | 41 class StyleSheetContents; |
| 42 | 42 |
| 43 class AbstractPropertySetCSSStyleDeclaration : public CSSStyleDeclaration { | 43 class AbstractPropertySetCSSStyleDeclaration : public CSSStyleDeclaration { |
| 44 public: | 44 public: |
| 45 virtual Element* parentElement() const { return 0; } | 45 virtual Element* parentElement() const { return 0; } |
| 46 StyleSheetContents* contextStyleSheet() const; | 46 StyleSheetContents* contextStyleSheet() const; |
| 47 | 47 |
| 48 virtual void trace(Visitor*) override; | 48 DECLARE_VIRTUAL_TRACE(); |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 virtual CSSRule* parentRule() const override { return 0; } | 51 virtual CSSRule* parentRule() const override { return 0; } |
| 52 virtual unsigned length() const override final; | 52 virtual unsigned length() const override final; |
| 53 virtual String item(unsigned index) const override final; | 53 virtual String item(unsigned index) const override final; |
| 54 virtual String getPropertyValue(const String& propertyName) override final; | 54 virtual String getPropertyValue(const String& propertyName) override final; |
| 55 virtual String getPropertyPriority(const String& propertyName) override fina
l; | 55 virtual String getPropertyPriority(const String& propertyName) override fina
l; |
| 56 virtual String getPropertyShorthand(const String& propertyName) override fin
al; | 56 virtual String getPropertyShorthand(const String& propertyName) override fin
al; |
| 57 virtual bool isPropertyImplicit(const String& propertyName) override final; | 57 virtual bool isPropertyImplicit(const String& propertyName) override final; |
| 58 virtual void setProperty(const String& propertyName, const String& value, co
nst String& priority, ExceptionState&) override final; | 58 virtual void setProperty(const String& propertyName, const String& value, co
nst String& priority, ExceptionState&) override final; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 75 | 75 |
| 76 class PropertySetCSSStyleDeclaration : public AbstractPropertySetCSSStyleDeclara
tion { | 76 class PropertySetCSSStyleDeclaration : public AbstractPropertySetCSSStyleDeclara
tion { |
| 77 public: | 77 public: |
| 78 PropertySetCSSStyleDeclaration(MutableStylePropertySet& propertySet) : m_pro
pertySet(&propertySet) { } | 78 PropertySetCSSStyleDeclaration(MutableStylePropertySet& propertySet) : m_pro
pertySet(&propertySet) { } |
| 79 | 79 |
| 80 #if !ENABLE(OILPAN) | 80 #if !ENABLE(OILPAN) |
| 81 virtual void ref() override; | 81 virtual void ref() override; |
| 82 virtual void deref() override; | 82 virtual void deref() override; |
| 83 #endif | 83 #endif |
| 84 | 84 |
| 85 virtual void trace(Visitor*) override; | 85 DECLARE_VIRTUAL_TRACE(); |
| 86 | 86 |
| 87 protected: | 87 protected: |
| 88 virtual MutableStylePropertySet& propertySet() const override final { ASSERT
(m_propertySet); return *m_propertySet; } | 88 virtual MutableStylePropertySet& propertySet() const override final { ASSERT
(m_propertySet); return *m_propertySet; } |
| 89 | 89 |
| 90 RawPtrWillBeMember<MutableStylePropertySet> m_propertySet; // Cannot be null | 90 RawPtrWillBeMember<MutableStylePropertySet> m_propertySet; // Cannot be null |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 class StyleRuleCSSStyleDeclaration : public PropertySetCSSStyleDeclaration | 93 class StyleRuleCSSStyleDeclaration : public PropertySetCSSStyleDeclaration |
| 94 { | 94 { |
| 95 public: | 95 public: |
| 96 static PassRefPtrWillBeRawPtr<StyleRuleCSSStyleDeclaration> create(MutableSt
ylePropertySet& propertySet, CSSRule* parentRule) | 96 static PassRefPtrWillBeRawPtr<StyleRuleCSSStyleDeclaration> create(MutableSt
ylePropertySet& propertySet, CSSRule* parentRule) |
| 97 { | 97 { |
| 98 return adoptRefWillBeNoop(new StyleRuleCSSStyleDeclaration(propertySet,
parentRule)); | 98 return adoptRefWillBeNoop(new StyleRuleCSSStyleDeclaration(propertySet,
parentRule)); |
| 99 } | 99 } |
| 100 | 100 |
| 101 #if !ENABLE(OILPAN) | 101 #if !ENABLE(OILPAN) |
| 102 void clearParentRule() { m_parentRule = nullptr; } | 102 void clearParentRule() { m_parentRule = nullptr; } |
| 103 | 103 |
| 104 virtual void ref() override; | 104 virtual void ref() override; |
| 105 virtual void deref() override; | 105 virtual void deref() override; |
| 106 #endif | 106 #endif |
| 107 | 107 |
| 108 void reattach(MutableStylePropertySet&); | 108 void reattach(MutableStylePropertySet&); |
| 109 | 109 |
| 110 virtual void trace(Visitor*) override; | 110 DECLARE_VIRTUAL_TRACE(); |
| 111 | 111 |
| 112 protected: | 112 protected: |
| 113 StyleRuleCSSStyleDeclaration(MutableStylePropertySet&, CSSRule*); | 113 StyleRuleCSSStyleDeclaration(MutableStylePropertySet&, CSSRule*); |
| 114 virtual ~StyleRuleCSSStyleDeclaration(); | 114 virtual ~StyleRuleCSSStyleDeclaration(); |
| 115 | 115 |
| 116 virtual CSSStyleSheet* parentStyleSheet() const override; | 116 virtual CSSStyleSheet* parentStyleSheet() const override; |
| 117 | 117 |
| 118 virtual CSSRule* parentRule() const override { return m_parentRule; } | 118 virtual CSSRule* parentRule() const override { return m_parentRule; } |
| 119 | 119 |
| 120 virtual void willMutate() override; | 120 virtual void willMutate() override; |
| 121 virtual void didMutate(MutationType) override; | 121 virtual void didMutate(MutationType) override; |
| 122 | 122 |
| 123 #if !ENABLE(OILPAN) | 123 #if !ENABLE(OILPAN) |
| 124 unsigned m_refCount; | 124 unsigned m_refCount; |
| 125 #endif | 125 #endif |
| 126 RawPtrWillBeMember<CSSRule> m_parentRule; | 126 RawPtrWillBeMember<CSSRule> m_parentRule; |
| 127 }; | 127 }; |
| 128 | 128 |
| 129 class InlineCSSStyleDeclaration final : public AbstractPropertySetCSSStyleDeclar
ation | 129 class InlineCSSStyleDeclaration final : public AbstractPropertySetCSSStyleDeclar
ation |
| 130 { | 130 { |
| 131 public: | 131 public: |
| 132 explicit InlineCSSStyleDeclaration(Element* parentElement) | 132 explicit InlineCSSStyleDeclaration(Element* parentElement) |
| 133 : m_parentElement(parentElement) | 133 : m_parentElement(parentElement) |
| 134 { | 134 { |
| 135 } | 135 } |
| 136 | 136 |
| 137 virtual void trace(Visitor*) override; | 137 DECLARE_VIRTUAL_TRACE(); |
| 138 | 138 |
| 139 private: | 139 private: |
| 140 virtual MutableStylePropertySet& propertySet() const override; | 140 virtual MutableStylePropertySet& propertySet() const override; |
| 141 #if !ENABLE(OILPAN) | 141 #if !ENABLE(OILPAN) |
| 142 virtual void ref() override; | 142 virtual void ref() override; |
| 143 virtual void deref() override; | 143 virtual void deref() override; |
| 144 #endif | 144 #endif |
| 145 virtual CSSStyleSheet* parentStyleSheet() const override; | 145 virtual CSSStyleSheet* parentStyleSheet() const override; |
| 146 virtual Element* parentElement() const override { return m_parentElement; } | 146 virtual Element* parentElement() const override { return m_parentElement; } |
| 147 | 147 |
| 148 virtual void didMutate(MutationType) override; | 148 virtual void didMutate(MutationType) override; |
| 149 | 149 |
| 150 RawPtrWillBeMember<Element> m_parentElement; | 150 RawPtrWillBeMember<Element> m_parentElement; |
| 151 }; | 151 }; |
| 152 | 152 |
| 153 } // namespace blink | 153 } // namespace blink |
| 154 | 154 |
| 155 #endif | 155 #endif |
| OLD | NEW |