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

Unified Diff: third_party/WebKit/Source/core/style/ComputedStyle.cpp

Issue 2520873002: [css-ui] Add support for caret-color property (Closed)
Patch Set: Add new baselines for Mac and Windows Created 4 years, 1 month 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/style/ComputedStyle.cpp
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.cpp b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
index c45ebe126090d8488234a29ce3e6f6f678725ff6..4a38dc25695f0d67f23184c863a2a2bb702c0dc0 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
@@ -1131,7 +1131,11 @@ void ComputedStyle::updatePropertySpecificDifferences(
m_rareInheritedData->m_textDecorationSkip !=
other.m_rareInheritedData->m_textDecorationSkip ||
m_rareInheritedData->appliedTextDecorations !=
- other.m_rareInheritedData->appliedTextDecorations)) {
+ other.m_rareInheritedData->appliedTextDecorations ||
+ m_rareInheritedData->caretColor() !=
+ other.m_rareInheritedData->caretColor() ||
+ m_rareInheritedData->visitedLinkCaretColor() !=
+ other.m_rareInheritedData->visitedLinkCaretColor())) {
diff.setTextDecorationOrColorChanged();
}
}
@@ -2075,6 +2079,14 @@ Color ComputedStyle::colorIncludingFallback(int colorProperty,
visitedLink ? visitedLinkBorderBottomColor() : borderBottomColor();
borderStyle = borderBottomStyle();
break;
+ case CSSPropertyCaretColor: {
+ StyleAutoColor autoColor =
+ visitedLink ? visitedLinkCaretColor() : caretColor();
+ // TODO(rego): We may want to adjust the caret color if it's the same than
+ // the background to ensure good visibility and contrast.
+ result = autoColor.isAutoColor() ? StyleColor::currentColor() : autoColor;
+ break;
+ }
case CSSPropertyColor:
result = visitedLink ? visitedLinkColor() : color();
break;

Powered by Google App Engine
This is Rietveld 408576698