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

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

Issue 1958093002: CONTINUED Make FrameSelection to hold non-canonicalized positions Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2017-01-16T20:04:35 Created 3 years, 11 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
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);
}
« no previous file with comments | « third_party/WebKit/Source/core/editing/CaretBase.h ('k') | third_party/WebKit/Source/core/editing/DragCaretController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698