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 5c5f415d3187d909368a021d2ec52ab3580b5816..ef35efb93145c8c368544a6b792249d709673e16 100644 |
| --- a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp |
| +++ b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp |
| @@ -127,6 +127,21 @@ InputEvent::InputType InputTypeFromCommandType(WebEditingCommandType commandType |
| case WebEditingCommandType::InsertBacktab: |
| case WebEditingCommandType::InsertText: |
| return InputEvent::InputType::InsertText; |
| + case WebEditingCommandType::Bold: |
| + case WebEditingCommandType::ToggleBold: |
| + return InputEvent::InputType::Bold; |
| + case WebEditingCommandType::Italic: |
| + case WebEditingCommandType::ToggleItalic: |
| + return InputEvent::InputType::Italic; |
| + case WebEditingCommandType::Underline: |
| + case WebEditingCommandType::ToggleUnderline: |
| + return InputEvent::InputType::Underline; |
| + case WebEditingCommandType::Strikethrough: |
| + return InputEvent::InputType::StrikeThrough; |
| + case WebEditingCommandType::Superscript: |
| + return InputEvent::InputType::Superscript; |
| + case WebEditingCommandType::Subscript: |
| + return InputEvent::InputType::Subscript; |
| default: |
| return InputEvent::InputType::None; |
| } |
| @@ -188,7 +203,7 @@ static bool applyCommandToFrame(LocalFrame& frame, EditorCommandSource source, E |
| frame.editor().applyStyleToSelection(style, action); |
| return true; |
| case CommandFromDOM: |
| - frame.editor().applyStyle(style); |
| + frame.editor().applyStyle(style, action); |
|
chongz
2016/07/13 07:24:39
Not sure why we don't pass |action| before?
|
| return true; |
| } |
| NOTREACHED(); |
| @@ -1179,7 +1194,7 @@ static bool executeSetMark(LocalFrame& frame, Event*, EditorCommandSource, const |
| static bool executeStrikethrough(LocalFrame& frame, Event*, EditorCommandSource source, const String&) |
| { |
| CSSPrimitiveValue* lineThrough = CSSPrimitiveValue::createIdentifier(CSSValueLineThrough); |
| - return executeToggleStyleInList(frame, source, EditActionUnderline, CSSPropertyWebkitTextDecorationsInEffect, lineThrough); |
| + return executeToggleStyleInList(frame, source, EditActionStrikeThrough, CSSPropertyWebkitTextDecorationsInEffect, lineThrough); |
|
chongz
2016/07/13 07:24:39
I'm not sure is this a bug or intentionally?
yosin_UTC9
2016/07/13 08:10:42
Should be a bug. But, nobody uses |EditActionUnder
|
| } |
| static bool executeStyleWithCSS(LocalFrame& frame, Event*, EditorCommandSource, const String& value) |