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

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

Issue 2537373005: [css-ui] Make caret-color animatable (Closed)
Patch Set: Apply suggested changes and add new composition test Created 4 years 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.cpp
diff --git a/third_party/WebKit/Source/core/animation/ColorPropertyFunctions.cpp b/third_party/WebKit/Source/core/animation/ColorPropertyFunctions.cpp
index 5755a3c6a58da258978f7c5655cbc315613193a5..9c6819303f3df2004fc0480a4521135a6c034735 100644
--- a/third_party/WebKit/Source/core/animation/ColorPropertyFunctions.cpp
+++ b/third_party/WebKit/Source/core/animation/ColorPropertyFunctions.cpp
@@ -8,8 +8,12 @@
namespace blink {
-StyleColor ColorPropertyFunctions::getInitialColor(CSSPropertyID property) {
- return getUnvisitedColor(property, ComputedStyle::initialStyle());
+bool ColorPropertyFunctions::getInitialColor(CSSPropertyID property,
+ StyleColor& initialColor) {
+ if (property == CSSPropertyCaretColor)
+ return false;
+ initialColor = getUnvisitedColor(property, ComputedStyle::initialStyle());
+ return true;
}
StyleColor ColorPropertyFunctions::getUnvisitedColor(
@@ -26,6 +30,8 @@ StyleColor ColorPropertyFunctions::getUnvisitedColor(
return style.borderTopColor();
case CSSPropertyBorderBottomColor:
return style.borderBottomColor();
+ case CSSPropertyCaretColor:
+ return style.caretColor().toStyleColor();
alancutter (OOO until 2018) 2016/12/20 05:45:53 This seems wrong. You shouldn't be able to read a
Manuel Rego 2016/12/20 17:18:16 Good point, I've changed all this.
case CSSPropertyColor:
return style.color();
case CSSPropertyOutlineColor:
@@ -67,6 +73,8 @@ StyleColor ColorPropertyFunctions::getVisitedColor(CSSPropertyID property,
return style.visitedLinkBorderTopColor();
case CSSPropertyBorderBottomColor:
return style.visitedLinkBorderBottomColor();
+ case CSSPropertyCaretColor:
+ return style.visitedLinkCaretColor().toStyleColor();
case CSSPropertyColor:
return style.visitedLinkColor();
case CSSPropertyOutlineColor:
@@ -114,6 +122,8 @@ void ColorPropertyFunctions::setUnvisitedColor(CSSPropertyID property,
case CSSPropertyBorderTopColor:
style.setBorderTopColor(color);
return;
+ case CSSPropertyCaretColor:
+ return style.setCaretColor(color);
case CSSPropertyColor:
style.setColor(color);
return;
@@ -163,6 +173,8 @@ void ColorPropertyFunctions::setVisitedColor(CSSPropertyID property,
case CSSPropertyBorderTopColor:
style.setVisitedLinkBorderTopColor(color);
return;
+ case CSSPropertyCaretColor:
+ return style.setVisitedLinkCaretColor(color);
case CSSPropertyColor:
style.setVisitedLinkColor(color);
return;

Powered by Google App Engine
This is Rietveld 408576698