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

Unified Diff: third_party/WebKit/Source/core/editing/VisibleUnits.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/VisibleUnits.cpp
diff --git a/third_party/WebKit/Source/core/editing/VisibleUnits.cpp b/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
index 54c0455a2fc2cc47da7e658adbfbdaffe49726f0..0035178bed5dd55a57120a9f4d712db016be34b5 100644
--- a/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
+++ b/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
@@ -182,7 +182,7 @@ static PositionWithAffinityTemplate<Strategy> honorEditingBoundaryAtOrBefore(
// Return empty position if |pos| is not somewhere inside the editable
// region containing this position
- if (highestRoot && !pos.position().anchorNode()->isDescendantOf(highestRoot))
+ if (highestRoot && !pos.anchorNode()->isDescendantOf(highestRoot))
return PositionWithAffinityTemplate<Strategy>();
// Return |pos| itself if the two are from the very same editable region, or
@@ -1430,8 +1430,8 @@ bool inSameLineAlgorithm(
const PositionWithAffinityTemplate<Strategy>& position2) {
if (position1.isNull() || position2.isNull())
return false;
- DCHECK_EQ(position1.position().document(), position2.position().document());
- DCHECK(!position1.position().document()->needsLayoutTreeUpdate());
+ DCHECK_EQ(position1.document(), position2.document());
+ DCHECK(!position1.document()->needsLayoutTreeUpdate());
PositionWithAffinityTemplate<Strategy> startOfLine1 = startOfLine(position1);
PositionWithAffinityTemplate<Strategy> startOfLine2 = startOfLine(position2);
@@ -2644,11 +2644,11 @@ template <typename Strategy>
LayoutRect localCaretRectOfPositionTemplate(
const PositionWithAffinityTemplate<Strategy>& position,
LayoutObject*& layoutObject) {
- if (position.position().isNull()) {
+ if (position.isNull()) {
layoutObject = nullptr;
return LayoutRect();
}
- Node* node = position.position().anchorNode();
+ Node* node = position.anchorNode();
layoutObject = node->layoutObject();
if (!layoutObject)

Powered by Google App Engine
This is Rietveld 408576698