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

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

Issue 2428363004: Get rid of createVisibleSelection() taking PositionWithAffinity (Closed)
Patch Set: 2016-10-20T14:00:21 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/DOMSelection.cpp
diff --git a/third_party/WebKit/Source/core/editing/DOMSelection.cpp b/third_party/WebKit/Source/core/editing/DOMSelection.cpp
index 156ae7305e8ff3fc451267c821247c1ddfd83b8b..113ff3500dc734c3651ff1378fe245c0cc671a37 100644
--- a/third_party/WebKit/Source/core/editing/DOMSelection.cpp
+++ b/third_party/WebKit/Source/core/editing/DOMSelection.cpp
@@ -210,15 +210,11 @@ void DOMSelection::collapse(Node* node,
if (exceptionState.hadException())
return;
- // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
- // needs to be audited. See http://crbug.com/590369 for more details.
- // In the long term, we should change FrameSelection::setSelection to take a
- // parameter that does not require clean layout, so that modifying selection
- // no longer performs synchronous layout by itself.
- frame()->document()->updateStyleAndLayoutIgnorePendingStylesheets();
-
- frame()->selection().setSelection(createVisibleSelection(
- Position(node, offset), frame()->selection().isDirectional()));
+ frame()->selection().setSelection(
+ SelectionInDOMTree::Builder()
+ .collapse(Position(node, offset))
+ .setIsDirectional(frame()->selection().isDirectional())
+ .build());
}
void DOMSelection::collapseToEnd(ExceptionState& exceptionState) {

Powered by Google App Engine
This is Rietveld 408576698