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

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

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
« no previous file with comments | « third_party/WebKit/Source/core/animation/ColorPropertyFunctions.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/animation/ColorPropertyFunctions.cpp
diff --git a/third_party/WebKit/Source/core/animation/ColorPropertyFunctions.cpp b/third_party/WebKit/Source/core/animation/ColorPropertyFunctions.cpp
index c6dba58733de6a4bead8818807c68594416de55f..a091b36828b41dd47b6cef999fd68592a965d735 100644
--- a/third_party/WebKit/Source/core/animation/ColorPropertyFunctions.cpp
+++ b/third_party/WebKit/Source/core/animation/ColorPropertyFunctions.cpp
@@ -8,17 +8,12 @@
namespace blink {
-bool ColorPropertyFunctions::getInitialColor(CSSPropertyID property,
- StyleColor& initialColor) {
- if (property == CSSPropertyCaretColor)
- return false;
- // TODO(rego): Make getUnvisitedColor() return a bool, so we don't need a
- // special case for caret-color here (http://crbug.com/676295).
- initialColor = getUnvisitedColor(property, ComputedStyle::initialStyle());
- return true;
+OptionalStyleColor ColorPropertyFunctions::getInitialColor(
+ CSSPropertyID property) {
+ return getUnvisitedColor(property, ComputedStyle::initialStyle());
}
-StyleColor ColorPropertyFunctions::getUnvisitedColor(
+OptionalStyleColor ColorPropertyFunctions::getUnvisitedColor(
CSSPropertyID property,
const ComputedStyle& style) {
switch (property) {
@@ -33,10 +28,8 @@ StyleColor ColorPropertyFunctions::getUnvisitedColor(
case CSSPropertyBorderBottomColor:
return style.borderBottomColor();
case CSSPropertyCaretColor:
- // TODO(rego): "auto" value for caret-color should not interpolate
- // (http://crbug.com/676295).
if (style.caretColor().isAutoColor())
- return StyleColor::currentColor();
+ return nullptr;
return style.caretColor().toStyleColor();
case CSSPropertyColor:
return style.color();
@@ -62,12 +55,13 @@ StyleColor ColorPropertyFunctions::getUnvisitedColor(
return style.textDecorationColor();
default:
NOTREACHED();
- return StyleColor::currentColor();
+ return nullptr;
}
}
-StyleColor ColorPropertyFunctions::getVisitedColor(CSSPropertyID property,
- const ComputedStyle& style) {
+OptionalStyleColor ColorPropertyFunctions::getVisitedColor(
+ CSSPropertyID property,
+ const ComputedStyle& style) {
switch (property) {
case CSSPropertyBackgroundColor:
return style.visitedLinkBackgroundColor();
@@ -109,7 +103,7 @@ StyleColor ColorPropertyFunctions::getVisitedColor(CSSPropertyID property,
return style.visitedLinkTextDecorationColor();
default:
NOTREACHED();
- return StyleColor::currentColor();
+ return nullptr;
}
}
« no previous file with comments | « third_party/WebKit/Source/core/animation/ColorPropertyFunctions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698