Refactor WebCore::EditAction to be an 8-bit enum class
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Sep 2018 03:04:53 +0000 (03:04 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Sep 2018 03:04:53 +0000 (03:04 +0000)
commita5b6bc208cbca8eb414a1d9ef9f7b2aede173c92
tree1fcab2ecf90c5f5c0e9ddb9a0ff492b91cbdf302
parentd7169531c86a25ed2b02e3eebdd7222e3c032eed
Refactor WebCore::EditAction to be an 8-bit enum class
https://bugs.webkit.org/show_bug.cgi?id=189383

Reviewed by Dan Bernstein.

Source/WebCore:

Currently, EditAction.h defines an EditAction as an enum. This patch changes EditAction to instead be an 8-bit-
wide enum class, and renames all EditAction values from EditAction(*) to EditAction::(*).

No change in behavior.

* editing/ApplyStyleCommand.h:
(WebCore::ApplyStyleCommand::create):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::apply):
(WebCore::deleteSelectionEditingActionForEditingAction):
* editing/CompositeEditCommand.h:
(WebCore::EditCommandComposition::wasCreateLinkCommand const):
* editing/CreateLinkCommand.h:
* editing/DeleteFromTextNodeCommand.h:
(WebCore::DeleteFromTextNodeCommand::create):
* editing/DeleteSelectionCommand.h:
(WebCore::DeleteSelectionCommand::create):
* editing/DictationCommand.cpp:
(WebCore::DictationCommand::insertTextRunWithoutNewlines):
(WebCore::DictationCommand::insertParagraphSeparator):
* editing/EditAction.h:
(): Deleted.
* editing/EditCommand.cpp:
(WebCore::inputTypeNameForEditingAction):
* editing/EditCommand.h:
* editing/Editor.cpp:
(WebCore::inputEventDataForEditingStyleAndAction):
(WebCore::ClearTextCommand::editingAction const):
(WebCore::Editor::handleTextEvent):
(WebCore::Editor::replaceSelectionWithFragment):
(WebCore::Editor::performCutOrCopy):
(WebCore::Editor::setBaseWritingDirection):
(WebCore::Editor::markMisspellingsAfterTypingToWord):
(WebCore::Editor::changeBackToReplacedString):
(WebCore::Editor::transpose):
* editing/Editor.h:
* editing/EditorCommand.cpp:
(WebCore::applyCommandToFrame):
(WebCore::executeInsertFragment):
(WebCore::executeBackColor):
(WebCore::executeFontName):
(WebCore::executeFontSize):
(WebCore::executeFontSizeDelta):
(WebCore::executeForeColor):
(WebCore::executeJustifyCenter):
(WebCore::executeJustifyFull):
(WebCore::executeJustifyLeft):
(WebCore::executeJustifyRight):
(WebCore::executeMakeTextWritingDirectionLeftToRight):
(WebCore::executeMakeTextWritingDirectionNatural):
(WebCore::executeMakeTextWritingDirectionRightToLeft):
(WebCore::executeStrikethrough):
(WebCore::executeSubscript):
(WebCore::executeSuperscript):
(WebCore::executeToggleBold):
(WebCore::executeToggleItalic):
(WebCore::executeUnderline):
(WebCore::executeUnscript):
* editing/FormatBlockCommand.h:
* editing/IndentOutdentCommand.h:
* editing/InsertIntoTextNodeCommand.h:
(WebCore::InsertIntoTextNodeCommand::create):
* editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::editingAction const):
* editing/InsertNodeBeforeCommand.h:
(WebCore::InsertNodeBeforeCommand::create):
* editing/InsertParagraphSeparatorCommand.h:
(WebCore::InsertParagraphSeparatorCommand::create):
* editing/InsertTextCommand.h:
(WebCore::InsertTextCommand::create):
(WebCore::InsertTextCommand::createWithMarkerSupplier):
* editing/MoveSelectionCommand.cpp:
(WebCore::MoveSelectionCommand::doApply):
(WebCore::MoveSelectionCommand::editingAction const):
* editing/RemoveFormatCommand.h:
* editing/RemoveNodeCommand.h:
(WebCore::RemoveNodeCommand::create):
* editing/ReplaceRangeWithTextCommand.cpp:
(WebCore::ReplaceRangeWithTextCommand::ReplaceRangeWithTextCommand):
(WebCore::ReplaceRangeWithTextCommand::doApply):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::completeHTMLReplacement):
(WebCore::ReplaceSelectionCommand::performTrivialReplace):
* editing/ReplaceSelectionCommand.h:
(WebCore::ReplaceSelectionCommand::create):
* editing/SpellingCorrectionCommand.cpp:
(WebCore::SpellingCorrectionCommand::SpellingCorrectionCommand):
(WebCore::SpellingCorrectionCommand::doApply):
* editing/TextInsertionBaseCommand.h:
* editing/TypingCommand.cpp:
(WebCore::editActionForTypingCommand):
(WebCore::editActionIsDeleteByTyping):
(WebCore::TypingCommand::isBeforeInputEventCancelable const):
(WebCore::TypingCommand::inputEventData const):
(WebCore::TypingCommand::inputEventDataTransfer const):
(WebCore::TypingCommand::insertTextRunWithoutNewlines):
(WebCore::TypingCommand::insertParagraphSeparator):
* editing/UnlinkCommand.h:
* editing/ios/DictationCommandIOS.cpp:
(WebCore::DictationCommandIOS::DictationCommandIOS):
* editing/ios/EditorIOS.mm:
(WebCore::Editor::removeUnchangeableStyles):
* page/DragController.cpp:
(WebCore::DragController::concludeEditDrag):

