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

Unified Diff: third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp

Issue 2724333002: Get rid of VisibleSelection::firstRangeOf() (Closed)
Patch Set: 2017-03-03T13:18:27 DCHECK(!range) => DCHECK(range) Created 3 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: 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 756813bb56d2e51bd0dda87e398ce4ec71a50302..2f2478ea8995c980aba97a71120a36575bfe5239 100644
--- a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
@@ -205,8 +205,8 @@ StaticRangeVector* RangesFromCurrentSelectionOrExtendCaret(
// We only supports single selections.
if (selectionModifier.selection().isNone())
return ranges;
- ranges->push_back(
- StaticRange::create(firstRangeOf(selectionModifier.selection())));
+ ranges->push_back(StaticRange::create(
+ createRange(firstEphemeralRangeOf(selectionModifier.selection()))));
return ranges;
}
@@ -2076,7 +2076,8 @@ static String valueFormatBlock(LocalFrame& frame, Event*) {
if (!selection.isNonOrphanedCaretOrRange() || !selection.isContentEditable())
return "";
Element* formatBlockElement =
- FormatBlockCommand::elementForFormatBlockCommand(firstRangeOf(selection));
+ FormatBlockCommand::elementForFormatBlockCommand(
+ createRange(firstEphemeralRangeOf(selection)));
if (!formatBlockElement)
return "";
return formatBlockElement->localName();

Powered by Google App Engine
This is Rietveld 408576698