| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 virtual void clearParentElement() { ASSERT_NOT_REACHED(); } | 46 virtual void clearParentElement() { ASSERT_NOT_REACHED(); } |
| 47 StyleSheetContents* contextStyleSheet() const; | 47 StyleSheetContents* contextStyleSheet() const; |
| 48 | 48 |
| 49 protected: | 49 protected: |
| 50 virtual PassRefPtr<CSSVariablesIterator> variablesIterator() const OVERRIDE; | 50 virtual PassRefPtr<CSSVariablesIterator> variablesIterator() const OVERRIDE; |
| 51 | 51 |
| 52 private: | 52 private: |
| 53 virtual CSSRule* parentRule() const OVERRIDE { return 0; }; | 53 virtual CSSRule* parentRule() const OVERRIDE { return 0; } |
| 54 virtual unsigned length() const OVERRIDE; | 54 virtual unsigned length() const OVERRIDE FINAL; |
| 55 virtual String item(unsigned index) const OVERRIDE; | 55 virtual String item(unsigned index) const OVERRIDE FINAL; |
| 56 virtual PassRefPtr<CSSValue> getPropertyCSSValue(const String& propertyName)
OVERRIDE; | 56 virtual PassRefPtr<CSSValue> getPropertyCSSValue(const String& propertyName)
OVERRIDE FINAL; |
| 57 virtual String getPropertyValue(const String& propertyName) OVERRIDE; | 57 virtual String getPropertyValue(const String& propertyName) OVERRIDE FINAL; |
| 58 virtual String getPropertyPriority(const String& propertyName) OVERRIDE; | 58 virtual String getPropertyPriority(const String& propertyName) OVERRIDE FINA
L; |
| 59 virtual String getPropertyShorthand(const String& propertyName) OVERRIDE; | 59 virtual String getPropertyShorthand(const String& propertyName) OVERRIDE FIN
AL; |
| 60 virtual bool isPropertyImplicit(const String& propertyName) OVERRIDE; | 60 virtual bool isPropertyImplicit(const String& propertyName) OVERRIDE FINAL; |
| 61 virtual void setProperty(const String& propertyName, const String& value, co
nst String& priority, ExceptionState&) OVERRIDE; | 61 virtual void setProperty(const String& propertyName, const String& value, co
nst String& priority, ExceptionState&) OVERRIDE FINAL; |
| 62 virtual String removeProperty(const String& propertyName, ExceptionState&) O
VERRIDE; | 62 virtual String removeProperty(const String& propertyName, ExceptionState&) O
VERRIDE FINAL; |
| 63 virtual String cssText() const OVERRIDE; | 63 virtual String cssText() const OVERRIDE FINAL; |
| 64 virtual void setCSSText(const String&, ExceptionState&) OVERRIDE; | 64 virtual void setCSSText(const String&, ExceptionState&) OVERRIDE FINAL; |
| 65 virtual PassRefPtr<CSSValue> getPropertyCSSValueInternal(CSSPropertyID) OVER
RIDE; | 65 virtual PassRefPtr<CSSValue> getPropertyCSSValueInternal(CSSPropertyID) OVER
RIDE FINAL; |
| 66 virtual String getPropertyValueInternal(CSSPropertyID) OVERRIDE; | 66 virtual String getPropertyValueInternal(CSSPropertyID) OVERRIDE FINAL; |
| 67 virtual void setPropertyInternal(CSSPropertyID, const String& value, bool im
portant, ExceptionState&) OVERRIDE; | 67 virtual void setPropertyInternal(CSSPropertyID, const String& value, bool im
portant, ExceptionState&) OVERRIDE FINAL; |
| 68 | 68 |
| 69 virtual unsigned variableCount() const OVERRIDE; | 69 virtual unsigned variableCount() const OVERRIDE FINAL; |
| 70 virtual String variableValue(const AtomicString& name) const OVERRIDE; | 70 virtual String variableValue(const AtomicString& name) const OVERRIDE FINAL; |
| 71 virtual bool setVariableValue(const AtomicString& name, const String& value,
ExceptionState&) OVERRIDE; | 71 virtual bool setVariableValue(const AtomicString& name, const String& value,
ExceptionState&) OVERRIDE FINAL; |
| 72 virtual bool removeVariable(const AtomicString& name) OVERRIDE; | 72 virtual bool removeVariable(const AtomicString& name) OVERRIDE FINAL; |
| 73 virtual bool clearVariables(ExceptionState&) OVERRIDE; | 73 virtual bool clearVariables(ExceptionState&) OVERRIDE FINAL; |
| 74 | 74 |
| 75 virtual bool cssPropertyMatches(CSSPropertyID, const CSSValue*) const OVERRI
DE; | 75 virtual bool cssPropertyMatches(CSSPropertyID, const CSSValue*) const OVERRI
DE FINAL; |
| 76 virtual PassRefPtr<MutableStylePropertySet> copyProperties() const OVERRIDE; | 76 virtual PassRefPtr<MutableStylePropertySet> copyProperties() const OVERRIDE
FINAL; |
| 77 | 77 |
| 78 CSSValue* cloneAndCacheForCSSOM(CSSValue*); | 78 CSSValue* cloneAndCacheForCSSOM(CSSValue*); |
| 79 | 79 |
| 80 protected: | 80 protected: |
| 81 enum MutationType { NoChanges, PropertyChanged }; | 81 enum MutationType { NoChanges, PropertyChanged }; |
| 82 virtual void willMutate() { } | 82 virtual void willMutate() { } |
| 83 virtual void didMutate(MutationType) { } | 83 virtual void didMutate(MutationType) { } |
| 84 virtual MutableStylePropertySet* propertySet() const = 0; | 84 virtual MutableStylePropertySet* propertySet() const = 0; |
| 85 | 85 |
| 86 OwnPtr<HashMap<CSSValue*, RefPtr<CSSValue> > > m_cssomCSSValueClones; | 86 OwnPtr<HashMap<CSSValue*, RefPtr<CSSValue> > > m_cssomCSSValueClones; |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 class PropertySetCSSStyleDeclaration : public AbstractPropertySetCSSStyleDeclara
tion { | 89 class PropertySetCSSStyleDeclaration : public AbstractPropertySetCSSStyleDeclara
tion { |
| 90 public: | 90 public: |
| 91 PropertySetCSSStyleDeclaration(MutableStylePropertySet* propertySet) : m_pro
pertySet(propertySet) { } | 91 PropertySetCSSStyleDeclaration(MutableStylePropertySet* propertySet) : m_pro
pertySet(propertySet) { } |
| 92 | 92 |
| 93 virtual void ref() OVERRIDE; | 93 virtual void ref() OVERRIDE; |
| 94 virtual void deref() OVERRIDE; | 94 virtual void deref() OVERRIDE; |
| 95 | 95 |
| 96 protected: | 96 protected: |
| 97 virtual MutableStylePropertySet* propertySet() const { return m_propertySet;
}; | 97 virtual MutableStylePropertySet* propertySet() const OVERRIDE FINAL { return
m_propertySet; } |
| 98 | 98 |
| 99 MutableStylePropertySet* m_propertySet; | 99 MutableStylePropertySet* m_propertySet; |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 class StyleRuleCSSStyleDeclaration : public PropertySetCSSStyleDeclaration | 102 class StyleRuleCSSStyleDeclaration FINAL : public PropertySetCSSStyleDeclaration |
| 103 { | 103 { |
| 104 public: | 104 public: |
| 105 static PassRefPtr<StyleRuleCSSStyleDeclaration> create(MutableStylePropertyS
et* propertySet, CSSRule* parentRule) | 105 static PassRefPtr<StyleRuleCSSStyleDeclaration> create(MutableStylePropertyS
et* propertySet, CSSRule* parentRule) |
| 106 { | 106 { |
| 107 return adoptRef(new StyleRuleCSSStyleDeclaration(propertySet, parentRule
)); | 107 return adoptRef(new StyleRuleCSSStyleDeclaration(propertySet, parentRule
)); |
| 108 } | 108 } |
| 109 | 109 |
| 110 void clearParentRule() { m_parentRule = 0; } | 110 void clearParentRule() { m_parentRule = 0; } |
| 111 | 111 |
| 112 virtual void ref() OVERRIDE; | 112 virtual void ref() OVERRIDE; |
| 113 virtual void deref() OVERRIDE; | 113 virtual void deref() OVERRIDE; |
| 114 | 114 |
| 115 void reattach(MutableStylePropertySet*); | 115 void reattach(MutableStylePropertySet*); |
| 116 | 116 |
| 117 private: | 117 private: |
| 118 StyleRuleCSSStyleDeclaration(MutableStylePropertySet*, CSSRule*); | 118 StyleRuleCSSStyleDeclaration(MutableStylePropertySet*, CSSRule*); |
| 119 virtual ~StyleRuleCSSStyleDeclaration(); | 119 virtual ~StyleRuleCSSStyleDeclaration(); |
| 120 | 120 |
| 121 virtual CSSStyleSheet* parentStyleSheet() const OVERRIDE; | 121 virtual CSSStyleSheet* parentStyleSheet() const OVERRIDE; |
| 122 | 122 |
| 123 virtual CSSRule* parentRule() const OVERRIDE { return m_parentRule; } | 123 virtual CSSRule* parentRule() const OVERRIDE { return m_parentRule; } |
| 124 | 124 |
| 125 virtual void willMutate() OVERRIDE; | 125 virtual void willMutate() OVERRIDE; |
| 126 virtual void didMutate(MutationType) OVERRIDE; | 126 virtual void didMutate(MutationType) OVERRIDE; |
| 127 | 127 |
| 128 unsigned m_refCount; | 128 unsigned m_refCount; |
| 129 CSSRule* m_parentRule; | 129 CSSRule* m_parentRule; |
| 130 }; | 130 }; |
| 131 | 131 |
| 132 class InlineCSSStyleDeclaration : public AbstractPropertySetCSSStyleDeclaration | 132 class InlineCSSStyleDeclaration FINAL : public AbstractPropertySetCSSStyleDeclar
ation |
| 133 { | 133 { |
| 134 public: | 134 public: |
| 135 explicit InlineCSSStyleDeclaration(Element* parentElement) | 135 explicit InlineCSSStyleDeclaration(Element* parentElement) |
| 136 : m_parentElement(parentElement) | 136 : m_parentElement(parentElement) |
| 137 { | 137 { |
| 138 } | 138 } |
| 139 | 139 |
| 140 private: | 140 private: |
| 141 virtual PassRefPtr<CSSVariablesIterator> variablesIterator() const OVERRIDE; | 141 virtual PassRefPtr<CSSVariablesIterator> variablesIterator() const OVERRIDE; |
| 142 virtual MutableStylePropertySet* propertySet() const OVERRIDE; | 142 virtual MutableStylePropertySet* propertySet() const OVERRIDE; |
| 143 virtual void ref() OVERRIDE; | 143 virtual void ref() OVERRIDE; |
| 144 virtual void deref() OVERRIDE; | 144 virtual void deref() OVERRIDE; |
| 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 virtual void clearParentElement() OVERRIDE { m_parentElement = 0; } | 147 virtual void clearParentElement() OVERRIDE { m_parentElement = 0; } |
| 148 | 148 |
| 149 virtual void didMutate(MutationType) OVERRIDE; | 149 virtual void didMutate(MutationType) OVERRIDE; |
| 150 | 150 |
| 151 Element* m_parentElement; | 151 Element* m_parentElement; |
| 152 }; | 152 }; |
| 153 | 153 |
| 154 } // namespace WebCore | 154 } // namespace WebCore |
| 155 | 155 |
| 156 #endif | 156 #endif |
| OLD | NEW |