| 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..0997b9633bc2789c5d7012f2c59a019564189db5 100644
|
| --- a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
|
| @@ -2126,6 +2126,19 @@ static bool EnabledUndo(LocalFrame& frame, Event*, EditorCommandSource) {
|
| return frame.GetEditor().CanUndo();
|
| }
|
|
|
| +static bool EnabledUnselect(LocalFrame& frame,
|
| + Event* event,
|
| + EditorCommandSource) {
|
| + frame.GetDocument()->UpdateStyleAndLayoutIgnorePendingStylesheets();
|
| +
|
| + // The term "visible" here includes a caret in editable text or a range in any
|
| + // text.
|
| + const VisibleSelection& selection =
|
| + frame.GetEditor().SelectionForCommand(event);
|
| + return (selection.IsCaret() && selection.IsContentEditable()) ||
|
| + selection.IsRange();
|
| +}
|
| +
|
| static bool EnabledSelectAll(LocalFrame& frame, Event*, EditorCommandSource) {
|
| // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets
|
| // needs to be audited. See http://crbug.com/590369 for more details.
|
| @@ -2755,7 +2768,7 @@ static const EditorInternalCommand* InternalCommand(
|
| SupportedFromMenuOrKeyBinding, EnabledInRichlyEditableText, StateNone,
|
| ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled},
|
| {WebEditingCommandType::kUnselect, ExecuteUnselect, Supported,
|
| - EnabledVisibleSelection, StateNone, ValueStateOrNull, kNotTextInsertion,
|
| + EnabledUnselect, StateNone, ValueStateOrNull, kNotTextInsertion,
|
| kDoNotAllowExecutionWhenDisabled},
|
| {WebEditingCommandType::kUseCSS, ExecuteUseCSS, Supported, Enabled,
|
| StateNone, ValueStateOrNull, kNotTextInsertion,
|
|
|