| Index: third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp
|
| diff --git a/third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp b/third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp
|
| index bef69781f5aaa91504d976afe249e4422d3b5b11..c5bea18bc499cead96eb908dc5373a93a5d90df4 100644
|
| --- a/third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp
|
| @@ -96,18 +96,20 @@ HTMLElement* InsertListCommand::mergeWithNeighboringLists(
|
| }
|
|
|
| bool InsertListCommand::selectionHasListOfType(
|
| - const VisibleSelection& selection,
|
| + const Position& selectionStart,
|
| + const Position& selectionEnd,
|
| const HTMLQualifiedName& listTag) {
|
| + DCHECK_LE(selectionStart, selectionEnd);
|
| DCHECK(!document().needsLayoutTreeUpdate());
|
| DocumentLifecycle::DisallowTransitionScope disallowTransition(
|
| document().lifecycle());
|
|
|
| - VisiblePosition start = selection.visibleStart();
|
| + VisiblePosition start = createVisiblePosition(selectionStart);
|
|
|
| if (!enclosingList(start.deepEquivalent().anchorNode()))
|
| return false;
|
|
|
| - VisiblePosition end = startOfParagraph(selection.visibleEnd());
|
| + VisiblePosition end = startOfParagraph(createVisiblePosition(selectionEnd));
|
| while (start.isNotNull() && start.deepEquivalent() != end.deepEquivalent()) {
|
| HTMLElement* listElement =
|
| enclosingList(start.deepEquivalent().anchorNode());
|
| @@ -200,7 +202,8 @@ void InsertListCommand::doApply(EditingState* editingState) {
|
|
|
| if (startOfParagraph(visibleStartOfSelection, CanSkipOverEditingBoundary)
|
| .deepEquivalent() != startOfLastParagraph) {
|
| - forceListCreation = !selectionHasListOfType(selection, listTag);
|
| + forceListCreation =
|
| + !selectionHasListOfType(selection.start(), selection.end(), listTag);
|
|
|
| VisiblePosition startOfCurrentParagraph = visibleStartOfSelection;
|
| while (inSameTreeAndOrdered(startOfCurrentParagraph.deepEquivalent(),
|
|
|