Chromium Code Reviews| Index: third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp |
| diff --git a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp |
| index 8c2d21feb0b7689b08d70bc88f8d6ef79560abcd..6d872a4d4de20e5f238b3a37c11f0fd591a90365 100644 |
| --- a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp |
| +++ b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp |
| @@ -1439,7 +1439,8 @@ void CompositeEditCommand::moveParagraphWithClones( |
| document().updateStyleAndLayoutIgnorePendingStylesheets(); |
| - setEndingSelection(createVisibleSelection(start, end)); |
| + setEndingSelection(createVisibleSelection( |
| + SelectionInDOMTree::Builder().collapse(start).extend(end).build())); |
| deleteSelection(editingState, false, false, false); |
| if (editingState->isAborted()) |
| return; |
| @@ -1598,7 +1599,8 @@ void CompositeEditCommand::moveParagraphs( |
| DCHECK(!document().needsLayoutTreeUpdate()); |
| - setEndingSelection(createVisibleSelection(start, end)); |
| + setEndingSelection(createVisibleSelection( |
| + SelectionInDOMTree::Builder().collapse(start).extend(end).build())); |
|
Xiaocheng
2016/10/26 05:49:18
Do we have non-null start and end here?
yosin_UTC9
2016/10/26 07:43:07
I would like to know the case which makes start| o
|
| document() |
| .frame() |
| ->spellChecker() |
| @@ -1709,9 +1711,12 @@ void CompositeEditCommand::moveParagraphs( |
| .createRangeForSelection(*documentElement); |
| if (endRange.isNull()) |
| return; |
| - setEndingSelection(createVisibleSelection( |
| - startRange.startPosition(), endRange.startPosition(), |
| - TextAffinity::Downstream, originalIsDirectional)); |
| + setEndingSelection( |
| + createVisibleSelection(SelectionInDOMTree::Builder() |
| + .collapse(startRange.startPosition()) |
| + .extend(endRange.startPosition()) |
| + .setIsDirectional(originalIsDirectional) |
| + .build())); |
| } |
| // FIXME: Send an appropriate shouldDeleteRange call. |