2
* Copyright (C) 2004 Zack Rusin <zack@kde.org>
3
* Copyright (C) 2004, 2005, 2006, 2008, 2012 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"
25
#include "RenderStyleConstants.h"
26
#include <wtf/RefPtr.h>
27
#include <wtf/text/WTFString.h>
31
class CSSPrimitiveValue;
39
class StylePropertySet;
40
class StylePropertyShorthand;
42
#if ENABLE(CSS_SHADERS)
43
class CustomFilterNumberParameter;
44
class CustomFilterParameter;
47
enum EUpdateLayout { DoNotUpdateLayout = false, UpdateLayout = true };
49
class CSSComputedStyleDeclaration : public CSSStyleDeclaration {
51
static PassRefPtr<CSSComputedStyleDeclaration> create(PassRefPtr<Node> node, bool allowVisitedStyle = false, const String& pseudoElementName = String())
53
return adoptRef(new CSSComputedStyleDeclaration(node, allowVisitedStyle, pseudoElementName));
55
virtual ~CSSComputedStyleDeclaration();
57
virtual void ref() OVERRIDE;
58
virtual void deref() OVERRIDE;
60
PassRefPtr<CSSValue> getPropertyCSSValue(CSSPropertyID) const;
61
String getPropertyValue(CSSPropertyID) const;
62
bool getPropertyPriority(CSSPropertyID) const;
64
virtual PassRefPtr<StylePropertySet> copy() const;
65
virtual PassRefPtr<StylePropertySet> makeMutable();
67
PassRefPtr<CSSValue> getPropertyCSSValue(CSSPropertyID, EUpdateLayout) const;
68
PassRefPtr<CSSValue> getFontSizeCSSValuePreferringKeyword() const;
69
bool useFixedFontDefaultSize() const;
71
PassRefPtr<CSSValue> getSVGPropertyCSSValue(CSSPropertyID, EUpdateLayout) const;
74
PassRefPtr<StylePropertySet> copyPropertiesInSet(const CSSPropertyID* set, unsigned length) const;
76
virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE;
79
CSSComputedStyleDeclaration(PassRefPtr<Node>, bool allowVisitedStyle, const String&);
81
// CSSOM functions. Don't make these public.
82
virtual CSSRule* parentRule() const;
83
virtual unsigned length() const;
84
virtual String item(unsigned index) const;
85
virtual PassRefPtr<CSSValue> getPropertyCSSValue(const String& propertyName);
86
virtual String getPropertyValue(const String& propertyName);
87
virtual String getPropertyPriority(const String& propertyName);
88
virtual String getPropertyShorthand(const String& propertyName);
89
virtual bool isPropertyImplicit(const String& propertyName);
90
virtual void setProperty(const String& propertyName, const String& value, const String& priority, ExceptionCode&);
91
virtual String removeProperty(const String& propertyName, ExceptionCode&);
92
virtual String cssText() const;
93
virtual void setCssText(const String&, ExceptionCode&);
94
virtual PassRefPtr<CSSValue> getPropertyCSSValueInternal(CSSPropertyID);
95
virtual String getPropertyValueInternal(CSSPropertyID);
96
virtual void setPropertyInternal(CSSPropertyID, const String& value, bool important, ExceptionCode&);
98
virtual bool cssPropertyMatches(const StylePropertySet::PropertyReference&) const OVERRIDE;
100
PassRefPtr<CSSValue> valueForShadow(const ShadowData*, CSSPropertyID, const RenderStyle*) const;
101
PassRefPtr<CSSPrimitiveValue> currentColorOrValidColor(RenderStyle*, const Color&) const;
103
PassRefPtr<SVGPaint> adjustSVGPaintForCurrentColor(PassRefPtr<SVGPaint>, RenderStyle*) const;
106
#if ENABLE(CSS_FILTERS)
107
PassRefPtr<CSSValue> valueForFilter(const RenderObject*, const RenderStyle*) const;
110
PassRefPtr<CSSValueList> getCSSPropertyValuesForShorthandProperties(const StylePropertyShorthand&) const;
111
PassRefPtr<CSSValueList> getCSSPropertyValuesForSidesShorthand(const StylePropertyShorthand&) const;
112
PassRefPtr<CSSValueList> getBackgroundShorthandValue() const;
115
PseudoId m_pseudoElementSpecifier;
116
bool m_allowVisitedStyle;
120
} // namespace WebCore
122
#endif // CSSComputedStyleDeclaration_h