Source/WebKit:

* UIProcess/WebEditCommandProxy.cpp:
(WebKit::WebEditCommandProxy::nameForEditAction):
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::changeFontAttributes):
(WebKit::WebPage::changeFont):

Source/WebKitLegacy/mac:

* WebCoreSupport/WebEditorClient.mm:
(undoNameForEditAction):
* WebView/WebHTMLView.mm:
(-[WebHTMLView pasteFont:]):
(-[WebHTMLView changeFont:]):
(-[WebHTMLView changeAttributes:]):
(-[WebHTMLView _undoActionFromColorPanelWithSelector:]):
(-[WebHTMLView changeColor:]):
* WebView/WebView.mm:
(-[WebView setTypingStyle:]):

Source/WebKitLegacy/win:

* WebCoreSupport/WebEditorClient.cpp:
(undoNameForEditAction):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235775 268f45cc-cd09-0410-ab3c-d52691b4dbfc
43 files changed:
Source/WebCore/ChangeLog
Source/WebCore/editing/ApplyStyleCommand.h
Source/WebCore/editing/CompositeEditCommand.cpp
Source/WebCore/editing/CompositeEditCommand.h
Source/WebCore/editing/CreateLinkCommand.h
Source/WebCore/editing/DeleteFromTextNodeCommand.h
Source/WebCore/editing/DeleteSelectionCommand.h
Source/WebCore/editing/DictationCommand.cpp
Source/WebCore/editing/EditAction.h
Source/WebCore/editing/EditCommand.cpp
Source/WebCore/editing/EditCommand.h
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/Editor.h
Source/WebCore/editing/EditorCommand.cpp
Source/WebCore/editing/FormatBlockCommand.h
Source/WebCore/editing/IndentOutdentCommand.h
Source/WebCore/editing/InsertIntoTextNodeCommand.h
Source/WebCore/editing/InsertListCommand.cpp
Source/WebCore/editing/InsertNodeBeforeCommand.h
Source/WebCore/editing/InsertParagraphSeparatorCommand.h
Source/WebCore/editing/InsertTextCommand.h
Source/WebCore/editing/MoveSelectionCommand.cpp
Source/WebCore/editing/RemoveFormatCommand.h
Source/WebCore/editing/RemoveNodeCommand.h
Source/WebCore/editing/ReplaceRangeWithTextCommand.cpp
Source/WebCore/editing/ReplaceSelectionCommand.cpp
Source/WebCore/editing/ReplaceSelectionCommand.h
Source/WebCore/editing/SpellingCorrectionCommand.cpp
Source/WebCore/editing/TextInsertionBaseCommand.h
Source/WebCore/editing/TypingCommand.cpp
Source/WebCore/editing/UnlinkCommand.h
Source/WebCore/editing/ios/DictationCommandIOS.cpp
Source/WebCore/editing/ios/EditorIOS.mm
Source/WebCore/page/DragController.cpp
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/WebEditCommandProxy.cpp
Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.mm
Source/WebKitLegacy/mac/WebView/WebHTMLView.mm
Source/WebKitLegacy/mac/WebView/WebView.mm
Source/WebKitLegacy/win/ChangeLog
Source/WebKitLegacy/win/WebCoreSupport/WebEditorClient.cpp