| 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 57550300f094cdca408445d271ccc34031fcbd33..f9b6a3ef887637dec4828db7a3957abcb391fc72 100644
|
| --- a/third_party/WebKit/Source/core/editing/CaretBase.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/CaretBase.cpp
|
| @@ -45,8 +45,6 @@ namespace blink {
|
| CaretBase::CaretBase() = default;
|
| CaretBase::~CaretBase() = default;
|
|
|
| -DEFINE_TRACE(CaretBase) {}
|
| -
|
| static inline bool caretRendersInsideNode(Node* node) {
|
| return node && !isDisplayInsideTable(node) && !editingIgnoresContent(*node);
|
| }
|
| @@ -115,22 +113,6 @@ LayoutRect CaretBase::computeCaretRect(
|
| caretLocalRect);
|
| }
|
|
|
| -LayoutRect CaretBase::computeCaretRect(const VisiblePosition& caretPosition) {
|
| - return computeCaretRect(caretPosition.toPositionWithAffinity());
|
| -}
|
| -
|
| -IntRect CaretBase::absoluteBoundsForLocalRect(Node* node,
|
| - const LayoutRect& rect) const {
|
| - LayoutBlock* caretPainter = caretLayoutObject(node);
|
| - if (!caretPainter)
|
| - return IntRect();
|
| -
|
| - LayoutRect localRect(rect);
|
| - caretPainter->flipForWritingMode(localRect);
|
| - return caretPainter->localToAbsoluteQuad(FloatRect(localRect))
|
| - .enclosingBoundingBox();
|
| -}
|
| -
|
| // TODO(yoichio): |node| is FrameSelection::m_previousCaretNode and this is bad
|
| // design. We should use only previous layoutObject or Rectangle to invalidate
|
| // old caret.
|
| @@ -152,15 +134,6 @@ void CaretBase::invalidateLocalCaretRect(Node* node, const LayoutRect& rect) {
|
| node->layoutObject()->invalidatePaintRectangle(inflatedRect, this);
|
| }
|
|
|
| -bool CaretBase::shouldRepaintCaret(Node& node) const {
|
| - // If PositionAnchorType::BeforeAnchor or PositionAnchorType::AfterAnchor,
|
| - // carets need to be repainted not only when the node is contentEditable but
|
| - // also when its parentNode() is contentEditable.
|
| - node.document().updateStyleAndLayoutTree();
|
| - return hasEditableStyle(node) ||
|
| - (node.parentNode() && hasEditableStyle(*node.parentNode()));
|
| -}
|
| -
|
| void CaretBase::invalidateCaretRect(Node* node,
|
| const LayoutRect& caretLocalRect) {
|
| node->document().updateStyleAndLayoutTree();
|
| @@ -170,11 +143,10 @@ void CaretBase::invalidateCaretRect(Node* node,
|
|
|
| void CaretBase::paintCaret(Node* node,
|
| GraphicsContext& context,
|
| - const DisplayItemClient& client,
|
| const LayoutRect& caretLocalRect,
|
| const LayoutPoint& paintOffset,
|
| DisplayItem::Type displayItemType) {
|
| - if (DrawingRecorder::useCachedDrawingIfPossible(context, client,
|
| + if (DrawingRecorder::useCachedDrawingIfPossible(context, *this,
|
| displayItemType))
|
| return;
|
|
|
| @@ -186,7 +158,7 @@ void CaretBase::paintCaret(Node* node,
|
| const Color caretColor =
|
| node->layoutObject()->resolveColor(CSSPropertyCaretColor);
|
| IntRect paintRect = pixelSnappedIntRect(drawingRect);
|
| - DrawingRecorder drawingRecorder(context, client, DisplayItem::kCaret,
|
| + DrawingRecorder drawingRecorder(context, *this, DisplayItem::kCaret,
|
| paintRect);
|
| context.fillRect(paintRect, caretColor);
|
| }
|
|
|