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

Unified Diff: third_party/WebKit/Source/core/editing/EditingStyle.cpp

Issue 2577633002: [css-ui] Update resolved value of caret-color property (Closed)
Patch Set: Rebased 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/editing/EditingStyle.cpp
diff --git a/third_party/WebKit/Source/core/editing/EditingStyle.cpp b/third_party/WebKit/Source/core/editing/EditingStyle.cpp
index 42b35e02f07be1d09fa1331a306ad49e91df8252..a04ebb2ab6c163dbfaad5e40b2b9e9a3c3578c5a 100644
--- a/third_party/WebKit/Source/core/editing/EditingStyle.cpp
+++ b/third_party/WebKit/Source/core/editing/EditingStyle.cpp
@@ -487,7 +487,7 @@ void EditingStyle::init(Node* node, PropertiesToInclude propertiesToInclude) {
if (node && node->ensureComputedStyle()) {
const ComputedStyle* computedStyle = node->ensureComputedStyle();
- removeTextFillAndStrokeColorsIfNeeded(computedStyle);
+ removeInheritedColorsIfNeeded(computedStyle);
replaceFontSizeByKeywordIfPossible(computedStyle, computedStyleAtPosition);
}
@@ -495,15 +495,19 @@ void EditingStyle::init(Node* node, PropertiesToInclude propertiesToInclude) {
extractFontSizeDelta();
}
-void EditingStyle::removeTextFillAndStrokeColorsIfNeeded(
+void EditingStyle::removeInheritedColorsIfNeeded(
const ComputedStyle* computedStyle) {
// If a node's text fill color is currentColor, then its children use
// their font-color as their text fill color (they don't
// inherit it). Likewise for stroke color.
+ // Similar thing happens for caret-color if it's auto or currentColor.
if (computedStyle->textFillColor().isCurrentColor())
m_mutableStyle->removeProperty(CSSPropertyWebkitTextFillColor);
if (computedStyle->textStrokeColor().isCurrentColor())
m_mutableStyle->removeProperty(CSSPropertyWebkitTextStrokeColor);
+ if (computedStyle->caretColor().isAutoColor() ||
+ computedStyle->caretColor().isCurrentColor())
+ m_mutableStyle->removeProperty(CSSPropertyCaretColor);
}
void EditingStyle::setProperty(CSSPropertyID propertyID,
« no previous file with comments | « third_party/WebKit/Source/core/editing/EditingStyle.h ('k') | third_party/WebKit/Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698