2 * Copyright (C) 2004 Zack Rusin <zack@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 #ifndef CSSComputedStyleDeclaration_h
22 #define CSSComputedStyleDeclaration_h
24 #include "CSSStyleDeclaration.h"
29 class CSSMutableStyleDeclaration
;
31 enum EUpdateLayout
{ DoNotUpdateLayout
= false, UpdateLayout
= true };
33 class CSSComputedStyleDeclaration
: public CSSStyleDeclaration
{
35 friend PassRefPtr
<CSSComputedStyleDeclaration
> computedStyle(PassRefPtr
<Node
>);
36 virtual ~CSSComputedStyleDeclaration();
38 virtual String
cssText() const;
40 virtual unsigned length() const;
41 virtual String
item(unsigned index
) const;
43 virtual PassRefPtr
<CSSValue
> getPropertyCSSValue(int propertyID
) const;
44 virtual String
getPropertyValue(int propertyID
) const;
45 virtual bool getPropertyPriority(int propertyID
) const;
46 virtual int getPropertyShorthand(int /*propertyID*/) const { return -1; }
47 virtual bool isPropertyImplicit(int /*propertyID*/) const { return false; }
49 virtual PassRefPtr
<CSSMutableStyleDeclaration
> copy() const;
50 virtual PassRefPtr
<CSSMutableStyleDeclaration
> makeMutable();
52 PassRefPtr
<CSSValue
> getPropertyCSSValue(int propertyID
, EUpdateLayout
) const;
54 PassRefPtr
<CSSValue
> getSVGPropertyCSSValue(int propertyID
, EUpdateLayout
) const;
57 PassRefPtr
<CSSMutableStyleDeclaration
> copyInheritableProperties() const;
59 static void removeComputedInheritablePropertiesFrom(CSSMutableStyleDeclaration
*);
62 CSSComputedStyleDeclaration(PassRefPtr
<Node
>);
64 virtual void setCssText(const String
&, ExceptionCode
&);
66 virtual String
removeProperty(int propertyID
, ExceptionCode
&);
67 virtual void setProperty(int propertyId
, const String
& value
, bool important
, ExceptionCode
&);
72 inline PassRefPtr
<CSSComputedStyleDeclaration
> computedStyle(PassRefPtr
<Node
> node
)
74 return adoptRef(new CSSComputedStyleDeclaration(node
));
77 } // namespace WebCore
79 #endif // CSSComputedStyleDeclaration_h