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

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

Issue 2971563002: Use PositionInFlatTreeWithAffinty for SelectionController::original_base_in_flat_tree_ (Closed)
Patch Set: 2017-07-03T16:48:36 Created 3 years, 6 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
« no previous file with comments | « third_party/WebKit/Source/core/editing/SelectionController.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/SelectionController.cpp
diff --git a/third_party/WebKit/Source/core/editing/SelectionController.cpp b/third_party/WebKit/Source/core/editing/SelectionController.cpp
index d8383c49c95d47414bc2ac2fa4fbbff8c4a79458..79d43e54169fab9189a6e3e5fd59249023152792 100644
--- a/third_party/WebKit/Source/core/editing/SelectionController.cpp
+++ b/third_party/WebKit/Source/core/editing/SelectionController.cpp
@@ -140,7 +140,7 @@ Document& SelectionController::GetDocument() const {
}
void SelectionController::ContextDestroyed(Document*) {
- original_base_in_flat_tree_ = VisiblePositionInFlatTree();
+ original_base_in_flat_tree_ = PositionInFlatTreeWithAffinity();
}
static PositionInFlatTree AdjustPositionRespectUserSelectAll(
@@ -729,8 +729,10 @@ void SelectionController::SetNonDirectionalSelectionIfNeeded(
const VisibleSelectionInFlatTree& new_selection =
CreateVisibleSelection(passed_selection);
+ // TODO(editing-dev): We should use |PositionWithAffinity| to pass affinity
+ // to |CreateVisiblePosition()| for |original_base|.
const PositionInFlatTree& base_position =
- original_base_in_flat_tree_.DeepEquivalent();
+ original_base_in_flat_tree_.GetPosition();
const VisiblePositionInFlatTree& original_base =
base_position.IsConnected() ? CreateVisiblePosition(base_position)
: VisiblePositionInFlatTree();
@@ -750,7 +752,7 @@ void SelectionController::SetNonDirectionalSelectionIfNeeded(
SelectionInFlatTree::Builder builder(new_selection.AsSelection());
if (adjusted_selection.Base() != base.DeepEquivalent() ||
adjusted_selection.Extent() != extent.DeepEquivalent()) {
- original_base_in_flat_tree_ = base;
+ original_base_in_flat_tree_ = base.ToPositionWithAffinity();
SetContext(&GetDocument());
builder.SetBaseAndExtent(adjusted_selection.Base(),
adjusted_selection.Extent());
@@ -760,7 +762,7 @@ void SelectionController::SetNonDirectionalSelectionIfNeeded(
builder.SetBaseAndExtent(original_base.DeepEquivalent(),
new_selection.Extent());
}
- original_base_in_flat_tree_ = VisiblePositionInFlatTree();
+ original_base_in_flat_tree_ = PositionInFlatTreeWithAffinity();
}
builder.SetIsHandleVisible(handle_visibility == HandleVisibility::kVisible)
« no previous file with comments | « third_party/WebKit/Source/core/editing/SelectionController.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698