Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1110)

Side by Side Diff: Source/core/css/CSSGradientValue.h

Issue 23581008: Revert r154797: "Move isValid/isCurrentColor from Color to StyleColor" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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"
32 #include "wtf/RefPtr.h" 31 #include "wtf/RefPtr.h"
33 #include "wtf/Vector.h" 32 #include "wtf/Vector.h"
34 33
35 namespace WebCore { 34 namespace WebCore {
36 35
37 class FloatPoint; 36 class FloatPoint;
38 class Gradient; 37 class Gradient;
39 class TextLinkColors; 38 class TextLinkColors;
40 39
41 enum CSSGradientType { 40 enum CSSGradientType {
42 CSSDeprecatedLinearGradient, 41 CSSDeprecatedLinearGradient,
43 CSSDeprecatedRadialGradient, 42 CSSDeprecatedRadialGradient,
44 CSSPrefixedLinearGradient, 43 CSSPrefixedLinearGradient,
45 CSSPrefixedRadialGradient, 44 CSSPrefixedRadialGradient,
46 CSSLinearGradient, 45 CSSLinearGradient,
47 CSSRadialGradient 46 CSSRadialGradient
48 }; 47 };
49 enum CSSGradientRepeat { NonRepeating, Repeating }; 48 enum CSSGradientRepeat { NonRepeating, Repeating };
50 49
51 struct CSSGradientColorStop { 50 struct CSSGradientColorStop {
52 CSSGradientColorStop() : m_colorIsDerivedFromElement(false) { }; 51 CSSGradientColorStop() : m_colorIsDerivedFromElement(false) { };
53 RefPtr<CSSPrimitiveValue> m_position; // percentage or length 52 RefPtr<CSSPrimitiveValue> m_position; // percentage or length
54 RefPtr<CSSPrimitiveValue> m_color; 53 RefPtr<CSSPrimitiveValue> m_color;
55 StyleColor m_resolvedColor; 54 Color m_resolvedColor;
56 bool m_colorIsDerivedFromElement; 55 bool m_colorIsDerivedFromElement;
57 bool operator==(const CSSGradientColorStop& other) const 56 bool operator==(const CSSGradientColorStop& other) const
58 { 57 {
59 return compareCSSValuePtr(m_color, other.m_color) 58 return compareCSSValuePtr(m_color, other.m_color)
60 && compareCSSValuePtr(m_position, other.m_position); 59 && compareCSSValuePtr(m_position, other.m_position);
61 } 60 }
62 }; 61 };
63 62
64 class CSSGradientValue : public CSSImageGeneratorValue { 63 class CSSGradientValue : public CSSImageGeneratorValue {
65 public: 64 public:
(...skipping 17 matching lines...) Expand all
83 82
84 CSSGradientType gradientType() const { return m_gradientType; } 83 CSSGradientType gradientType() const { return m_gradientType; }
85 84
86 bool isFixedSize() const { return false; } 85 bool isFixedSize() const { return false; }
87 IntSize fixedSize(const RenderObject*) const { return IntSize(); } 86 IntSize fixedSize(const RenderObject*) const { return IntSize(); }
88 87
89 bool isPending() const { return false; } 88 bool isPending() const { return false; }
90 bool knownToBeOpaque(const RenderObject*) const; 89 bool knownToBeOpaque(const RenderObject*) const;
91 90
92 void loadSubimages(ResourceFetcher*) { } 91 void loadSubimages(ResourceFetcher*) { }
93 PassRefPtr<CSSGradientValue> gradientWithStylesResolved(const TextLinkColors &); 92 PassRefPtr<CSSGradientValue> gradientWithStylesResolved(const TextLinkColors &, Color currentColor);
94 93
95 protected: 94 protected:
96 CSSGradientValue(ClassType classType, CSSGradientRepeat repeat, CSSGradientT ype gradientType) 95 CSSGradientValue(ClassType classType, CSSGradientRepeat repeat, CSSGradientT ype gradientType)
97 : CSSImageGeneratorValue(classType) 96 : CSSImageGeneratorValue(classType)
98 , m_stopsSorted(false) 97 , m_stopsSorted(false)
99 , m_gradientType(gradientType) 98 , m_gradientType(gradientType)
100 , m_repeating(repeat == Repeating) 99 , m_repeating(repeat == Repeating)
101 { 100 {
102 } 101 }
103 102
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 RefPtr<CSSPrimitiveValue> m_shape; 229 RefPtr<CSSPrimitiveValue> m_shape;
231 RefPtr<CSSPrimitiveValue> m_sizingBehavior; 230 RefPtr<CSSPrimitiveValue> m_sizingBehavior;
232 231
233 RefPtr<CSSPrimitiveValue> m_endHorizontalSize; 232 RefPtr<CSSPrimitiveValue> m_endHorizontalSize;
234 RefPtr<CSSPrimitiveValue> m_endVerticalSize; 233 RefPtr<CSSPrimitiveValue> m_endVerticalSize;
235 }; 234 };
236 235
237 } // namespace WebCore 236 } // namespace WebCore
238 237
239 #endif // CSSGradientValue_h 238 #endif // CSSGradientValue_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698