diff options
Diffstat (limited to 'Source/WebCore/css/CSSStyleDeclaration.h')
-rw-r--r-- | Source/WebCore/css/CSSStyleDeclaration.h | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/Source/WebCore/css/CSSStyleDeclaration.h b/Source/WebCore/css/CSSStyleDeclaration.h index ad3d8d584..e4e303859 100644 --- a/Source/WebCore/css/CSSStyleDeclaration.h +++ b/Source/WebCore/css/CSSStyleDeclaration.h @@ -18,10 +18,11 @@ * Boston, MA 02110-1301, USA. */ -#ifndef CSSStyleDeclaration_h -#define CSSStyleDeclaration_h +#pragma once #include "CSSPropertyNames.h" +#include "DeprecatedCSSOMValue.h" +#include "ExceptionOr.h" #include "ScriptWrappable.h" #include <wtf/Forward.h> @@ -35,8 +36,6 @@ class MutableStyleProperties; class StyleProperties; class StyledElement; -typedef int ExceptionCode; - class CSSStyleDeclaration : public ScriptWrappable { WTF_MAKE_NONCOPYABLE(CSSStyleDeclaration); WTF_MAKE_FAST_ALLOCATED; public: @@ -45,34 +44,33 @@ public: virtual void ref() = 0; virtual void deref() = 0; + virtual StyledElement* parentElement() const { return nullptr; } virtual CSSRule* parentRule() const = 0; virtual String cssText() const = 0; - virtual void setCssText(const String&, ExceptionCode&) = 0; + virtual ExceptionOr<void> setCssText(const String&) = 0; virtual unsigned length() const = 0; virtual String item(unsigned index) const = 0; - virtual PassRefPtr<CSSValue> getPropertyCSSValue(const String& propertyName) = 0; + virtual RefPtr<DeprecatedCSSOMValue> getPropertyCSSValue(const String& propertyName) = 0; virtual String getPropertyValue(const String& propertyName) = 0; virtual String getPropertyPriority(const String& propertyName) = 0; virtual String getPropertyShorthand(const String& propertyName) = 0; virtual bool isPropertyImplicit(const String& propertyName) = 0; - virtual void setProperty(const String& propertyName, const String& value, const String& priority, ExceptionCode&) = 0; - virtual String removeProperty(const String& propertyName, ExceptionCode&) = 0; + virtual ExceptionOr<void> setProperty(const String& propertyName, const String& value, const String& priority) = 0; + virtual ExceptionOr<String> removeProperty(const String& propertyName) = 0; // CSSPropertyID versions of the CSSOM functions to support bindings and editing. // Use the non-virtual methods in the concrete subclasses when possible. // The CSSValue returned by this function should not be exposed to the web as it may be used by multiple documents at the same time. - virtual PassRefPtr<CSSValue> getPropertyCSSValueInternal(CSSPropertyID) = 0; + virtual RefPtr<CSSValue> getPropertyCSSValueInternal(CSSPropertyID) = 0; virtual String getPropertyValueInternal(CSSPropertyID) = 0; - virtual void setPropertyInternal(CSSPropertyID, const String& value, bool important, ExceptionCode&) = 0; + virtual ExceptionOr<bool> setPropertyInternal(CSSPropertyID, const String& value, bool important) = 0; - virtual PassRef<MutableStyleProperties> copyProperties() const = 0; + virtual Ref<MutableStyleProperties> copyProperties() const = 0; - virtual CSSStyleSheet* parentStyleSheet() const { return 0; } + virtual CSSStyleSheet* parentStyleSheet() const { return nullptr; } protected: CSSStyleDeclaration() { } }; } // namespace WebCore - -#endif // CSSStyleDeclaration_h |