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

Unified Diff: Source/core/editing/FrameSelection.cpp

Issue 14098003: Change the caret color according to the lightness of the background color. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing Created 7 years, 6 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 | « LayoutTests/editing/caret/caret-color-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/FrameSelection.cpp
diff --git a/Source/core/editing/FrameSelection.cpp b/Source/core/editing/FrameSelection.cpp
index 5a5f03ca12af958d053a017430e64f43cded1d55..229f473861437434ef32364958688bbf5d59dfa0 100644
--- a/Source/core/editing/FrameSelection.cpp
+++ b/Source/core/editing/FrameSelection.cpp
@@ -1458,7 +1458,13 @@ void CaretBase::paintCaret(Node* node, GraphicsContext* context, const LayoutPoi
return;
Color caretColor = Color::black;
- Element* element = node->rootEditableElement();
+
+ Element* element;
+ if (node->isElementNode())
+ element = toElement(node);
+ else
+ element = node->parentElement();
+
if (element && element->renderer())
caretColor = element->renderer()->style()->visitedDependentColor(CSSPropertyColor);
« no previous file with comments | « LayoutTests/editing/caret/caret-color-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698