| Index: third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
|
| diff --git a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
|
| index 64ac77640607a35767fd2c5f516e8ef1d4e3d089..b23161de87848d099813ca91935e9082cab34473 100644
|
| --- a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
|
| @@ -387,8 +387,12 @@ static bool executeInsertElement(LocalFrame& frame, HTMLElement* content) {
|
|
|
| static bool expandSelectionToGranularity(LocalFrame& frame,
|
| TextGranularity granularity) {
|
| - VisibleSelection selection = frame.selection().selection();
|
| - selection.expandUsingGranularity(granularity);
|
| + const VisibleSelection& selection = createVisibleSelection(
|
| + SelectionInDOMTree::Builder()
|
| + .setBaseAndExtent(frame.selection().selection().base(),
|
| + frame.selection().selection().extent())
|
| + .setGranularity(granularity)
|
| + .build());
|
| const EphemeralRange newRange = selection.toNormalizedEphemeralRange();
|
| if (newRange.isNull())
|
| return false;
|
|
|