Chromium Code Reviews| Index: third_party/WebKit/Source/core/css/CSSGradientValue.h |
| diff --git a/third_party/WebKit/Source/core/css/CSSGradientValue.h b/third_party/WebKit/Source/core/css/CSSGradientValue.h |
| index 19967defb305c38cd009ce57666c2c80a8889fda..65691b2c256ab2694ce73a83abf6f071efb8dea6 100644 |
| --- a/third_party/WebKit/Source/core/css/CSSGradientValue.h |
| +++ b/third_party/WebKit/Source/core/css/CSSGradientValue.h |
| @@ -44,7 +44,8 @@ enum CSSGradientType { |
| CSSPrefixedLinearGradient, |
| CSSPrefixedRadialGradient, |
| CSSLinearGradient, |
| - CSSRadialGradient |
| + CSSRadialGradient, |
| + CSSConicGradient |
| }; |
| enum CSSGradientRepeat { NonRepeating, Repeating }; |
| @@ -60,7 +61,7 @@ struct CSSGradientColorStop { |
| public: |
| CSSGradientColorStop() : m_colorIsDerivedFromElement(false) {} |
| - Member<CSSPrimitiveValue> m_position; // percentage or length |
| + Member<CSSPrimitiveValue> m_position; // percentage | length | angle |
|
fs
2017/03/28 15:59:20
(I sense that "m_offsetValue" or somesuch might be
f(malita)
2017/03/28 17:16:45
Ack, that would touch a bunch of code.
|
| Member<CSSValue> m_color; |
| bool m_colorIsDerivedFromElement; |
| bool operator==(const CSSGradientColorStop& other) const { |
| @@ -96,8 +97,6 @@ class CSSGradientValue : public CSSImageGeneratorValue { |
| unsigned stopCount() const { return m_stops.size(); } |
| - void appendCSSTextForDeprecatedColorStops(StringBuilder&) const; |
| - |
| bool isRepeating() const { return m_repeating; } |
| CSSGradientType gradientType() const { return m_gradientType; } |
| @@ -138,6 +137,9 @@ class CSSGradientValue : public CSSImageGeneratorValue { |
| bool isCacheable() const; |
| + void appendCSSTextForColorStops(StringBuilder&, bool requiresSeparator) const; |
| + void appendCSSTextForDeprecatedColorStops(StringBuilder&) const; |
| + |
| // Points. Some of these may be null. |
| Member<CSSValue> m_firstX; |
| Member<CSSValue> m_firstY; |
| @@ -240,6 +242,34 @@ class CSSRadialGradientValue final : public CSSGradientValue { |
| DEFINE_CSS_VALUE_TYPE_CASTS(CSSRadialGradientValue, isRadialGradientValue()); |
| +class CSSConicGradientValue final : public CSSGradientValue { |
| + public: |
| + static CSSConicGradientValue* create(CSSGradientRepeat repeat) { |
| + return new CSSConicGradientValue(repeat); |
| + } |
| + |
| + String customCSSText() const; |
| + |
| + // Create the gradient for a given size. |
| + PassRefPtr<Gradient> createGradient(const CSSToLengthConversionData&, |
| + const IntSize&, |
| + const LayoutObject&); |
| + |
| + void setFromAngle(CSSPrimitiveValue* val) { m_fromAngle = val; } |
| + |
| + bool equals(const CSSConicGradientValue&) const; |
| + |
| + DECLARE_TRACE_AFTER_DISPATCH(); |
| + |
| + private: |
| + CSSConicGradientValue(CSSGradientRepeat repeat) |
| + : CSSGradientValue(ConicGradientClass, repeat, CSSConicGradient) {} |
| + |
| + Member<CSSPrimitiveValue> m_fromAngle; |
| +}; |
| + |
| +DEFINE_CSS_VALUE_TYPE_CASTS(CSSConicGradientValue, isConicGradientValue()); |
| + |
| } // namespace blink |
| #endif // CSSGradientValue_h |