Chromium Code Reviews| Index: third_party/WebKit/Source/core/editing/CaretBase.cpp |
| diff --git a/third_party/WebKit/Source/core/editing/CaretBase.cpp b/third_party/WebKit/Source/core/editing/CaretBase.cpp |
| index 0188054436a7db1bf507c3295b26105fc1349757..ba7b5d0d089d621f1b619f15d016ff0296a85725 100644 |
| --- a/third_party/WebKit/Source/core/editing/CaretBase.cpp |
| +++ b/third_party/WebKit/Source/core/editing/CaretBase.cpp |
| @@ -204,17 +204,7 @@ void CaretBase::paintCaret(Node* node, GraphicsContext& context, const LayoutPoi |
| layoutObject->flipForWritingMode(drawingRect); |
| drawingRect.moveBy(roundedIntPoint(paintOffset)); |
| - Color caretColor = Color::black; |
| - |
| - Element* element; |
| - if (node->isElementNode()) |
| - element = toElement(node); |
| - else |
| - element = node->parentElement(); |
| - |
| - if (element && element->layoutObject()) |
| - caretColor = element->layoutObject()->resolveColor(CSSPropertyColor); |
| - |
| + const Color caretColor = node->layoutObject()->resolveColor(CSSPropertyColor); |
|
Xiaocheng
2016/09/09 07:40:43
Do you mean |node| is always a |Text|? If so, coul
yoichio
2016/09/09 07:53:54
node->layoutObject() exists always?
yosin_UTC9
2016/09/09 08:27:21
|node| comes from anchor node of VisiblePosition.
|
| IntRect paintRect = pixelSnappedIntRect(drawingRect); |
| DrawingRecorder drawingRecorder(context, *this, DisplayItem::kCaret, paintRect); |
| context.fillRect(paintRect, caretColor); |