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

Unified Diff: third_party/WebKit/Source/core/animation/ColorPropertyFunctions.h

Issue 2694383002: Don't animate caret-color: auto (Closed)
Patch Set: Fix composition test Created 3 years, 10 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/animation/ColorPropertyFunctions.h
diff --git a/third_party/WebKit/Source/core/animation/ColorPropertyFunctions.h b/third_party/WebKit/Source/core/animation/ColorPropertyFunctions.h
index 47fe8c79bf19301951cecf5a1d4496c732713f5e..bcec998b41b4f0f83a422c46bb995a1b0bf8c753 100644
--- a/third_party/WebKit/Source/core/animation/ColorPropertyFunctions.h
+++ b/third_party/WebKit/Source/core/animation/ColorPropertyFunctions.h
@@ -12,11 +12,35 @@ namespace blink {
class ComputedStyle;
+struct OptionalStyleColor {
+ public:
+ OptionalStyleColor(std::nullptr_t) : m_isNull(true) {}
+ OptionalStyleColor(const StyleColor& styleColor)
+ : m_isNull(false), m_styleColor(styleColor) {}
+ OptionalStyleColor(const Color& color)
+ : m_isNull(false), m_styleColor(color) {}
+
+ bool isNull() const { return m_isNull; }
+ const StyleColor& access() const {
+ DCHECK(!m_isNull);
+ return m_styleColor;
+ }
+ bool operator==(const OptionalStyleColor& other) const {
+ return m_isNull == other.m_isNull && m_styleColor == other.m_styleColor;
+ }
+
+ private:
+ bool m_isNull;
+ StyleColor m_styleColor;
+};
+
class ColorPropertyFunctions {
public:
- static bool getInitialColor(CSSPropertyID, StyleColor& initialColor);
- static StyleColor getUnvisitedColor(CSSPropertyID, const ComputedStyle&);
- static StyleColor getVisitedColor(CSSPropertyID, const ComputedStyle&);
+ static OptionalStyleColor getInitialColor(CSSPropertyID);
+ static OptionalStyleColor getUnvisitedColor(CSSPropertyID,
+ const ComputedStyle&);
+ static OptionalStyleColor getVisitedColor(CSSPropertyID,
+ const ComputedStyle&);
static void setUnvisitedColor(CSSPropertyID, ComputedStyle&, const Color&);
static void setVisitedColor(CSSPropertyID, ComputedStyle&, const Color&);
};

Powered by Google App Engine
This is Rietveld 408576698