Apply a zoom property when resolution is changed
[framework/web/webkit-efl.git] / Source / WebCore / css / CSSComputedStyleDeclaration.h
1 /*
2  * Copyright (C) 2004 Zack Rusin <zack@kde.org>
3  * Copyright (C) 2004, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved.
4  *
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.
9  *
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.
14  *
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
18  * 02110-1301  USA
19  */
20
21 #ifndef CSSComputedStyleDeclaration_h
22 #define CSSComputedStyleDeclaration_h
23
24 #include "CSSStyleDeclaration.h"
25 #include "RenderStyleConstants.h"
26 #include <wtf/RefPtr.h>
27 #include <wtf/text/WTFString.h>
28
29 namespace WebCore {
30
31 class CSSPrimitiveValue;
32 class CSSValueList;
33 class Color;
34 class Node;
35 class RenderStyle;
36 class SVGPaint;
37 class ShadowData;
38 class StylePropertySet;
39 class StylePropertyShorthand;
40
41 #if ENABLE(CSS_SHADERS)
42 class CustomFilterNumberParameter;
43 class CustomFilterParameter;
44 #endif
45
46 enum EUpdateLayout { DoNotUpdateLayout = false, UpdateLayout = true };
47
48 class CSSComputedStyleDeclaration : public CSSStyleDeclaration {
49 public:
50     static PassRefPtr<CSSComputedStyleDeclaration> create(PassRefPtr<Node> node, bool allowVisitedStyle = false, const String& pseudoElementName = String())
51     {
52         return adoptRef(new CSSComputedStyleDeclaration(node, allowVisitedStyle, pseudoElementName));
53     }
54     virtual ~CSSComputedStyleDeclaration();
55
56     virtual void ref() OVERRIDE;
57     virtual void deref() OVERRIDE;
58
59     PassRefPtr<CSSValue> getPropertyCSSValue(CSSPropertyID) const;
60     String getPropertyValue(CSSPropertyID) const;
61     bool getPropertyPriority(CSSPropertyID) const;
62
63     virtual PassRefPtr<StylePropertySet> copy() const;
64     virtual PassRefPtr<StylePropertySet> makeMutable();
65
66     PassRefPtr<CSSValue> getPropertyCSSValue(CSSPropertyID, EUpdateLayout) const;
67     PassRefPtr<CSSValue> getFontSizeCSSValuePreferringKeyword() const;
68     bool useFixedFontDefaultSize() const;
69 #if ENABLE(SVG)
70     PassRefPtr<CSSValue> getSVGPropertyCSSValue(CSSPropertyID, EUpdateLayout) const;
71 #endif
72
73     PassRefPtr<StylePropertySet> copyPropertiesInSet(const CSSPropertyID* set, unsigned length) const;
74
75 private:
76     CSSComputedStyleDeclaration(PassRefPtr<Node>, bool allowVisitedStyle, const String&);
77
78     // CSSOM functions. Don't make these public.
79     virtual CSSRule* parentRule() const;
80     virtual unsigned length() const;
81     virtual String item(unsigned index) const;
82     virtual PassRefPtr<CSSValue> getPropertyCSSValue(const String& propertyName);
83     virtual String getPropertyValue(const String& propertyName);
84     virtual String getPropertyPriority(const String& propertyName);
85     virtual String getPropertyShorthand(const String& propertyName);
86     virtual bool isPropertyImplicit(const String& propertyName);
87     virtual void setProperty(const String& propertyName, const String& value, const String& priority, ExceptionCode&);
88     virtual String removeProperty(const String& propertyName, ExceptionCode&);
89     virtual String cssText() const;
90     virtual void setCssText(const String&, ExceptionCode&);
91     virtual PassRefPtr<CSSValue> getPropertyCSSValueInternal(CSSPropertyID);
92     virtual String getPropertyValueInternal(CSSPropertyID);
93     virtual void setPropertyInternal(CSSPropertyID, const String& value, bool important, ExceptionCode&);
94
95     virtual bool cssPropertyMatches(const CSSProperty*) const;
96
97     PassRefPtr<CSSValue> valueForShadow(const ShadowData*, CSSPropertyID, RenderStyle*) const;
98     PassRefPtr<CSSPrimitiveValue> currentColorOrValidColor(RenderStyle*, const Color&) const;
99 #if ENABLE(SVG)
100     PassRefPtr<SVGPaint> adjustSVGPaintForCurrentColor(PassRefPtr<SVGPaint>, RenderStyle*) const;
101 #endif
102
103 #if ENABLE(CSS_SHADERS)
104     PassRefPtr<CSSValue> valueForCustomFilterNumberParameter(const CustomFilterNumberParameter*) const;
105     PassRefPtr<CSSValue> valueForCustomFilterParameter(const CustomFilterParameter*) const;
106 #endif
107
108 #if ENABLE(CSS_FILTERS)
109     PassRefPtr<CSSValue> valueForFilter(RenderStyle*) const;
110 #endif
111
112     PassRefPtr<CSSValueList> getCSSPropertyValuesForShorthandProperties(const StylePropertyShorthand&) const;
113     PassRefPtr<CSSValueList> getCSSPropertyValuesForSidesShorthand(const StylePropertyShorthand&) const;
114     PassRefPtr<CSSValueList> getBackgroundShorthandValue() const;
115
116     RefPtr<Node> m_node;
117     PseudoId m_pseudoElementSpecifier;
118     bool m_allowVisitedStyle;
119     unsigned m_refCount;
120 };
121
122 } // namespace WebCore
123
124 #endif // CSSComputedStyleDeclaration_h