diff options
Diffstat (limited to 'Source/WebCore/css/CSSStyleDeclaration.h')
-rw-r--r-- | Source/WebCore/css/CSSStyleDeclaration.h | 42 |
1 files changed, 8 insertions, 34 deletions
diff --git a/Source/WebCore/css/CSSStyleDeclaration.h b/Source/WebCore/css/CSSStyleDeclaration.h index 12910da46..e5e7cb957 100644 --- a/Source/WebCore/css/CSSStyleDeclaration.h +++ b/Source/WebCore/css/CSSStyleDeclaration.h @@ -1,6 +1,6 @@ /* * (C) 1999-2003 Lars Knoll (knoll@kde.org) - * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. + * Copyright (C) 2004, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -27,10 +27,10 @@ namespace WebCore { -class CSSMutableStyleDeclaration; class CSSProperty; class CSSStyleSheet; class CSSValue; +class StylePropertySet; class StyledElement; typedef int ExceptionCode; @@ -40,16 +40,7 @@ class CSSStyleDeclaration : public RefCounted<CSSStyleDeclaration> { public: virtual ~CSSStyleDeclaration() { } - static bool isPropertyName(const String&); - - CSSRule* parentRule() const { return m_isInlineStyleDeclaration ? 0 : m_parent.rule; } - void clearParentRule() { ASSERT(!m_isInlineStyleDeclaration); m_parent.rule = 0; } - - StyledElement* parentElement() const { ASSERT(m_isInlineStyleDeclaration); return m_parent.element; } - void clearParentElement() { ASSERT(m_isInlineStyleDeclaration); m_parent.element = 0; } - - CSSStyleSheet* parentStyleSheet() const; - + virtual CSSRule* parentRule() const = 0; virtual String cssText() const = 0; virtual void setCssText(const String&, ExceptionCode&) = 0; virtual unsigned length() const = 0; @@ -68,35 +59,18 @@ public: virtual String getPropertyValueInternal(CSSPropertyID) = 0; virtual void setPropertyInternal(CSSPropertyID, const String& value, bool important, ExceptionCode&) = 0; - virtual PassRefPtr<CSSMutableStyleDeclaration> copy() const = 0; - virtual PassRefPtr<CSSMutableStyleDeclaration> makeMutable() = 0; + virtual PassRefPtr<StylePropertySet> copy() const = 0; + virtual PassRefPtr<StylePropertySet> makeMutable() = 0; virtual bool cssPropertyMatches(const CSSProperty*) const = 0; - + virtual CSSStyleSheet* parentStyleSheet() const { return 0; } + #ifndef NDEBUG void showStyle(); #endif - bool isInlineStyleDeclaration() const { return m_isInlineStyleDeclaration; } - protected: - CSSStyleDeclaration(CSSRule* parentRule = 0); - CSSStyleDeclaration(StyledElement* parentElement); - - // The bits in this section are only used by specific subclasses but kept here - // to maximize struct packing. - - // CSSMutableStyleDeclaration bits: - bool m_strictParsing : 1; - bool m_isInlineStyleDeclaration : 1; - -private: - union Parent { - Parent(CSSRule* rule) : rule(rule) { } - Parent(StyledElement* element) : element(element) { } - CSSRule* rule; - StyledElement* element; - } m_parent; + CSSStyleDeclaration() { } }; } // namespace WebCore |