OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 10 matching lines...) Expand all Loading... |
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #ifndef CSSGradientValue_h | 26 #ifndef CSSGradientValue_h |
27 #define CSSGradientValue_h | 27 #define CSSGradientValue_h |
28 | 28 |
29 #include "core/css/CSSImageGeneratorValue.h" | 29 #include "core/css/CSSImageGeneratorValue.h" |
30 #include "core/css/CSSPrimitiveValue.h" | 30 #include "core/css/CSSPrimitiveValue.h" |
| 31 #include "core/css/StyleColor.h" |
31 #include "wtf/RefPtr.h" | 32 #include "wtf/RefPtr.h" |
32 #include "wtf/Vector.h" | 33 #include "wtf/Vector.h" |
33 | 34 |
34 namespace WebCore { | 35 namespace WebCore { |
35 | 36 |
36 class FloatPoint; | 37 class FloatPoint; |
37 class Gradient; | 38 class Gradient; |
38 class TextLinkColors; | 39 class TextLinkColors; |
39 | 40 |
40 enum CSSGradientType { | 41 enum CSSGradientType { |
41 CSSDeprecatedLinearGradient, | 42 CSSDeprecatedLinearGradient, |
42 CSSDeprecatedRadialGradient, | 43 CSSDeprecatedRadialGradient, |
43 CSSPrefixedLinearGradient, | 44 CSSPrefixedLinearGradient, |
44 CSSPrefixedRadialGradient, | 45 CSSPrefixedRadialGradient, |
45 CSSLinearGradient, | 46 CSSLinearGradient, |
46 CSSRadialGradient | 47 CSSRadialGradient |
47 }; | 48 }; |
48 enum CSSGradientRepeat { NonRepeating, Repeating }; | 49 enum CSSGradientRepeat { NonRepeating, Repeating }; |
49 | 50 |
50 struct CSSGradientColorStop { | 51 struct CSSGradientColorStop { |
51 CSSGradientColorStop() : m_colorIsDerivedFromElement(false) { }; | 52 CSSGradientColorStop() : m_colorIsDerivedFromElement(false) { }; |
52 RefPtr<CSSPrimitiveValue> m_position; // percentage or length | 53 RefPtr<CSSPrimitiveValue> m_position; // percentage or length |
53 RefPtr<CSSPrimitiveValue> m_color; | 54 RefPtr<CSSPrimitiveValue> m_color; |
54 Color m_resolvedColor; | 55 StyleColor m_resolvedColor; |
55 bool m_colorIsDerivedFromElement; | 56 bool m_colorIsDerivedFromElement; |
56 bool operator==(const CSSGradientColorStop& other) const | 57 bool operator==(const CSSGradientColorStop& other) const |
57 { | 58 { |
58 return compareCSSValuePtr(m_color, other.m_color) | 59 return compareCSSValuePtr(m_color, other.m_color) |
59 && compareCSSValuePtr(m_position, other.m_position); | 60 && compareCSSValuePtr(m_position, other.m_position); |
60 } | 61 } |
61 }; | 62 }; |
62 | 63 |
63 class CSSGradientValue : public CSSImageGeneratorValue { | 64 class CSSGradientValue : public CSSImageGeneratorValue { |
64 public: | 65 public: |
(...skipping 17 matching lines...) Expand all Loading... |
82 | 83 |
83 CSSGradientType gradientType() const { return m_gradientType; } | 84 CSSGradientType gradientType() const { return m_gradientType; } |
84 | 85 |
85 bool isFixedSize() const { return false; } | 86 bool isFixedSize() const { return false; } |
86 IntSize fixedSize(const RenderObject*) const { return IntSize(); } | 87 IntSize fixedSize(const RenderObject*) const { return IntSize(); } |
87 | 88 |
88 bool isPending() const { return false; } | 89 bool isPending() const { return false; } |
89 bool knownToBeOpaque(const RenderObject*) const; | 90 bool knownToBeOpaque(const RenderObject*) const; |
90 | 91 |
91 void loadSubimages(CachedResourceLoader*) { } | 92 void loadSubimages(CachedResourceLoader*) { } |
92 PassRefPtr<CSSGradientValue> gradientWithStylesResolved(const TextLinkColors
&, Color currentColor); | 93 PassRefPtr<CSSGradientValue> gradientWithStylesResolved(const TextLinkColors
&); |
93 | 94 |
94 protected: | 95 protected: |
95 CSSGradientValue(ClassType classType, CSSGradientRepeat repeat, CSSGradientT
ype gradientType) | 96 CSSGradientValue(ClassType classType, CSSGradientRepeat repeat, CSSGradientT
ype gradientType) |
96 : CSSImageGeneratorValue(classType) | 97 : CSSImageGeneratorValue(classType) |
97 , m_stopsSorted(false) | 98 , m_stopsSorted(false) |
98 , m_gradientType(gradientType) | 99 , m_gradientType(gradientType) |
99 , m_repeating(repeat == Repeating) | 100 , m_repeating(repeat == Repeating) |
100 { | 101 { |
101 } | 102 } |
102 | 103 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 RefPtr<CSSPrimitiveValue> m_shape; | 230 RefPtr<CSSPrimitiveValue> m_shape; |
230 RefPtr<CSSPrimitiveValue> m_sizingBehavior; | 231 RefPtr<CSSPrimitiveValue> m_sizingBehavior; |
231 | 232 |
232 RefPtr<CSSPrimitiveValue> m_endHorizontalSize; | 233 RefPtr<CSSPrimitiveValue> m_endHorizontalSize; |
233 RefPtr<CSSPrimitiveValue> m_endVerticalSize; | 234 RefPtr<CSSPrimitiveValue> m_endVerticalSize; |
234 }; | 235 }; |
235 | 236 |
236 } // namespace WebCore | 237 } // namespace WebCore |
237 | 238 |
238 #endif // CSSGradientValue_h | 239 #endif // CSSGradientValue_h |
OLD | NEW |