OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004 Zack Rusin <zack@kde.org> | 2 * Copyright (C) 2004 Zack Rusin <zack@kde.org> |
3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Lesser General Public | 6 * modify it under the terms of the GNU Lesser General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 * Lesser General Public License for more details. | 13 * Lesser General Public License for more details. |
14 * | 14 * |
15 * You should have received a copy of the GNU Lesser General Public | 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 | 16 * License along with this library; if not, write to the Free Software |
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | 17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
18 * 02110-1301 USA | 18 * 02110-1301 USA |
19 */ | 19 */ |
20 | 20 |
21 #ifndef CSSComputedStyleDeclaration_h | 21 #ifndef CSSComputedStyleDeclaration_h |
22 #define CSSComputedStyleDeclaration_h | 22 #define CSSComputedStyleDeclaration_h |
23 | 23 |
24 #include "CSSStyleDeclaration.h" | 24 #include "CSSStyleDeclaration.h" |
| 25 #include "PlatformString.h" |
25 #include "RenderStyleConstants.h" | 26 #include "RenderStyleConstants.h" |
26 #include <wtf/RefPtr.h> | 27 #include <wtf/RefPtr.h> |
27 #include <wtf/text/WTFString.h> | |
28 | 28 |
29 namespace WebCore { | 29 namespace WebCore { |
30 | 30 |
31 class Color; | 31 class Color; |
32 class CSSMutableStyleDeclaration; | 32 class CSSMutableStyleDeclaration; |
33 class CSSPrimitiveValue; | 33 class CSSPrimitiveValue; |
34 class Node; | 34 class Node; |
35 class RenderStyle; | 35 class RenderStyle; |
36 class ShadowData; | 36 class ShadowData; |
37 class SVGPaint; | |
38 | 37 |
39 enum EUpdateLayout { DoNotUpdateLayout = false, UpdateLayout = true }; | 38 enum EUpdateLayout { DoNotUpdateLayout = false, UpdateLayout = true }; |
40 | 39 |
41 class CSSComputedStyleDeclaration : public CSSStyleDeclaration { | 40 class CSSComputedStyleDeclaration : public CSSStyleDeclaration { |
42 public: | 41 public: |
43 friend PassRefPtr<CSSComputedStyleDeclaration> computedStyle(PassRefPtr<Node
>, bool allowVisitedStyle, const String& pseudoElementName); | 42 friend PassRefPtr<CSSComputedStyleDeclaration> computedStyle(PassRefPtr<Node
>, bool allowVisitedStyle, const String& pseudoElementName); |
44 virtual ~CSSComputedStyleDeclaration(); | 43 virtual ~CSSComputedStyleDeclaration(); |
45 | 44 |
46 virtual String cssText() const; | 45 virtual String cssText() const; |
47 | 46 |
(...skipping 22 matching lines...) Expand all Loading... |
70 private: | 69 private: |
71 CSSComputedStyleDeclaration(PassRefPtr<Node>, bool allowVisitedStyle, const
String&); | 70 CSSComputedStyleDeclaration(PassRefPtr<Node>, bool allowVisitedStyle, const
String&); |
72 | 71 |
73 virtual void setCssText(const String&, ExceptionCode&); | 72 virtual void setCssText(const String&, ExceptionCode&); |
74 | 73 |
75 virtual String removeProperty(int propertyID, ExceptionCode&); | 74 virtual String removeProperty(int propertyID, ExceptionCode&); |
76 virtual void setProperty(int propertyId, const String& value, bool important
, ExceptionCode&); | 75 virtual void setProperty(int propertyId, const String& value, bool important
, ExceptionCode&); |
77 | 76 |
78 PassRefPtr<CSSValue> valueForShadow(const ShadowData*, int, RenderStyle*) co
nst; | 77 PassRefPtr<CSSValue> valueForShadow(const ShadowData*, int, RenderStyle*) co
nst; |
79 PassRefPtr<CSSPrimitiveValue> currentColorOrValidColor(RenderStyle*, const C
olor&) const; | 78 PassRefPtr<CSSPrimitiveValue> currentColorOrValidColor(RenderStyle*, const C
olor&) const; |
80 #if ENABLE(SVG) | 79 |
81 PassRefPtr<SVGPaint> adjustSVGPaintForCurrentColor(PassRefPtr<SVGPaint>, Ren
derStyle*) const; | |
82 #endif | |
83 | |
84 RefPtr<Node> m_node; | 80 RefPtr<Node> m_node; |
85 PseudoId m_pseudoElementSpecifier; | 81 PseudoId m_pseudoElementSpecifier; |
86 bool m_allowVisitedStyle; | 82 bool m_allowVisitedStyle; |
87 }; | 83 }; |
88 | 84 |
89 inline PassRefPtr<CSSComputedStyleDeclaration> computedStyle(PassRefPtr<Node> no
de, bool allowVisitedStyle = false, const String& pseudoElementName = String()) | 85 inline PassRefPtr<CSSComputedStyleDeclaration> computedStyle(PassRefPtr<Node> no
de, bool allowVisitedStyle = false, const String& pseudoElementName = String()) |
90 { | 86 { |
91 return adoptRef(new CSSComputedStyleDeclaration(node, allowVisitedStyle, pse
udoElementName)); | 87 return adoptRef(new CSSComputedStyleDeclaration(node, allowVisitedStyle, pse
udoElementName)); |
92 } | 88 } |
93 | 89 |
94 } // namespace WebCore | 90 } // namespace WebCore |
95 | 91 |
96 #endif // CSSComputedStyleDeclaration_h | 92 #endif // CSSComputedStyleDeclaration_h |
OLD | NEW |