| 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 c28eff62c570923843f83084db8d82d4a0f5ebc7..0a1501f0ffea6ca18800ee7703434d1d08b6bad4 100644
|
| --- a/third_party/WebKit/Source/core/editing/DOMSelection.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/DOMSelection.cpp
|
| @@ -222,9 +222,16 @@
|
| 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();
|
| +
|
| SelectionInDOMTree::Builder builder;
|
| builder.collapse(selection.end());
|
| - frame()->selection().setSelection(builder.build());
|
| + frame()->selection().setSelection(createVisibleSelection(builder.build()));
|
| }
|
|
|
| void DOMSelection::collapseToStart(ExceptionState& exceptionState) {
|
| @@ -239,9 +246,16 @@
|
| 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();
|
| +
|
| SelectionInDOMTree::Builder builder;
|
| builder.collapse(selection.start());
|
| - frame()->selection().setSelection(builder.build());
|
| + frame()->selection().setSelection(createVisibleSelection(builder.build()));
|
| }
|
|
|
| void DOMSelection::empty() {
|
|
|