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

Unified Diff: Source/core/editing/InsertListCommand.cpp

Issue 181103004: Fixing crash when executing ApplyStyle command. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressing review comments Created 6 years, 10 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: Source/core/editing/InsertListCommand.cpp
diff --git a/Source/core/editing/InsertListCommand.cpp b/Source/core/editing/InsertListCommand.cpp
index 15ea47e3d99d2463f155f9cea796339351bc8784..db335739342f7ba9bc16c2b89b3d3c675d0dc041 100644
--- a/Source/core/editing/InsertListCommand.cpp
+++ b/Source/core/editing/InsertListCommand.cpp
@@ -174,13 +174,10 @@ void InsertListCommand::doApply()
startOfCurrentParagraph = startOfNextParagraph(endingSelection().visibleStart());
}
setEndingSelection(endOfSelection);
+ currentSelection = endingSelection().firstRange();
doApplyForSingleParagraph(forceCreateList, listTag, currentSelection.get());
// Fetch the end of the selection, for the reason mentioned above.
- if (endOfSelection.isNull() || endOfSelection.isOrphan()) {
- endOfSelection = visiblePositionForIndex(indexForEndOfSelection, scope.get());
- if (endOfSelection.isNull())
- return;
- }
+ endOfSelection = endingSelection().visibleEnd();
setEndingSelection(VisibleSelection(startOfSelection, endOfSelection, endingSelection().isDirectional()));
return;
}

Powered by Google App Engine
This is Rietveld 408576698