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

Unified Diff: third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp

Issue 2520873002: [css-ui] Add support for caret-color property (Closed)
Patch Set: Patch for landing applying suggested changes 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/css/resolver/StyleBuilderCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp b/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp
index a32acd73177428e1ecc8af92d6a37da71502e5db..c9739d5e7db4b6437c277482fed2e340bbc52b6e 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp
@@ -92,6 +92,7 @@ static inline bool isValidVisitedLinkProperty(CSSPropertyID id) {
case CSSPropertyBorderRightColor:
case CSSPropertyBorderTopColor:
case CSSPropertyBorderBottomColor:
+ case CSSPropertyCaretColor:
case CSSPropertyColor:
case CSSPropertyFill:
case CSSPropertyOutlineColor:
@@ -1041,4 +1042,35 @@ void StyleBuilderFunctions::applyInheritCSSPropertyPosition(
state.style()->setPosition(state.parentStyle()->position());
}
+void StyleBuilderFunctions::applyInitialCSSPropertyCaretColor(
+ StyleResolverState& state) {
+ StyleAutoColor color = StyleAutoColor::autoColor();
+ if (state.applyPropertyToRegularStyle())
+ state.style()->setCaretColor(color);
+ if (state.applyPropertyToVisitedLinkStyle())
+ state.style()->setVisitedLinkCaretColor(color);
+}
+
+void StyleBuilderFunctions::applyInheritCSSPropertyCaretColor(
+ StyleResolverState& state) {
+ StyleAutoColor color = state.parentStyle()->caretColor();
+ if (state.applyPropertyToRegularStyle())
+ state.style()->setCaretColor(color);
+ if (state.applyPropertyToVisitedLinkStyle())
+ state.style()->setVisitedLinkCaretColor(color);
+}
+
+void StyleBuilderFunctions::applyValueCSSPropertyCaretColor(
+ StyleResolverState& state,
+ const CSSValue& value) {
+ if (state.applyPropertyToRegularStyle()) {
+ state.style()->setCaretColor(
+ StyleBuilderConverter::convertStyleAutoColor(state, value));
+ }
+ if (state.applyPropertyToVisitedLinkStyle()) {
+ state.style()->setVisitedLinkCaretColor(
+ StyleBuilderConverter::convertStyleAutoColor(state, value, true));
+ }
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698