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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 } | 157 } |
158 | 158 |
159 bool equals(const CSSLinearGradientValue&) const; | 159 bool equals(const CSSLinearGradientValue&) const; |
160 | 160 |
161 private: | 161 private: |
162 CSSLinearGradientValue(CSSGradientRepeat repeat, CSSGradientType gradientTyp
e = CSSLinearGradient) | 162 CSSLinearGradientValue(CSSGradientRepeat repeat, CSSGradientType gradientTyp
e = CSSLinearGradient) |
163 : CSSGradientValue(LinearGradientClass, repeat, gradientType) | 163 : CSSGradientValue(LinearGradientClass, repeat, gradientType) |
164 { | 164 { |
165 } | 165 } |
166 | 166 |
167 CSSLinearGradientValue(const CSSLinearGradientValue& other) | 167 explicit CSSLinearGradientValue(const CSSLinearGradientValue& other) |
168 : CSSGradientValue(other, LinearGradientClass, other.gradientType()) | 168 : CSSGradientValue(other, LinearGradientClass, other.gradientType()) |
169 , m_angle(other.m_angle) | 169 , m_angle(other.m_angle) |
170 { | 170 { |
171 } | 171 } |
172 | 172 |
173 RefPtr<CSSPrimitiveValue> m_angle; // may be null. | 173 RefPtr<CSSPrimitiveValue> m_angle; // may be null. |
174 }; | 174 }; |
175 | 175 |
176 class CSSRadialGradientValue : public CSSGradientValue { | 176 class CSSRadialGradientValue : public CSSGradientValue { |
177 public: | 177 public: |
(...skipping 22 matching lines...) Expand all Loading... |
200 PassRefPtr<Gradient> createGradient(RenderObject*, const IntSize&); | 200 PassRefPtr<Gradient> createGradient(RenderObject*, const IntSize&); |
201 | 201 |
202 bool equals(const CSSRadialGradientValue&) const; | 202 bool equals(const CSSRadialGradientValue&) const; |
203 | 203 |
204 private: | 204 private: |
205 CSSRadialGradientValue(CSSGradientRepeat repeat, CSSGradientType gradientTyp
e = CSSRadialGradient) | 205 CSSRadialGradientValue(CSSGradientRepeat repeat, CSSGradientType gradientTyp
e = CSSRadialGradient) |
206 : CSSGradientValue(RadialGradientClass, repeat, gradientType) | 206 : CSSGradientValue(RadialGradientClass, repeat, gradientType) |
207 { | 207 { |
208 } | 208 } |
209 | 209 |
210 CSSRadialGradientValue(const CSSRadialGradientValue& other) | 210 explicit CSSRadialGradientValue(const CSSRadialGradientValue& other) |
211 : CSSGradientValue(other, RadialGradientClass, other.gradientType()) | 211 : CSSGradientValue(other, RadialGradientClass, other.gradientType()) |
212 , m_firstRadius(other.m_firstRadius) | 212 , m_firstRadius(other.m_firstRadius) |
213 , m_secondRadius(other.m_secondRadius) | 213 , m_secondRadius(other.m_secondRadius) |
214 , m_shape(other.m_shape) | 214 , m_shape(other.m_shape) |
215 , m_sizingBehavior(other.m_sizingBehavior) | 215 , m_sizingBehavior(other.m_sizingBehavior) |
216 , m_endHorizontalSize(other.m_endHorizontalSize) | 216 , m_endHorizontalSize(other.m_endHorizontalSize) |
217 , m_endVerticalSize(other.m_endVerticalSize) | 217 , m_endVerticalSize(other.m_endVerticalSize) |
218 { | 218 { |
219 } | 219 } |
220 | 220 |
221 | 221 |
222 // Resolve points/radii to front end values. | 222 // Resolve points/radii to front end values. |
223 float resolveRadius(CSSPrimitiveValue*, RenderStyle*, RenderStyle* rootStyle
, float* widthOrHeight = 0); | 223 float resolveRadius(CSSPrimitiveValue*, RenderStyle*, RenderStyle* rootStyle
, float* widthOrHeight = 0); |
224 | 224 |
225 // These may be null for non-deprecated gradients. | 225 // These may be null for non-deprecated gradients. |
226 RefPtr<CSSPrimitiveValue> m_firstRadius; | 226 RefPtr<CSSPrimitiveValue> m_firstRadius; |
227 RefPtr<CSSPrimitiveValue> m_secondRadius; | 227 RefPtr<CSSPrimitiveValue> m_secondRadius; |
228 | 228 |
229 // The below are only used for non-deprecated gradients. Any of them may be
null. | 229 // The below are only used for non-deprecated gradients. Any of them may be
null. |
230 RefPtr<CSSPrimitiveValue> m_shape; | 230 RefPtr<CSSPrimitiveValue> m_shape; |
231 RefPtr<CSSPrimitiveValue> m_sizingBehavior; | 231 RefPtr<CSSPrimitiveValue> m_sizingBehavior; |
232 | 232 |
233 RefPtr<CSSPrimitiveValue> m_endHorizontalSize; | 233 RefPtr<CSSPrimitiveValue> m_endHorizontalSize; |
234 RefPtr<CSSPrimitiveValue> m_endVerticalSize; | 234 RefPtr<CSSPrimitiveValue> m_endVerticalSize; |
235 }; | 235 }; |
236 | 236 |
237 } // namespace WebCore | 237 } // namespace WebCore |
238 | 238 |
239 #endif // CSSGradientValue_h | 239 #endif // CSSGradientValue_h |
OLD | NEW |