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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 RefPtr<CSSPrimitiveValue> m_secondX; | 124 RefPtr<CSSPrimitiveValue> m_secondX; |
125 RefPtr<CSSPrimitiveValue> m_secondY; | 125 RefPtr<CSSPrimitiveValue> m_secondY; |
126 | 126 |
127 // Stops | 127 // Stops |
128 Vector<CSSGradientColorStop, 2> m_stops; | 128 Vector<CSSGradientColorStop, 2> m_stops; |
129 bool m_stopsSorted; | 129 bool m_stopsSorted; |
130 CSSGradientType m_gradientType; | 130 CSSGradientType m_gradientType; |
131 bool m_repeating; | 131 bool m_repeating; |
132 }; | 132 }; |
133 | 133 |
134 DEFINE_CSS_VALUE_TYPE_CASTS(GradientValue); | 134 DEFINE_CSS_VALUE_TYPE_CASTS(CSSGradientValue, isGradientValue()); |
135 | 135 |
136 class CSSLinearGradientValue : public CSSGradientValue { | 136 class CSSLinearGradientValue : public CSSGradientValue { |
137 public: | 137 public: |
138 | 138 |
139 static PassRefPtr<CSSLinearGradientValue> create(CSSGradientRepeat repeat, C
SSGradientType gradientType = CSSLinearGradient) | 139 static PassRefPtr<CSSLinearGradientValue> create(CSSGradientRepeat repeat, C
SSGradientType gradientType = CSSLinearGradient) |
140 { | 140 { |
141 return adoptRef(new CSSLinearGradientValue(repeat, gradientType)); | 141 return adoptRef(new CSSLinearGradientValue(repeat, gradientType)); |
142 } | 142 } |
143 | 143 |
144 void setAngle(PassRefPtr<CSSPrimitiveValue> val) { m_angle = val; } | 144 void setAngle(PassRefPtr<CSSPrimitiveValue> val) { m_angle = val; } |
(...skipping 18 matching lines...) Expand all Loading... |
163 | 163 |
164 explicit CSSLinearGradientValue(const CSSLinearGradientValue& other) | 164 explicit CSSLinearGradientValue(const CSSLinearGradientValue& other) |
165 : CSSGradientValue(other, LinearGradientClass, other.gradientType()) | 165 : CSSGradientValue(other, LinearGradientClass, other.gradientType()) |
166 , m_angle(other.m_angle) | 166 , m_angle(other.m_angle) |
167 { | 167 { |
168 } | 168 } |
169 | 169 |
170 RefPtr<CSSPrimitiveValue> m_angle; // may be null. | 170 RefPtr<CSSPrimitiveValue> m_angle; // may be null. |
171 }; | 171 }; |
172 | 172 |
173 DEFINE_CSS_VALUE_TYPE_CASTS(LinearGradientValue); | 173 DEFINE_CSS_VALUE_TYPE_CASTS(CSSLinearGradientValue, isLinearGradientValue()); |
174 | 174 |
175 class CSSRadialGradientValue : public CSSGradientValue { | 175 class CSSRadialGradientValue : public CSSGradientValue { |
176 public: | 176 public: |
177 static PassRefPtr<CSSRadialGradientValue> create(CSSGradientRepeat repeat, C
SSGradientType gradientType = CSSRadialGradient) | 177 static PassRefPtr<CSSRadialGradientValue> create(CSSGradientRepeat repeat, C
SSGradientType gradientType = CSSRadialGradient) |
178 { | 178 { |
179 return adoptRef(new CSSRadialGradientValue(repeat, gradientType)); | 179 return adoptRef(new CSSRadialGradientValue(repeat, gradientType)); |
180 } | 180 } |
181 | 181 |
182 PassRefPtr<CSSRadialGradientValue> clone() const | 182 PassRefPtr<CSSRadialGradientValue> clone() const |
183 { | 183 { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 RefPtr<CSSPrimitiveValue> m_secondRadius; | 226 RefPtr<CSSPrimitiveValue> m_secondRadius; |
227 | 227 |
228 // The below are only used for non-deprecated gradients. Any of them may be
null. | 228 // The below are only used for non-deprecated gradients. Any of them may be
null. |
229 RefPtr<CSSPrimitiveValue> m_shape; | 229 RefPtr<CSSPrimitiveValue> m_shape; |
230 RefPtr<CSSPrimitiveValue> m_sizingBehavior; | 230 RefPtr<CSSPrimitiveValue> m_sizingBehavior; |
231 | 231 |
232 RefPtr<CSSPrimitiveValue> m_endHorizontalSize; | 232 RefPtr<CSSPrimitiveValue> m_endHorizontalSize; |
233 RefPtr<CSSPrimitiveValue> m_endVerticalSize; | 233 RefPtr<CSSPrimitiveValue> m_endVerticalSize; |
234 }; | 234 }; |
235 | 235 |
236 DEFINE_CSS_VALUE_TYPE_CASTS(RadialGradientValue); | 236 DEFINE_CSS_VALUE_TYPE_CASTS(CSSRadialGradientValue, isRadialGradientValue()); |
237 | 237 |
238 } // namespace WebCore | 238 } // namespace WebCore |
239 | 239 |
240 #endif // CSSGradientValue_h | 240 #endif // CSSGradientValue_h |
OLD | NEW |