Chromium Code Reviews| 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 f2279f9bc81815f26cfe45c8433bdb3be203c0a0..862a3de44972c14464f88420ae26db08a3ae6986 100644 |
| --- a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp |
| +++ b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp |
| @@ -2709,8 +2709,9 @@ int Editor::Command::idForHistogram() const { |
| return isSupported() ? static_cast<int>(m_command->commandType) : 0; |
| } |
| -RangeVector* Editor::Command::getTargetRanges() const { |
| - if (!isSupported() || !m_frame) |
| +const RangeVector* Editor::Command::getTargetRanges() const { |
| + if (!isSupported() || !m_frame || |
| + !hasRichlyEditableStyle(*eventTargetNodeForDocument(m_frame->document()))) |
|
yosin_UTC9
2017/02/14 03:43:45
Since |eventTargetNodeForDocument()| can return nu
chongz
2017/02/14 18:57:51
Done.
|
| return nullptr; |
| switch (m_command->commandType) { |
| @@ -2740,7 +2741,8 @@ RangeVector* Editor::Command::getTargetRanges() const { |
| return RangesFromCurrentSelectionOrExtendCaret(*m_frame, DirectionForward, |
| WordGranularity); |
| default: |
| - return nullptr; |
| + return targetRangesForInputEvent( |
| + eventTargetNodeForDocument(m_frame->document())); |
| } |
| } |