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

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

Issue 2406163004: Simplify the usage of PositionWithAffinity (Closed)
Patch Set: Created 4 years, 2 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 d725c723ac69a118a5e228bf81b43ac3772e944e..03dcf2b6d6c5b82546b774d8ac201c88796b1e85 100644
--- a/third_party/WebKit/Source/core/editing/CaretBase.cpp
+++ b/third_party/WebKit/Source/core/editing/CaretBase.cpp
@@ -104,10 +104,10 @@ static void mapCaretRectToCaretPainter(LayoutItem caretLayoutItem,
void CaretBase::updateCaretRect(const PositionWithAffinity& caretPosition) {
m_caretLocalRect = LayoutRect();
- if (caretPosition.position().isNull())
+ if (caretPosition.isNull())
return;
- DCHECK(caretPosition.position().anchorNode()->layoutObject());
+ DCHECK(caretPosition.anchorNode()->layoutObject());
// First compute a rect local to the layoutObject at the selection start.
LayoutObject* layoutObject;
@@ -116,7 +116,7 @@ void CaretBase::updateCaretRect(const PositionWithAffinity& caretPosition) {
// Get the layoutObject that will be responsible for painting the caret
// (which is either the layoutObject we just found, or one of its containers).
LayoutBlockItem caretPainterItem =
- LayoutBlockItem(caretLayoutObject(caretPosition.position().anchorNode()));
+ LayoutBlockItem(caretLayoutObject(caretPosition.anchorNode()));
mapCaretRectToCaretPainter(LayoutItem(layoutObject), caretPainterItem,
m_caretLocalRect);
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/editing/DragCaretController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698