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

Unified Diff: third_party/WebKit/Source/core/css/CSSGradientValue.h

Issue 2775103002: Conic gradient parsing support (Closed)
Patch Set: review Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
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
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

Powered by Google App Engine
This is Rietveld 408576698