| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 bool m_repeating; | 142 bool m_repeating; |
| 143 }; | 143 }; |
| 144 | 144 |
| 145 DEFINE_CSS_VALUE_TYPE_CASTS(CSSGradientValue, isGradientValue()); | 145 DEFINE_CSS_VALUE_TYPE_CASTS(CSSGradientValue, isGradientValue()); |
| 146 | 146 |
| 147 class CSSLinearGradientValue : public CSSGradientValue { | 147 class CSSLinearGradientValue : public CSSGradientValue { |
| 148 public: | 148 public: |
| 149 | 149 |
| 150 static PassRefPtrWillBeRawPtr<CSSLinearGradientValue> create(CSSGradientRepe
at repeat, CSSGradientType gradientType = CSSLinearGradient) | 150 static PassRefPtrWillBeRawPtr<CSSLinearGradientValue> create(CSSGradientRepe
at repeat, CSSGradientType gradientType = CSSLinearGradient) |
| 151 { | 151 { |
| 152 return adoptRefCountedWillBeRefCountedGarbageCollected(new CSSLinearGrad
ientValue(repeat, gradientType)); | 152 return adoptRefWillBeRefCountedGarbageCollected(new CSSLinearGradientVal
ue(repeat, gradientType)); |
| 153 } | 153 } |
| 154 | 154 |
| 155 void setAngle(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> val) { m_angle = val
; } | 155 void setAngle(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> val) { m_angle = val
; } |
| 156 | 156 |
| 157 String customCSSText() const; | 157 String customCSSText() const; |
| 158 | 158 |
| 159 // Create the gradient for a given size. | 159 // Create the gradient for a given size. |
| 160 PassRefPtr<Gradient> createGradient(const CSSToLengthConversionData&, const
IntSize&); | 160 PassRefPtr<Gradient> createGradient(const CSSToLengthConversionData&, const
IntSize&); |
| 161 | 161 |
| 162 PassRefPtrWillBeRawPtr<CSSLinearGradientValue> clone() const | 162 PassRefPtrWillBeRawPtr<CSSLinearGradientValue> clone() const |
| 163 { | 163 { |
| 164 return adoptRefCountedWillBeRefCountedGarbageCollected(new CSSLinearGrad
ientValue(*this)); | 164 return adoptRefWillBeRefCountedGarbageCollected(new CSSLinearGradientVal
ue(*this)); |
| 165 } | 165 } |
| 166 | 166 |
| 167 bool equals(const CSSLinearGradientValue&) const; | 167 bool equals(const CSSLinearGradientValue&) const; |
| 168 | 168 |
| 169 void traceAfterDispatch(Visitor*); | 169 void traceAfterDispatch(Visitor*); |
| 170 | 170 |
| 171 private: | 171 private: |
| 172 CSSLinearGradientValue(CSSGradientRepeat repeat, CSSGradientType gradientTyp
e = CSSLinearGradient) | 172 CSSLinearGradientValue(CSSGradientRepeat repeat, CSSGradientType gradientTyp
e = CSSLinearGradient) |
| 173 : CSSGradientValue(LinearGradientClass, repeat, gradientType) | 173 : CSSGradientValue(LinearGradientClass, repeat, gradientType) |
| 174 { | 174 { |
| 175 } | 175 } |
| 176 | 176 |
| 177 explicit CSSLinearGradientValue(const CSSLinearGradientValue& other) | 177 explicit CSSLinearGradientValue(const CSSLinearGradientValue& other) |
| 178 : CSSGradientValue(other, LinearGradientClass, other.gradientType()) | 178 : CSSGradientValue(other, LinearGradientClass, other.gradientType()) |
| 179 , m_angle(other.m_angle) | 179 , m_angle(other.m_angle) |
| 180 { | 180 { |
| 181 } | 181 } |
| 182 | 182 |
| 183 RefPtrWillBeMember<CSSPrimitiveValue> m_angle; // may be null. | 183 RefPtrWillBeMember<CSSPrimitiveValue> m_angle; // may be null. |
| 184 }; | 184 }; |
| 185 | 185 |
| 186 DEFINE_CSS_VALUE_TYPE_CASTS(CSSLinearGradientValue, isLinearGradientValue()); | 186 DEFINE_CSS_VALUE_TYPE_CASTS(CSSLinearGradientValue, isLinearGradientValue()); |
| 187 | 187 |
| 188 class CSSRadialGradientValue : public CSSGradientValue { | 188 class CSSRadialGradientValue : public CSSGradientValue { |
| 189 public: | 189 public: |
| 190 static PassRefPtrWillBeRawPtr<CSSRadialGradientValue> create(CSSGradientRepe
at repeat, CSSGradientType gradientType = CSSRadialGradient) | 190 static PassRefPtrWillBeRawPtr<CSSRadialGradientValue> create(CSSGradientRepe
at repeat, CSSGradientType gradientType = CSSRadialGradient) |
| 191 { | 191 { |
| 192 return adoptRefCountedWillBeRefCountedGarbageCollected(new CSSRadialGrad
ientValue(repeat, gradientType)); | 192 return adoptRefWillBeRefCountedGarbageCollected(new CSSRadialGradientVal
ue(repeat, gradientType)); |
| 193 } | 193 } |
| 194 | 194 |
| 195 PassRefPtrWillBeRawPtr<CSSRadialGradientValue> clone() const | 195 PassRefPtrWillBeRawPtr<CSSRadialGradientValue> clone() const |
| 196 { | 196 { |
| 197 return adoptRefCountedWillBeRefCountedGarbageCollected(new CSSRadialGrad
ientValue(*this)); | 197 return adoptRefWillBeRefCountedGarbageCollected(new CSSRadialGradientVal
ue(*this)); |
| 198 } | 198 } |
| 199 | 199 |
| 200 String customCSSText() const; | 200 String customCSSText() const; |
| 201 | 201 |
| 202 void setFirstRadius(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> val) { m_first
Radius = val; } | 202 void setFirstRadius(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> val) { m_first
Radius = val; } |
| 203 void setSecondRadius(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> val) { m_seco
ndRadius = val; } | 203 void setSecondRadius(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> val) { m_seco
ndRadius = val; } |
| 204 | 204 |
| 205 void setShape(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> val) { m_shape = val
; } | 205 void setShape(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> val) { m_shape = val
; } |
| 206 void setSizingBehavior(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> val) { m_si
zingBehavior = val; } | 206 void setSizingBehavior(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> val) { m_si
zingBehavior = val; } |
| 207 | 207 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 namespace WTF { | 255 namespace WTF { |
| 256 | 256 |
| 257 // This must be declared in the WTF namespace to please the compiler. | 257 // This must be declared in the WTF namespace to please the compiler. |
| 258 template<> | 258 template<> |
| 259 struct NeedsTracing<WebCore::CSSGradientColorStop> { | 259 struct NeedsTracing<WebCore::CSSGradientColorStop> { |
| 260 static const bool value = true; | 260 static const bool value = true; |
| 261 }; | 261 }; |
| 262 | 262 |
| 263 } // namespace WTF | 263 } // namespace WTF |
| 264 #endif // CSSGradientValue_h | 264 #endif // CSSGradientValue_h |
| OLD | NEW |