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(); |