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

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

Issue 2374183004: Make non-null VisibleSelections creatable only by createVisibleSelection[Deprecated] (Closed)
Patch Set: Fix mac compile error Created 4 years, 3 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/DOMSelection.cpp
diff --git a/third_party/WebKit/Source/core/editing/DOMSelection.cpp b/third_party/WebKit/Source/core/editing/DOMSelection.cpp
index 85a0a77954dcc7af03332a1f8255bee7f1f6e72f..236e081f9a6113b9baaf61a7e785aec5f2ff2ed0 100644
--- a/third_party/WebKit/Source/core/editing/DOMSelection.cpp
+++ b/third_party/WebKit/Source/core/editing/DOMSelection.cpp
@@ -228,7 +228,7 @@ void DOMSelection::collapse(Node* node, int offset, ExceptionState& exceptionSta
Range::checkNodeWOffset(node, offset, exceptionState);
if (exceptionState.hadException())
return;
- frame()->selection().setSelection(VisibleSelection(Position(node, offset), frame()->selection().isDirectional()));
+ frame()->selection().setSelection(createVisibleSelectionDeprecated(Position(node, offset), frame()->selection().isDirectional()));
}
void DOMSelection::collapseToEnd(ExceptionState& exceptionState)
@@ -292,7 +292,7 @@ void DOMSelection::setBaseAndExtent(Node* baseNode, int baseOffset, Node* extent
Position base = createPosition(baseNode, baseOffset);
Position extent = createPosition(extentNode, extentOffset);
const bool selectionHasDirection = true;
- frame()->selection().setSelection(VisibleSelection(base, extent, SelDefaultAffinity, selectionHasDirection));
+ frame()->selection().setSelection(createVisibleSelectionDeprecated(base, extent, SelDefaultAffinity, selectionHasDirection));
}
void DOMSelection::modify(const String& alterString, const String& directionString, const String& granularityString)
@@ -367,7 +367,7 @@ void DOMSelection::extend(Node* node, int offset, ExceptionState& exceptionState
const Position& base = frame()->selection().base();
const Position& extent = createPosition(node, offset);
const bool selectionHasDirection = true;
- const VisibleSelection newSelection(base, extent, TextAffinity::Downstream, selectionHasDirection);
+ const VisibleSelection newSelection = createVisibleSelectionDeprecated(base, extent, TextAffinity::Downstream, selectionHasDirection);
frame()->selection().setSelection(newSelection);
}

Powered by Google App Engine
This is Rietveld 408576698