| 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 03a3aa44e59366023459af77a6d31442871996b8..1ec42115f6a1781897453833b75dbf94ff6628fb 100644
|
| --- a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
|
| @@ -2051,7 +2051,7 @@ static bool EnabledCut(LocalFrame& frame, Event*, EditorCommandSource source) {
|
|
|
| static bool EnabledInEditableText(LocalFrame& frame,
|
| Event* event,
|
| - EditorCommandSource) {
|
| + EditorCommandSource source) {
|
| frame.GetDocument()->UpdateStyleAndLayoutIgnorePendingStylesheets();
|
| return frame.GetEditor().SelectionForCommand(event).RootEditableElement();
|
| }
|
| @@ -2073,8 +2073,11 @@ static bool EnabledDelete(LocalFrame& frame,
|
|
|
| static bool EnabledInRichlyEditableText(LocalFrame& frame,
|
| Event*,
|
| - EditorCommandSource) {
|
| + EditorCommandSource source) {
|
| frame.GetDocument()->UpdateStyleAndLayoutIgnorePendingStylesheets();
|
| + if (source == kCommandFromMenuOrKeyBinding &&
|
| + !frame.Selection().SelectionHasFocus())
|
| + return false;
|
| return !frame.Selection()
|
| .ComputeVisibleSelectionInDOMTreeDeprecated()
|
| .IsNone() &&
|
|
|