~ubuntu-branches/ubuntu/raring/qtwebkit-source/raring-proposed

« back to all changes in this revision

Viewing changes to Source/WebCore/css/CSSComputedStyleDeclaration.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-02-18 14:24:18 UTC
  • Revision ID: package-import@ubuntu.com-20130218142418-eon0jmjg3nj438uy
Tags: upstream-2.3
ImportĀ upstreamĀ versionĀ 2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 RenderObject;
 
36
class RenderStyle;
 
37
class SVGPaint;
 
38
class ShadowData;
 
39
class StylePropertySet;
 
40
class StylePropertyShorthand;
 
41
 
 
42
#if ENABLE(CSS_SHADERS)
 
43
class CustomFilterNumberParameter;
 
44
class CustomFilterParameter;
 
45
#endif
 
46
 
 
47
enum EUpdateLayout { DoNotUpdateLayout = false, UpdateLayout = true };
 
48
 
 
49
class CSSComputedStyleDeclaration : public CSSStyleDeclaration {
 
50
public:
 
51
    static PassRefPtr<CSSComputedStyleDeclaration> create(PassRefPtr<Node> node, bool allowVisitedStyle = false, const String& pseudoElementName = String())
 
52
    {
 
53
        return adoptRef(new CSSComputedStyleDeclaration(node, allowVisitedStyle, pseudoElementName));
 
54
    }
 
55
    virtual ~CSSComputedStyleDeclaration();
 
56
 
 
57
    virtual void ref() OVERRIDE;
 
58
    virtual void deref() OVERRIDE;
 
59
 
 
60
    PassRefPtr<CSSValue> getPropertyCSSValue(CSSPropertyID) const;
 
61
    String getPropertyValue(CSSPropertyID) const;
 
62
    bool getPropertyPriority(CSSPropertyID) const;
 
63
 
 
64
    virtual PassRefPtr<StylePropertySet> copy() const;
 
65
    virtual PassRefPtr<StylePropertySet> makeMutable();
 
66
 
 
67
    PassRefPtr<CSSValue> getPropertyCSSValue(CSSPropertyID, EUpdateLayout) const;
 
68
    PassRefPtr<CSSValue> getFontSizeCSSValuePreferringKeyword() const;
 
69
    bool useFixedFontDefaultSize() const;
 
70
#if ENABLE(SVG)
 
71
    PassRefPtr<CSSValue> getSVGPropertyCSSValue(CSSPropertyID, EUpdateLayout) const;
 
72
#endif
 
73
 
 
74
    PassRefPtr<StylePropertySet> copyPropertiesInSet(const CSSPropertyID* set, unsigned length) const;
 
75
 
 
76
    virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE;
 
77
 
 
78
private:
 
79
    CSSComputedStyleDeclaration(PassRefPtr<Node>, bool allowVisitedStyle, const String&);
 
80
 
 
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&);
 
97
 
 
98
    virtual bool cssPropertyMatches(const StylePropertySet::PropertyReference&) const OVERRIDE;
 
99
 
 
100
    PassRefPtr<CSSValue> valueForShadow(const ShadowData*, CSSPropertyID, const RenderStyle*) const;
 
101
    PassRefPtr<CSSPrimitiveValue> currentColorOrValidColor(RenderStyle*, const Color&) const;
 
102
#if ENABLE(SVG)
 
103
    PassRefPtr<SVGPaint> adjustSVGPaintForCurrentColor(PassRefPtr<SVGPaint>, RenderStyle*) const;
 
104
#endif
 
105
 
 
106
#if ENABLE(CSS_FILTERS)
 
107
    PassRefPtr<CSSValue> valueForFilter(const RenderObject*, const RenderStyle*) const;
 
108
#endif
 
109
 
 
110
    PassRefPtr<CSSValueList> getCSSPropertyValuesForShorthandProperties(const StylePropertyShorthand&) const;
 
111
    PassRefPtr<CSSValueList> getCSSPropertyValuesForSidesShorthand(const StylePropertyShorthand&) const;
 
112
    PassRefPtr<CSSValueList> getBackgroundShorthandValue() const;
 
113
 
 
114
    RefPtr<Node> m_node;
 
115
    PseudoId m_pseudoElementSpecifier;
 
116
    bool m_allowVisitedStyle;
 
117
    unsigned m_refCount;
 
118
};
 
119
 
 
120
} // namespace WebCore
 
121
 
 
122
#endif // CSSComputedStyleDeclaration_h