WebKit Bugzilla
Attachment 358300 Details for
Bug 193129
: [Cocoa] Merge WebEditCommandProxy::nameForEditAction and undoNameForEditAction into a single function
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193129-20190103184645.patch (text/plain), 37.00 KB, created by
Wenson Hsieh
on 2019-01-03 18:46:46 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Wenson Hsieh
Created:
2019-01-03 18:46:46 PST
Size:
37.00 KB
patch
obsolete
>Subversion Revision: 239591 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index dc1f8d982cc8394940734728052ad8004df6fa69..47af0fb212562a03674c541959f17e702dfd916e 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,19 @@ >+2019-01-03 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ [Cocoa] Merge WebEditCommandProxy::nameForEditAction and undoNameForEditAction into a single function >+ https://bugs.webkit.org/show_bug.cgi?id=193129 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Adds a new helper function that returns the undo/redo name for a given EditAction. No change in behavior. >+ >+ * Sources.txt: >+ * WebCore.xcodeproj/project.pbxproj: >+ * editing/EditAction.cpp: Copied from Source/WebKit/UIProcess/WebEditCommandProxy.cpp. >+ (WebCore::nameForUndoRedo): >+ * editing/EditAction.h: >+ * editing/Editor.cpp: >+ > 2019-01-02 Simon Fraser <simon.fraser@apple.com> > > REGRESSION (r239306): Don't disable font smoothing in transparent layers on macOS Mojave and later >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 83f5006f8f2374a2fa1a921ffcdf0e7121681eef..f9387f55da46c48781401d1e06bcda45c1d88389 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,31 @@ >+2019-01-03 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ [Cocoa] Merge WebEditCommandProxy::nameForEditAction and undoNameForEditAction into a single function >+ https://bugs.webkit.org/show_bug.cgi?id=193129 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Remove WebEditCommandProxy::nameForEditAction and use WebCore::nameForUndoRedo instead. >+ >+ * UIProcess/Cocoa/WebViewImpl.mm: >+ (WebKit::WebViewImpl::registerEditCommand): >+ * UIProcess/WebEditCommandProxy.cpp: >+ (WebKit::WebEditCommandProxy::WebEditCommandProxy): >+ (WebKit::WebEditCommandProxy::~WebEditCommandProxy): >+ (WebKit::WebEditCommandProxy::nameForEditAction): Deleted. >+ * UIProcess/WebEditCommandProxy.h: >+ * UIProcess/WebPageProxy.cpp: >+ (WebKit::WebPageProxy::addEditCommand): >+ (WebKit::WebPageProxy::removeEditCommand): >+ (WebKit::WebPageProxy::isValidEditCommand): Deleted. >+ >+ Bit of drive-by refactoring: remove an unused function, and make addEditCommand and removeEditCommand take >+ references instead of pointers, since these are assumed to be nonnull. >+ >+ * UIProcess/WebPageProxy.h: >+ * UIProcess/ios/PageClientImplIOS.mm: >+ (WebKit::PageClientImpl::registerEditCommand): >+ > 2019-01-03 Wenson Hsieh <wenson_hsieh@apple.com> > > [iOS] REGRESSION (r239441): Tab cycling to offscreen <select> may not scroll it into view >diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog >index 1372daf11adf09c23cca928df65f0d4f985166f5..f137b3e49bcd65f510fafee41ab8859effaee224 100644 >--- a/Source/WebKitLegacy/mac/ChangeLog >+++ b/Source/WebKitLegacy/mac/ChangeLog >@@ -1,3 +1,16 @@ >+2019-01-03 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ [Cocoa] Merge WebEditCommandProxy::nameForEditAction and undoNameForEditAction into a single function >+ https://bugs.webkit.org/show_bug.cgi?id=193129 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Remove undoNameForEditAction and use WebCore::nameForUndoRedo instead. >+ >+ * WebCoreSupport/WebEditorClient.mm: >+ (WebEditorClient::registerUndoOrRedoStep): >+ (undoNameForEditAction): Deleted. >+ > 2019-01-02 Wenson Hsieh <wenson_hsieh@apple.com> > > Add support for using the current text selection as the find string on iOS >diff --git a/Source/WebCore/Sources.txt b/Source/WebCore/Sources.txt >index e7d934ad27f1bfa91231e1d86df0b7419d838b90..6930288d5dd06ab99414aa14ce258cef81bcba1f 100644 >--- a/Source/WebCore/Sources.txt >+++ b/Source/WebCore/Sources.txt >@@ -913,6 +913,7 @@ editing/DeleteFromTextNodeCommand.cpp > editing/DeleteSelectionCommand.cpp > editing/DictationAlternative.cpp > editing/DictationCommand.cpp >+editing/EditAction.cpp > editing/EditCommand.cpp > editing/Editing.cpp > editing/EditingStyle.cpp >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index de452c062a6ba26f47327077fc1f99acfcfd8ceb..aa774f9e5dd7ccb30a3dc2bdb91936ada6b693f7 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -14935,6 +14935,7 @@ > F48D2AA32159740D00C6752B /* ColorCocoa.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ColorCocoa.h; sourceTree = "<group>"; }; > F48D2AA42159740D00C6752B /* ColorCocoa.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ColorCocoa.mm; sourceTree = "<group>"; }; > F49786871FF45FA500E060AB /* PasteboardItemInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PasteboardItemInfo.h; sourceTree = "<group>"; }; >+ F49E98E421DEE6C1009AE55E /* EditAction.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = EditAction.cpp; sourceTree = "<group>"; }; > F4D43D64218802E600ECECAC /* SerializedAttachmentData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SerializedAttachmentData.h; sourceTree = "<group>"; }; > F4D9817D2195FBF6008230FC /* ChangeListTypeCommand.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ChangeListTypeCommand.h; sourceTree = "<group>"; }; > F4D9817E2195FBF6008230FC /* ChangeListTypeCommand.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ChangeListTypeCommand.cpp; sourceTree = "<group>"; }; >@@ -20780,6 +20781,7 @@ > CECADFC4153778FF00E37068 /* DictationCommand.cpp */, > CECADFC5153778FF00E37068 /* DictationCommand.h */, > 2D5646AF1B8F8493003C4994 /* DictionaryPopupInfo.h */, >+ F49E98E421DEE6C1009AE55E /* EditAction.cpp */, > 93309D93099E64910056E581 /* EditAction.h */, > 93309D94099E64910056E581 /* EditCommand.cpp */, > 93309D95099E64910056E581 /* EditCommand.h */, >diff --git a/Source/WebCore/editing/EditAction.cpp b/Source/WebCore/editing/EditAction.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..4125e35078f25a6edcf8e1d6899475474e962e3a >--- /dev/null >+++ b/Source/WebCore/editing/EditAction.cpp >@@ -0,0 +1,147 @@ >+/* >+ * Copyright (C) 2019 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "EditAction.h" >+ >+#include "LocalizedStrings.h" >+ >+namespace WebCore { >+ >+String nameForUndoRedo(EditAction editAction) >+{ >+ switch (editAction) { >+ case EditAction::Unspecified: >+ case EditAction::Insert: >+ case EditAction::InsertReplacement: >+ case EditAction::InsertFromDrop: >+ return { }; >+ case EditAction::SetColor: >+ return WEB_UI_STRING_KEY("Set Color", "Set Color (Undo action name)", "Undo action name"); >+ case EditAction::SetBackgroundColor: >+ return WEB_UI_STRING_KEY("Set Background Color", "Set Background Color (Undo action name)", "Undo action name"); >+ case EditAction::TurnOffKerning: >+ return WEB_UI_STRING_KEY("Turn Off Kerning", "Turn Off Kerning (Undo action name)", "Undo action name"); >+ case EditAction::TightenKerning: >+ return WEB_UI_STRING_KEY("Tighten Kerning", "Tighten Kerning (Undo action name)", "Undo action name"); >+ case EditAction::LoosenKerning: >+ return WEB_UI_STRING_KEY("Loosen Kerning", "Loosen Kerning (Undo action name)", "Undo action name"); >+ case EditAction::UseStandardKerning: >+ return WEB_UI_STRING_KEY("Use Standard Kerning", "Use Standard Kerning (Undo action name)", "Undo action name"); >+ case EditAction::TurnOffLigatures: >+ return WEB_UI_STRING_KEY("Turn Off Ligatures", "Turn Off Ligatures (Undo action name)", "Undo action name"); >+ case EditAction::UseStandardLigatures: >+ return WEB_UI_STRING_KEY("Use Standard Ligatures", "Use Standard Ligatures (Undo action name)", "Undo action name"); >+ case EditAction::UseAllLigatures: >+ return WEB_UI_STRING_KEY("Use All Ligatures", "Use All Ligatures (Undo action name)", "Undo action name"); >+ case EditAction::RaiseBaseline: >+ return WEB_UI_STRING_KEY("Raise Baseline", "Raise Baseline (Undo action name)", "Undo action name"); >+ case EditAction::LowerBaseline: >+ return WEB_UI_STRING_KEY("Lower Baseline", "Lower Baseline (Undo action name)", "Undo action name"); >+ case EditAction::SetTraditionalCharacterShape: >+ return WEB_UI_STRING_KEY("Set Traditional Character Shape", "Set Traditional Character Shape (Undo action name)", "Undo action name"); >+ case EditAction::SetFont: >+ return WEB_UI_STRING_KEY("Set Font", "Set Font (Undo action name)", "Undo action name"); >+ case EditAction::ChangeAttributes: >+ return WEB_UI_STRING_KEY("Change Attributes", "Change Attributes (Undo action name)", "Undo action name"); >+ case EditAction::AlignLeft: >+ return WEB_UI_STRING_KEY("Align Left", "Align Left (Undo action name)", "Undo action name"); >+ case EditAction::AlignRight: >+ return WEB_UI_STRING_KEY("Align Right", "Align Right (Undo action name)", "Undo action name"); >+ case EditAction::Center: >+ return WEB_UI_STRING_KEY("Center", "Center (Undo action name)", "Undo action name"); >+ case EditAction::Justify: >+ return WEB_UI_STRING_KEY("Justify", "Justify (Undo action name)", "Undo action name"); >+ case EditAction::SetWritingDirection: >+ return WEB_UI_STRING_KEY("Set Writing Direction", "Set Writing Direction (Undo action name)", "Undo action name"); >+ case EditAction::Subscript: >+ return WEB_UI_STRING_KEY("Subscript", "Subscript (Undo action name)", "Undo action name"); >+ case EditAction::Superscript: >+ return WEB_UI_STRING_KEY("Superscript", "Superscript (Undo action name)", "Undo action name"); >+ case EditAction::Underline: >+ return WEB_UI_STRING_KEY("Underline", "Underline (Undo action name)", "Undo action name"); >+ case EditAction::Outline: >+ return WEB_UI_STRING_KEY("Outline", "Outline (Undo action name)", "Undo action name"); >+ case EditAction::Unscript: >+ return WEB_UI_STRING_KEY("Unscript", "Unscript (Undo action name)", "Undo action name"); >+ case EditAction::DeleteByDrag: >+ return WEB_UI_STRING_KEY("Drag", "Drag (Undo action name)", "Undo action name"); >+ case EditAction::Cut: >+ return WEB_UI_STRING_KEY("Cut", "Cut (Undo action name)", "Undo action name"); >+ case EditAction::Bold: >+ return WEB_UI_STRING_KEY("Bold", "Bold (Undo action name)", "Undo action name"); >+ case EditAction::Italics: >+ return WEB_UI_STRING_KEY("Italics", "Italics (Undo action name)", "Undo action name"); >+ case EditAction::Delete: >+ return WEB_UI_STRING_KEY("Delete", "Delete (Undo action name)", "Undo action name"); >+ case EditAction::Dictation: >+ return WEB_UI_STRING_KEY("Dictation", "Dictation (Undo action name)", "Undo action name"); >+ case EditAction::Paste: >+ return WEB_UI_STRING_KEY("Paste", "Paste (Undo action name)", "Undo action name"); >+ case EditAction::PasteFont: >+ return WEB_UI_STRING_KEY("Paste Font", "Paste Font (Undo action name)", "Undo action name"); >+ case EditAction::PasteRuler: >+ return WEB_UI_STRING_KEY("Paste Ruler", "Paste Ruler (Undo action name)", "Undo action name"); >+ case EditAction::TypingDeleteSelection: >+ case EditAction::TypingDeleteBackward: >+ case EditAction::TypingDeleteForward: >+ case EditAction::TypingDeleteWordBackward: >+ case EditAction::TypingDeleteWordForward: >+ case EditAction::TypingDeleteLineBackward: >+ case EditAction::TypingDeleteLineForward: >+ case EditAction::TypingDeletePendingComposition: >+ case EditAction::TypingDeleteFinalComposition: >+ case EditAction::TypingInsertText: >+ case EditAction::TypingInsertLineBreak: >+ case EditAction::TypingInsertParagraph: >+ case EditAction::TypingInsertPendingComposition: >+ case EditAction::TypingInsertFinalComposition: >+ return WEB_UI_STRING_KEY("Typing", "Typing (Undo action name)", "Undo action name"); >+ case EditAction::CreateLink: >+ return WEB_UI_STRING_KEY("Create Link", "Create Link (Undo action name)", "Undo action name"); >+ case EditAction::Unlink: >+ return WEB_UI_STRING_KEY("Unlink", "Unlink (Undo action name)", "Undo action name"); >+ case EditAction::InsertUnorderedList: >+ case EditAction::InsertOrderedList: >+ return WEB_UI_STRING_KEY("Insert List", "Insert List (Undo action name)", "Undo action name"); >+ case EditAction::FormatBlock: >+ return WEB_UI_STRING_KEY("Formatting", "Format Block (Undo action name)", "Undo action name"); >+ case EditAction::Indent: >+ return WEB_UI_STRING_KEY("Indent", "Indent (Undo action name)", "Undo action name"); >+ case EditAction::Outdent: >+ return WEB_UI_STRING_KEY("Outdent", "Outdent (Undo action name)", "Undo action name"); >+ // FIXME: We should give internal clients a way to override these undo names. For instance, Mail refers to ordered and unordered lists as "numbered" and "bulleted" lists, respectively, >+ // despite the fact that ordered and unordered lists are not necessarily displayed using bullets and numerals. >+ case EditAction::ConvertToOrderedList: >+ return WEB_UI_STRING_KEY("Convert to Ordered List", "Convert to Ordered List (Undo action name)", "Undo action name"); >+ case EditAction::ConvertToUnorderedList: >+ return WEB_UI_STRING_KEY("Convert to Unordered List", "Convert to Unordered List (Undo action name)", "Undo action name"); >+ case EditAction::InsertEditableImage: >+ return WEB_UI_STRING_KEY("Insert Drawing", "Insert Drawing (Undo action name)", "Undo action name"); >+ } >+ return { }; >+} >+ >+} // namespace WebCore >diff --git a/Source/WebCore/editing/EditAction.h b/Source/WebCore/editing/EditAction.h >index 42464e26e63307805fd3d655d1d1db8128a560ab..b6c45daf846a649e02e2945c12c8bcfead60b76d 100644 >--- a/Source/WebCore/editing/EditAction.h >+++ b/Source/WebCore/editing/EditAction.h >@@ -25,6 +25,10 @@ > > #pragma once > >+namespace WTF { >+class String; >+} >+ > namespace WebCore { > > enum class EditAction : uint8_t { >@@ -91,4 +95,6 @@ enum class EditAction : uint8_t { > InsertEditableImage > }; > >+WEBCORE_EXPORT WTF::String nameForUndoRedo(EditAction); >+ > } // namespace WebCore >diff --git a/Source/WebCore/editing/Editor.cpp b/Source/WebCore/editing/Editor.cpp >index 8d17137bfd5476bceb4e9bd72e370fa4f538160d..5854aeb55a0f24d85855eed1260e3e3d94eaf0a3 100644 >--- a/Source/WebCore/editing/Editor.cpp >+++ b/Source/WebCore/editing/Editor.cpp >@@ -32,6 +32,8 @@ > #include "ApplyStyleCommand.h" > #include "CSSComputedStyleDeclaration.h" > #include "CSSPropertyNames.h" >+#include "CSSValueList.h" >+#include "CSSValuePool.h" > #include "CachedResourceLoader.h" > #include "ChangeListTypeCommand.h" > #include "ClipboardEvent.h" >@@ -63,8 +65,10 @@ > #include "HTMLImageElement.h" > #include "HTMLInputElement.h" > #include "HTMLNames.h" >+#include "HTMLOListElement.h" > #include "HTMLQuoteElement.h" > #include "HTMLSpanElement.h" >+#include "HTMLUListElement.h" > #include "HitTestResult.h" > #include "IndentOutdentCommand.h" > #include "InputEvent.h" >diff --git a/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm b/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm >index 45b64deb2e0b829485c2dc916a4bf102ab90c458..771972b1ac81e9665b7ce4a6a8c3d60dc356b957 100644 >--- a/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm >+++ b/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm >@@ -2677,7 +2677,7 @@ void WebViewImpl::executeEditCommandForSelector(SEL selector, const String& argu > > void WebViewImpl::registerEditCommand(Ref<WebEditCommandProxy>&& command, UndoOrRedo undoOrRedo) > { >- auto actionName = WebEditCommandProxy::nameForEditAction(command->editAction()); >+ auto actionName = WebCore::nameForUndoRedo(command->editAction()); > auto commandObjC = adoptNS([[WKEditCommand alloc] initWithWebEditCommandProxy:WTFMove(command)]); > > NSUndoManager *undoManager = [m_view undoManager]; >diff --git a/Source/WebKit/UIProcess/WebEditCommandProxy.cpp b/Source/WebKit/UIProcess/WebEditCommandProxy.cpp >index f9ac146cc0d262d7eaedf159d02cc01a6684551f..9f83e3c19d86c9f2353a7e957610a1ea5d8584b2 100644 >--- a/Source/WebKit/UIProcess/WebEditCommandProxy.cpp >+++ b/Source/WebKit/UIProcess/WebEditCommandProxy.cpp >@@ -41,13 +41,13 @@ WebEditCommandProxy::WebEditCommandProxy(WebUndoStepID commandID, WebCore::EditA > , m_editAction(editAction) > , m_page(page) > { >- m_page->addEditCommand(this); >+ m_page->addEditCommand(*this); > } > > WebEditCommandProxy::~WebEditCommandProxy() > { > if (m_page) >- m_page->removeEditCommand(this); >+ m_page->removeEditCommand(*this); > } > > void WebEditCommandProxy::unapply() >@@ -68,119 +68,4 @@ void WebEditCommandProxy::reapply() > m_page->registerEditCommand(*this, UndoOrRedo::Undo); > } > >-String WebEditCommandProxy::nameForEditAction(EditAction editAction) >-{ >- // FIXME: This is identical to code in WebKit's WebEditorClient class; would be nice to share the strings instead of having two copies. >- switch (editAction) { >- case EditAction::Unspecified: >- case EditAction::Insert: >- case EditAction::InsertReplacement: >- case EditAction::InsertFromDrop: >- return String(); >- case EditAction::SetColor: >- return WEB_UI_STRING_KEY("Set Color", "Set Color (Undo action name)", "Undo action name"); >- case EditAction::SetBackgroundColor: >- return WEB_UI_STRING_KEY("Set Background Color", "Set Background Color (Undo action name)", "Undo action name"); >- case EditAction::TurnOffKerning: >- return WEB_UI_STRING_KEY("Turn Off Kerning", "Turn Off Kerning (Undo action name)", "Undo action name"); >- case EditAction::TightenKerning: >- return WEB_UI_STRING_KEY("Tighten Kerning", "Tighten Kerning (Undo action name)", "Undo action name"); >- case EditAction::LoosenKerning: >- return WEB_UI_STRING_KEY("Loosen Kerning", "Loosen Kerning (Undo action name)", "Undo action name"); >- case EditAction::UseStandardKerning: >- return WEB_UI_STRING_KEY("Use Standard Kerning", "Use Standard Kerning (Undo action name)", "Undo action name"); >- case EditAction::TurnOffLigatures: >- return WEB_UI_STRING_KEY("Turn Off Ligatures", "Turn Off Ligatures (Undo action name)", "Undo action name"); >- case EditAction::UseStandardLigatures: >- return WEB_UI_STRING_KEY("Use Standard Ligatures", "Use Standard Ligatures (Undo action name)", "Undo action name"); >- case EditAction::UseAllLigatures: >- return WEB_UI_STRING_KEY("Use All Ligatures", "Use All Ligatures (Undo action name)", "Undo action name"); >- case EditAction::RaiseBaseline: >- return WEB_UI_STRING_KEY("Raise Baseline", "Raise Baseline (Undo action name)", "Undo action name"); >- case EditAction::LowerBaseline: >- return WEB_UI_STRING_KEY("Lower Baseline", "Lower Baseline (Undo action name)", "Undo action name"); >- case EditAction::SetTraditionalCharacterShape: >- return WEB_UI_STRING_KEY("Set Traditional Character Shape", "Set Traditional Character Shape (Undo action name)", "Undo action name"); >- case EditAction::SetFont: >- return WEB_UI_STRING_KEY("Set Font", "Set Font (Undo action name)", "Undo action name"); >- case EditAction::ChangeAttributes: >- return WEB_UI_STRING_KEY("Change Attributes", "Change Attributes (Undo action name)", "Undo action name"); >- case EditAction::AlignLeft: >- return WEB_UI_STRING_KEY("Align Left", "Align Left (Undo action name)", "Undo action name"); >- case EditAction::AlignRight: >- return WEB_UI_STRING_KEY("Align Right", "Align Right (Undo action name)", "Undo action name"); >- case EditAction::Center: >- return WEB_UI_STRING_KEY("Center", "Center (Undo action name)", "Undo action name"); >- case EditAction::Justify: >- return WEB_UI_STRING_KEY("Justify", "Justify (Undo action name)", "Undo action name"); >- case EditAction::SetWritingDirection: >- return WEB_UI_STRING_KEY("Set Writing Direction", "Set Writing Direction (Undo action name)", "Undo action name"); >- case EditAction::Subscript: >- return WEB_UI_STRING_KEY("Subscript", "Subscript (Undo action name)", "Undo action name"); >- case EditAction::Superscript: >- return WEB_UI_STRING_KEY("Superscript", "Superscript (Undo action name)", "Undo action name"); >- case EditAction::Underline: >- return WEB_UI_STRING_KEY("Underline", "Underline (Undo action name)", "Undo action name"); >- case EditAction::Outline: >- return WEB_UI_STRING_KEY("Outline", "Outline (Undo action name)", "Undo action name"); >- case EditAction::Unscript: >- return WEB_UI_STRING_KEY("Unscript", "Unscript (Undo action name)", "Undo action name"); >- case EditAction::DeleteByDrag: >- return WEB_UI_STRING_KEY("Drag", "Drag (Undo action name)", "Undo action name"); >- case EditAction::Cut: >- return WEB_UI_STRING_KEY("Cut", "Cut (Undo action name)", "Undo action name"); >- case EditAction::Bold: >- return WEB_UI_STRING_KEY("Bold", "Bold (Undo action name)", "Undo action name"); >- case EditAction::Italics: >- return WEB_UI_STRING_KEY("Italics", "Italics (Undo action name)", "Undo action name"); >- case EditAction::Delete: >- return WEB_UI_STRING_KEY("Delete", "Delete (Undo action name)", "Undo action name"); >- case EditAction::Dictation: >- return WEB_UI_STRING_KEY("Dictation", "Dictation (Undo action name)", "Undo action name"); >- case EditAction::Paste: >- return WEB_UI_STRING_KEY("Paste", "Paste (Undo action name)", "Undo action name"); >- case EditAction::PasteFont: >- return WEB_UI_STRING_KEY("Paste Font", "Paste Font (Undo action name)", "Undo action name"); >- case EditAction::PasteRuler: >- return WEB_UI_STRING_KEY("Paste Ruler", "Paste Ruler (Undo action name)", "Undo action name"); >- case EditAction::TypingDeleteSelection: >- case EditAction::TypingDeleteBackward: >- case EditAction::TypingDeleteForward: >- case EditAction::TypingDeleteWordBackward: >- case EditAction::TypingDeleteWordForward: >- case EditAction::TypingDeleteLineBackward: >- case EditAction::TypingDeleteLineForward: >- case EditAction::TypingDeletePendingComposition: >- case EditAction::TypingDeleteFinalComposition: >- case EditAction::TypingInsertText: >- case EditAction::TypingInsertLineBreak: >- case EditAction::TypingInsertParagraph: >- case EditAction::TypingInsertPendingComposition: >- case EditAction::TypingInsertFinalComposition: >- return WEB_UI_STRING_KEY("Typing", "Typing (Undo action name)", "Undo action name"); >- case EditAction::CreateLink: >- return WEB_UI_STRING_KEY("Create Link", "Create Link (Undo action name)", "Undo action name"); >- case EditAction::Unlink: >- return WEB_UI_STRING_KEY("Unlink", "Unlink (Undo action name)", "Undo action name"); >- case EditAction::InsertUnorderedList: >- case EditAction::InsertOrderedList: >- return WEB_UI_STRING_KEY("Insert List", "Insert List (Undo action name)", "Undo action name"); >- case EditAction::FormatBlock: >- return WEB_UI_STRING_KEY("Formatting", "Format Block (Undo action name)", "Undo action name"); >- case EditAction::Indent: >- return WEB_UI_STRING_KEY("Indent", "Indent (Undo action name)", "Undo action name"); >- case EditAction::Outdent: >- return WEB_UI_STRING_KEY("Outdent", "Outdent (Undo action name)", "Undo action name"); >- // FIXME: We should give internal clients a way to override these undo names. For instance, Mail refers to ordered and unordered lists as "numbered" and "bulleted" lists, respectively, >- // despite the fact that ordered and unordered lists are not necessarily displayed using bullets and numerals. >- case EditAction::ConvertToOrderedList: >- return WEB_UI_STRING_KEY("Convert to Ordered List", "Convert to Ordered List (Undo action name)", "Undo action name"); >- case EditAction::ConvertToUnorderedList: >- return WEB_UI_STRING_KEY("Convert to Unordered List", "Convert to Unordered List (Undo action name)", "Undo action name"); >- case EditAction::InsertEditableImage: >- return WEB_UI_STRING_KEY("Insert Drawing", "Insert Drawing (Undo action name)", "Undo action name"); >- } >- return String(); >-} >- > } // namespace WebKit >diff --git a/Source/WebKit/UIProcess/WebEditCommandProxy.h b/Source/WebKit/UIProcess/WebEditCommandProxy.h >index b4e767f63f13b82270f2afd9cf7a23a33667900c..716cb58f403dd823196f8642f75f4df3d71aa8ca 100644 >--- a/Source/WebKit/UIProcess/WebEditCommandProxy.h >+++ b/Source/WebKit/UIProcess/WebEditCommandProxy.h >@@ -52,8 +52,6 @@ public: > void unapply(); > void reapply(); > >- static String nameForEditAction(WebCore::EditAction); >- > private: > WebEditCommandProxy(WebUndoStepID commandID, WebCore::EditAction, WebPageProxy*); > >diff --git a/Source/WebKit/UIProcess/WebPageProxy.cpp b/Source/WebKit/UIProcess/WebPageProxy.cpp >index da7a94a33d81935ca14320734688cc98973a5482..e73c27695e838bdea6f92a9c6db2ba8fd3a1669a 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.cpp >+++ b/Source/WebKit/UIProcess/WebPageProxy.cpp >@@ -5711,18 +5711,18 @@ void WebPageProxy::registerEditCommand(Ref<WebEditCommandProxy>&& commandProxy, > pageClient().registerEditCommand(WTFMove(commandProxy), undoOrRedo); > } > >-void WebPageProxy::addEditCommand(WebEditCommandProxy* command) >+void WebPageProxy::addEditCommand(WebEditCommandProxy& command) > { >- m_editCommandSet.add(command); >+ m_editCommandSet.add(&command); > } > >-void WebPageProxy::removeEditCommand(WebEditCommandProxy* command) >+void WebPageProxy::removeEditCommand(WebEditCommandProxy& command) > { >- m_editCommandSet.remove(command); >+ m_editCommandSet.remove(&command); > > if (!isValid()) > return; >- m_process->send(Messages::WebPage::DidRemoveEditCommand(command->commandID()), m_pageID); >+ m_process->send(Messages::WebPage::DidRemoveEditCommand(command.commandID()), m_pageID); > } > > bool WebPageProxy::canUndo() >@@ -5735,11 +5735,6 @@ bool WebPageProxy::canRedo() > return pageClient().canUndoRedo(UndoOrRedo::Redo); > } > >-bool WebPageProxy::isValidEditCommand(WebEditCommandProxy* command) >-{ >- return m_editCommandSet.find(command) != m_editCommandSet.end(); >-} >- > SpellDocumentTag WebPageProxy::spellDocumentTag() > { > if (!m_spellDocumentTag) >diff --git a/Source/WebKit/UIProcess/WebPageProxy.h b/Source/WebKit/UIProcess/WebPageProxy.h >index 18bf8101a0edd2b4a0fe98760def4388b3403018..9d621cff9d0c0b470377aebd02cde7a80a756c06 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.h >+++ b/Source/WebKit/UIProcess/WebPageProxy.h >@@ -1007,9 +1007,8 @@ public: > virtual void exitAcceleratedCompositingMode(); > virtual void updateAcceleratedCompositingMode(const LayerTreeContext&); > >- void addEditCommand(WebEditCommandProxy*); >- void removeEditCommand(WebEditCommandProxy*); >- bool isValidEditCommand(WebEditCommandProxy*); >+ void addEditCommand(WebEditCommandProxy&); >+ void removeEditCommand(WebEditCommandProxy&); > void registerEditCommand(Ref<WebEditCommandProxy>&&, UndoOrRedo); > > bool canUndo(); >diff --git a/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm b/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm >index 421521b7483bec1dd9198a3b0bb5eed154d6574f..5bbc8329e9885d94a8c6c4dd29959c2892065977 100644 >--- a/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm >+++ b/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm >@@ -265,7 +265,7 @@ void PageClientImpl::didChangeViewportProperties(const ViewportAttributes&) > > void PageClientImpl::registerEditCommand(Ref<WebEditCommandProxy>&& command, UndoOrRedo undoOrRedo) > { >- auto actionName = WebEditCommandProxy::nameForEditAction(command->editAction()); >+ auto actionName = WebCore::nameForUndoRedo(command->editAction()); > auto commandObjC = adoptNS([[WKEditCommand alloc] initWithWebEditCommandProxy:WTFMove(command)]); > > NSUndoManager *undoManager = [m_contentView undoManager]; >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.mm b/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.mm >index 089f039e7c538576aeb776577c971207430b9195..69b767ae7d74de1e6d27d9b169226fcedcb4c719 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.mm >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.mm >@@ -589,77 +589,6 @@ bool WebEditorClient::shouldInsertNode(Node *node, Range* replacingRange, Editor > return [[m_webView _editingDelegateForwarder] webView:m_webView shouldInsertNode:kit(node) replacingDOMRange:kit(replacingRange) givenAction:(WebViewInsertAction)givenAction]; > } > >-static NSString* undoNameForEditAction(EditAction editAction) >-{ >- // FIXME: This is identical to code in WebKit2's WebEditCommandProxy class; would be nice to share the strings instead of having two copies. >- switch (editAction) { >- case EditAction::Unspecified: return nil; >- case EditAction::Insert: return nil; >- case EditAction::InsertReplacement: return nil; >- case EditAction::InsertFromDrop: return nil; >- case EditAction::SetColor: return UI_STRING_KEY_INTERNAL("Set Color", "Set Color (Undo action name)", "Undo action name"); >- case EditAction::SetBackgroundColor: return UI_STRING_KEY_INTERNAL("Set Background Color", "Set Background Color (Undo action name)", "Undo action name"); >- case EditAction::TurnOffKerning: return UI_STRING_KEY_INTERNAL("Turn Off Kerning", "Turn Off Kerning (Undo action name)", "Undo action name"); >- case EditAction::TightenKerning: return UI_STRING_KEY_INTERNAL("Tighten Kerning", "Tighten Kerning (Undo action name)", "Undo action name"); >- case EditAction::LoosenKerning: return UI_STRING_KEY_INTERNAL("Loosen Kerning", "Loosen Kerning (Undo action name)", "Undo action name"); >- case EditAction::UseStandardKerning: return UI_STRING_KEY_INTERNAL("Use Standard Kerning", "Use Standard Kerning (Undo action name)", "Undo action name"); >- case EditAction::TurnOffLigatures: return UI_STRING_KEY_INTERNAL("Turn Off Ligatures", "Turn Off Ligatures (Undo action name)", "Undo action name"); >- case EditAction::UseStandardLigatures: return UI_STRING_KEY_INTERNAL("Use Standard Ligatures", "Use Standard Ligatures (Undo action name)", "Undo action name"); >- case EditAction::UseAllLigatures: return UI_STRING_KEY_INTERNAL("Use All Ligatures", "Use All Ligatures (Undo action name)", "Undo action name"); >- case EditAction::RaiseBaseline: return UI_STRING_KEY_INTERNAL("Raise Baseline", "Raise Baseline (Undo action name)", "Undo action name"); >- case EditAction::LowerBaseline: return UI_STRING_KEY_INTERNAL("Lower Baseline", "Lower Baseline (Undo action name)", "Undo action name"); >- case EditAction::SetTraditionalCharacterShape: return UI_STRING_KEY_INTERNAL("Set Traditional Character Shape", "Set Traditional Character Shape (Undo action name)", "Undo action name"); >- case EditAction::SetFont: return UI_STRING_KEY_INTERNAL("Set Font", "Set Font (Undo action name)", "Undo action name"); >- case EditAction::ChangeAttributes: return UI_STRING_KEY_INTERNAL("Change Attributes", "Change Attributes (Undo action name)", "Undo action name"); >- case EditAction::AlignLeft: return UI_STRING_KEY_INTERNAL("Align Left", "Align Left (Undo action name)", "Undo action name"); >- case EditAction::AlignRight: return UI_STRING_KEY_INTERNAL("Align Right", "Align Right (Undo action name)", "Undo action name"); >- case EditAction::Center: return UI_STRING_KEY_INTERNAL("Center", "Center (Undo action name)", "Undo action name"); >- case EditAction::Justify: return UI_STRING_KEY_INTERNAL("Justify", "Justify (Undo action name)", "Undo action name"); >- case EditAction::SetWritingDirection: return UI_STRING_KEY_INTERNAL("Set Writing Direction", "Set Writing Direction (Undo action name)", "Undo action name"); >- case EditAction::Subscript: return UI_STRING_KEY_INTERNAL("Subscript", "Subscript (Undo action name)", "Undo action name"); >- case EditAction::Superscript: return UI_STRING_KEY_INTERNAL("Superscript", "Superscript (Undo action name)", "Undo action name"); >- case EditAction::Underline: return UI_STRING_KEY_INTERNAL("Underline", "Underline (Undo action name)", "Undo action name"); >- case EditAction::Outline: return UI_STRING_KEY_INTERNAL("Outline", "Outline (Undo action name)", "Undo action name"); >- case EditAction::Unscript: return UI_STRING_KEY_INTERNAL("Unscript", "Unscript (Undo action name)", "Undo action name"); >- case EditAction::DeleteByDrag: return UI_STRING_KEY_INTERNAL("Drag", "Drag (Undo action name)", "Undo action name"); >- case EditAction::Cut: return UI_STRING_KEY_INTERNAL("Cut", "Cut (Undo action name)", "Undo action name"); >- case EditAction::Paste: return UI_STRING_KEY_INTERNAL("Paste", "Paste (Undo action name)", "Undo action name"); >- case EditAction::PasteFont: return UI_STRING_KEY_INTERNAL("Paste Font", "Paste Font (Undo action name)", "Undo action name"); >- case EditAction::PasteRuler: return UI_STRING_KEY_INTERNAL("Paste Ruler", "Paste Ruler (Undo action name)", "Undo action name"); >- case EditAction::TypingDeleteSelection: >- case EditAction::TypingDeleteBackward: >- case EditAction::TypingDeleteForward: >- case EditAction::TypingDeleteWordBackward: >- case EditAction::TypingDeleteWordForward: >- case EditAction::TypingDeleteLineBackward: >- case EditAction::TypingDeleteLineForward: >- case EditAction::TypingDeletePendingComposition: >- case EditAction::TypingDeleteFinalComposition: >- case EditAction::TypingInsertText: >- case EditAction::TypingInsertLineBreak: >- case EditAction::TypingInsertParagraph: >- case EditAction::TypingInsertPendingComposition: >- case EditAction::TypingInsertFinalComposition: >- return UI_STRING_KEY_INTERNAL("Typing", "Typing (Undo action name)", "Undo action name"); >- case EditAction::CreateLink: return UI_STRING_KEY_INTERNAL("Create Link", "Create Link (Undo action name)", "Undo action name"); >- case EditAction::Unlink: return UI_STRING_KEY_INTERNAL("Unlink", "Unlink (Undo action name)", "Undo action name"); >- case EditAction::InsertOrderedList: >- case EditAction::InsertUnorderedList: >- return UI_STRING_KEY_INTERNAL("Insert List", "Insert List (Undo action name)", "Undo action name"); >- case EditAction::FormatBlock: return UI_STRING_KEY_INTERNAL("Formatting", "Format Block (Undo action name)", "Undo action name"); >- case EditAction::Indent: return UI_STRING_KEY_INTERNAL("Indent", "Indent (Undo action name)", "Undo action name"); >- case EditAction::Outdent: return UI_STRING_KEY_INTERNAL("Outdent", "Outdent (Undo action name)", "Undo action name"); >- case EditAction::Bold: return UI_STRING_KEY_INTERNAL("Bold", "Bold (Undo action name)", "Undo action name"); >- case EditAction::Italics: return UI_STRING_KEY_INTERNAL("Italics", "Italics (Undo action name)", "Undo action name"); >- case EditAction::Delete: return UI_STRING_KEY_INTERNAL("Delete", "Delete (Undo action name)", "Undo action name"); >- case EditAction::Dictation: return UI_STRING_KEY_INTERNAL("Dictation", "Dictation (Undo action name)", "Undo action name"); >- case EditAction::ConvertToOrderedList: return UI_STRING_KEY_INTERNAL("Convert to Ordered List", "Convert to Ordered List (Undo action name)", "Undo action name"); >- case EditAction::ConvertToUnorderedList: return UI_STRING_KEY_INTERNAL("Convert to Unordered List", "Convert to Unordered List (Undo action name)", "Undo action name"); >- case EditAction::InsertEditableImage: return UI_STRING_KEY_INTERNAL("Insert Drawing", "Insert Drawing (Undo action name)", "Undo action name"); >- } >- return nil; >-} >- > void WebEditorClient::registerUndoOrRedoStep(UndoStep& step, bool isRedo) > { > NSUndoManager *undoManager = [m_webView undoManager]; >@@ -672,7 +601,7 @@ void WebEditorClient::registerUndoOrRedoStep(UndoStep& step, bool isRedo) > return; > #endif > >- NSString *actionName = undoNameForEditAction(step.editingAction()); >+ NSString *actionName = WebCore::nameForUndoRedo(step.editingAction()); > WebUndoStep *webEntry = [WebUndoStep stepWithUndoStep:step]; > [undoManager registerUndoWithTarget:m_undoTarget.get() selector:(isRedo ? @selector(redoEditing:) : @selector(undoEditing:)) object:webEntry]; > if (actionName)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193129
: 358300