WebKit Bugzilla
Attachment 369424 Details for
Bug 197710
: Pass insertTextAsync options as a struct
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-197710-20190508143702.patch (text/plain), 23.50 KB, created by
Daniel Bates
on 2019-05-08 14:37:03 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Daniel Bates
Created:
2019-05-08 14:37:03 PDT
Size:
23.50 KB
patch
obsolete
>Subversion Revision: 244742 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 162e8b72e0d53eca3e5c737167b949e349c2175e..adab64b456fa783e77699ad0b5c7e0d610b6657c 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,36 @@ >+2019-05-08 Daniel Bates <dabates@apple.com> >+ >+ Pass insertTextAsync options as a struct >+ https://bugs.webkit.org/show_bug.cgi?id=197710 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ WebPageProxy::insertTextAsync() is becoming unwieldy to work with given the large number of >+ optional arguments that can be passed to it. Let's pass a struct instead. >+ >+ * Shared/Cocoa/InsertTextOptions.cpp: Added. >+ (IPC::ArgumentCoder<WebKit::InsertTextOptions>::encode): >+ (IPC::ArgumentCoder<WebKit::InsertTextOptions>::decode): >+ * Shared/Cocoa/InsertTextOptions.h: Added. >+ * Shared/EditingRange.h: Add EnumTrait so that we can encode the EditingRangeIsRelativeTo >+ enumeration. >+ * SourcesCocoa.txt: Add a new file. >+ * UIProcess/Cocoa/WebViewImpl.mm: >+ (WebKit::WebViewImpl::insertText): Update code now that we pass a struct. >+ (WebKit::WebViewImpl::setMarkedText): Ditto. >+ * UIProcess/WebPageProxy.cpp: >+ (WebKit::WebPageProxy::insertTextAsync): Ditto. >+ * UIProcess/WebPageProxy.h: >+ * UIProcess/ios/WKContentViewInteraction.mm: >+ (-[WKContentView insertText:]): Ditto. >+ * UIProcess/mac/WebPageProxyMac.mm: >+ (WebKit::WebPageProxy::insertDictatedTextAsync): Ditto. >+ * WebKit.xcodeproj/project.pbxproj: Add new files. >+ * WebProcess/WebPage/WebPage.cpp: >+ (WebKit::WebPage::insertTextAsync): Ditto. >+ * WebProcess/WebPage/WebPage.h: >+ * WebProcess/WebPage/WebPage.messages.in: Ditto. >+ > 2019-05-03 Daniel Bates <dabates@apple.com> > > Google Docs & Yahoo! Japan: Canât compose characters with Chinese or Japanese keyboard >diff --git a/Source/WebKit/Shared/Cocoa/InsertTextOptions.cpp b/Source/WebKit/Shared/Cocoa/InsertTextOptions.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..4000efdc73baf6279bfa42e3c5e85c5efb437962 >--- /dev/null >+++ b/Source/WebKit/Shared/Cocoa/InsertTextOptions.cpp >@@ -0,0 +1,50 @@ >+/* >+ * 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 "InsertTextOptions.h" >+ >+namespace IPC { >+ >+void ArgumentCoder<WebKit::InsertTextOptions>::encode(Encoder& encoder, const WebKit::InsertTextOptions& options) >+{ >+ encoder << options.registerUndoGroup; >+ encoder << options.suppressSelectionUpdate; >+ encoder << options.editingRangeIsRelativeTo; >+} >+ >+Optional<WebKit::InsertTextOptions> ArgumentCoder<WebKit::InsertTextOptions>::decode(Decoder& decoder) >+{ >+ WebKit::InsertTextOptions options; >+ if (!decoder.decode(options.registerUndoGroup)) >+ return WTF::nullopt; >+ if (!decoder.decode(options.suppressSelectionUpdate)) >+ return WTF::nullopt; >+ if (!decoder.decode(options.editingRangeIsRelativeTo)) >+ return WTF::nullopt; >+ return options; >+} >+ >+} // namespace IPC >diff --git a/Source/WebKit/Shared/Cocoa/InsertTextOptions.h b/Source/WebKit/Shared/Cocoa/InsertTextOptions.h >new file mode 100644 >index 0000000000000000000000000000000000000000..b169520ae305fb679a7b8e31af57bbf1418e3f97 >--- /dev/null >+++ b/Source/WebKit/Shared/Cocoa/InsertTextOptions.h >@@ -0,0 +1,46 @@ >+/* >+ * 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. >+ */ >+ >+#pragma once >+ >+#include "ArgumentCoders.h" >+#include "EditingRange.h" >+ >+namespace WebKit { >+ >+struct InsertTextOptions { >+ bool registerUndoGroup { false }; >+ bool suppressSelectionUpdate { false }; >+ EditingRangeIsRelativeTo editingRangeIsRelativeTo { EditingRangeIsRelativeTo::EditableRoot }; >+}; >+ >+} // namespace WebKit >+ >+namespace IPC { >+template<> struct ArgumentCoder<WebKit::InsertTextOptions> { >+ static void encode(Encoder&, const WebKit::InsertTextOptions&); >+ static Optional<WebKit::InsertTextOptions> decode(Decoder&); >+}; >+} >diff --git a/Source/WebKit/Shared/EditingRange.h b/Source/WebKit/Shared/EditingRange.h >index 1f56aeff2928963f13bb24a0816f27f88e12426f..94738b7f88e9e058da2ed254a16044ebc6b93069 100644 >--- a/Source/WebKit/Shared/EditingRange.h >+++ b/Source/WebKit/Shared/EditingRange.h >@@ -26,6 +26,7 @@ > #pragma once > > #include "ArgumentCoders.h" >+#include <wtf/EnumTraits.h> > #include <wtf/RefPtr.h> > > namespace WebCore { >@@ -91,3 +92,9 @@ template<> struct ArgumentCoder<WebKit::EditingRange> { > static Optional<WebKit::EditingRange> decode(Decoder&); > }; > } >+ >+namespace WTF { >+template<> struct EnumTraits<WebKit::EditingRangeIsRelativeTo> { >+ using values = EnumValues<WebKit::EditingRangeIsRelativeTo, WebKit::EditingRangeIsRelativeTo::EditableRoot, WebKit::EditingRangeIsRelativeTo::Paragraph>; >+}; >+} >diff --git a/Source/WebKit/SourcesCocoa.txt b/Source/WebKit/SourcesCocoa.txt >index b404e3abeb4136681468fae814c1b4208ee162df..536869b06f26d156b5f37107fed06f8237a25c8f 100644 >--- a/Source/WebKit/SourcesCocoa.txt >+++ b/Source/WebKit/SourcesCocoa.txt >@@ -142,6 +142,7 @@ Shared/Cocoa/ArgumentCodersCocoa.mm > Shared/Cocoa/AuxiliaryProcessCocoa.mm > Shared/Cocoa/CompletionHandlerCallChecker.mm > Shared/Cocoa/DataDetectionResult.mm >+Shared/Cocoa/InsertTextOptions.cpp > Shared/Cocoa/LoadParametersCocoa.mm > Shared/Cocoa/SharedRingBufferStorage.cpp > Shared/Cocoa/WebCoreArgumentCodersCocoa.mm >diff --git a/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm b/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm >index eebe02c941ef5953a67a3b7fb9124af46fd36ef4..4dffc52164023a0194f7f11cbd3c710de2b00215 100644 >--- a/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm >+++ b/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm >@@ -36,6 +36,7 @@ > #import "ColorSpaceData.h" > #import "FullscreenClient.h" > #import "GenericCallback.h" >+#import "InsertTextOptions.h" > #import "Logging.h" > #import "NativeWebGestureEvent.h" > #import "NativeWebKeyboardEvent.h" >@@ -4759,8 +4760,14 @@ void WebViewImpl::insertText(id string, NSRange replacementRange) > eventText.replace(NSBackTabCharacter, NSTabCharacter); // same thing is done in KeyEventMac.mm in WebCore > if (!dictationAlternatives.isEmpty()) > m_page->insertDictatedTextAsync(eventText, replacementRange, dictationAlternatives, registerUndoGroup); >- else >- m_page->insertTextAsync(eventText, replacementRange, registerUndoGroup, m_isTextInsertionReplacingSoftSpace ? EditingRangeIsRelativeTo::Paragraph : EditingRangeIsRelativeTo::EditableRoot, m_isTextInsertionReplacingSoftSpace); >+ else { >+ InsertTextOptions options; >+ options.registerUndoGroup = registerUndoGroup; >+ options.suppressSelectionUpdate = m_isTextInsertionReplacingSoftSpace ? EditingRangeIsRelativeTo::Paragraph : EditingRangeIsRelativeTo::EditableRoot; >+ options.suppressSelectionUpdate = m_isTextInsertionReplacingSoftSpace; >+ >+ m_page->insertTextAsync(eventText, replacementRange, WTFMove(options)); >+ } > } > > void WebViewImpl::selectedRangeWithCompletionHandler(void(^completionHandlerPtr)(NSRange selectedRange)) >@@ -4957,7 +4964,7 @@ void WebViewImpl::setMarkedText(id string, NSRange selectedRange, NSRange replac > notifyInputContextAboutDiscardedComposition(); > // FIXME: We should store the command to handle it after DOM event processing, as it's regular keyboard input now, not a composition. > if ([text length] == 1 && isASCII([text characterAtIndex:0])) >- m_page->insertTextAsync(text, replacementRange); >+ m_page->insertTextAsync(text, replacementRange, { }); > else > NSBeep(); > return; >diff --git a/Source/WebKit/UIProcess/WebPageProxy.cpp b/Source/WebKit/UIProcess/WebPageProxy.cpp >index 3d2c9e1707824f058f873d7a91a43529dade7846..ffbedaeb34abf3e01ca32d4ec5923e77a207b55c 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.cpp >+++ b/Source/WebKit/UIProcess/WebPageProxy.cpp >@@ -61,6 +61,7 @@ > #include "EventDispatcherMessages.h" > #include "FormDataReference.h" > #include "FrameInfoData.h" >+#include "InsertTextOptions.h" > #include "LoadParameters.h" > #include "Logging.h" > #include "NativeWebGestureEvent.h" >@@ -7878,12 +7879,12 @@ void WebPageProxy::setTextAsync(const String& text) > process().send(Messages::WebPage::SetTextAsync(text), m_pageID); > } > >-void WebPageProxy::insertTextAsync(const String& text, const EditingRange& replacementRange, bool registerUndoGroup, EditingRangeIsRelativeTo editingRangeIsRelativeTo, bool suppressSelectionUpdate) >+void WebPageProxy::insertTextAsync(const String& text, const EditingRange& replacementRange, InsertTextOptions&& options) > { > if (!hasRunningProcess()) > return; > >- process().send(Messages::WebPage::InsertTextAsync(text, replacementRange, registerUndoGroup, static_cast<uint32_t>(editingRangeIsRelativeTo), suppressSelectionUpdate), m_pageID); >+ process().send(Messages::WebPage::InsertTextAsync(text, replacementRange, WTFMove(options)), m_pageID); > } > > void WebPageProxy::getMarkedRangeAsync(WTF::Function<void (EditingRange, CallbackBase::Error)>&& callbackFunction) >diff --git a/Source/WebKit/UIProcess/WebPageProxy.h b/Source/WebKit/UIProcess/WebPageProxy.h >index 7c277b6d84c665055918f08e2bd264f69bc5c686..94decdab843e458b0500b3555f7a7b497ce8d273 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.h >+++ b/Source/WebKit/UIProcess/WebPageProxy.h >@@ -283,6 +283,7 @@ struct DocumentEditingContextRequest; > struct EditingRange; > struct EditorState; > struct FrameInfoData; >+struct InsertTextOptions; > struct InteractionInformationRequest; > struct LoadParameters; > struct PlatformPopupMenuData; >@@ -762,7 +763,7 @@ public: > CALayer *acceleratedCompositingRootLayer() const; > > void setTextAsync(const String&); >- void insertTextAsync(const String& text, const EditingRange& replacementRange, bool registerUndoGroup = false, EditingRangeIsRelativeTo = EditingRangeIsRelativeTo::EditableRoot, bool suppressSelectionUpdate = false); >+ void insertTextAsync(const String& text, const EditingRange& replacementRange, InsertTextOptions&&); > void getMarkedRangeAsync(WTF::Function<void (EditingRange, CallbackBase::Error)>&&); > void getSelectedRangeAsync(WTF::Function<void (EditingRange, CallbackBase::Error)>&&); > void characterIndexForPointAsync(const WebCore::IntPoint&, WTF::Function<void (uint64_t, CallbackBase::Error)>&&); >diff --git a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >index 6fec1dd7285055f14a844cbc2717f28cb1cdadf0..03d24f631e8bacaa84ba76f857cdefb82c723837 100644 >--- a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >+++ b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >@@ -31,8 +31,8 @@ > #import "APIUIClient.h" > #import "DocumentEditingContext.h" > #import "EditableImageController.h" >-#import "EditingRange.h" > #import "InputViewUpdateDeferrer.h" >+#import "InsertTextOptions.h" > #import "Logging.h" > #import "NativeWebKeyboardEvent.h" > #import "NativeWebTouchEvent.h" >@@ -4152,7 +4152,7 @@ - (void)deleteBackward > // Inserts the given string, replacing any selected or marked text. > - (void)insertText:(NSString *)aStringValue > { >- _page->insertTextAsync(aStringValue, WebKit::EditingRange()); >+ _page->insertTextAsync(aStringValue, WebKit::EditingRange(), { }); > } > > - (BOOL)hasText >diff --git a/Source/WebKit/UIProcess/mac/WebPageProxyMac.mm b/Source/WebKit/UIProcess/mac/WebPageProxyMac.mm >index 138d132ac1f316294cd63db89417933e8c5ffe54..a803d273db4b09c3084a25ab822037d4b56f83b4 100644 >--- a/Source/WebKit/UIProcess/mac/WebPageProxyMac.mm >+++ b/Source/WebKit/UIProcess/mac/WebPageProxyMac.mm >@@ -32,8 +32,8 @@ > #import "AttributedString.h" > #import "ColorSpaceData.h" > #import "DataReference.h" >-#import "EditingRange.h" > #import "EditorState.h" >+#import "InsertTextOptions.h" > #import "MenuUtilities.h" > #import "NativeWebKeyboardEvent.h" > #import "PDFContextMenu.h" >@@ -198,13 +198,19 @@ void WebPageProxy::insertDictatedTextAsync(const String& text, const EditingRang > } > > if (dictationAlternatives.isEmpty()) { >- insertTextAsync(text, replacementRange, registerUndoGroup); >+ InsertTextOptions options; >+ options.registerUndoGroup = registerUndoGroup; >+ >+ insertTextAsync(text, replacementRange, WTFMove(options)); > return; > } > > process().send(Messages::WebPage::InsertDictatedTextAsync(text, replacementRange, dictationAlternatives, registerUndoGroup), m_pageID); > #else >- insertTextAsync(text, replacementRange, registerUndoGroup); >+ InsertTextOptions options; >+ options.registerUndoGroup = registerUndoGroup; >+ >+ insertTextAsync(text, replacementRange, WTFMove(options)); > #endif > } > >diff --git a/Source/WebKit/WebKit.xcodeproj/project.pbxproj b/Source/WebKit/WebKit.xcodeproj/project.pbxproj >index 8eec4323b4985c223994e11debde6c526e718826..08bd9106c7e10e7222b3ce13b491cb678e2cba5f 100644 >--- a/Source/WebKit/WebKit.xcodeproj/project.pbxproj >+++ b/Source/WebKit/WebKit.xcodeproj/project.pbxproj >@@ -1594,6 +1594,7 @@ > CE1A0BD51A48E6C60054EF74 /* ManagedConfigurationSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE1A0BCF1A48E6C60054EF74 /* ManagedConfigurationSPI.h */; }; > CE1A0BD61A48E6C60054EF74 /* TCCSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE1A0BD01A48E6C60054EF74 /* TCCSPI.h */; }; > CE1A0BD71A48E6C60054EF74 /* TextInputSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE1A0BD11A48E6C60054EF74 /* TextInputSPI.h */; }; >+ CE550E152283752200D28791 /* InsertTextOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = CE550E12228373C800D28791 /* InsertTextOptions.h */; }; > CE5B4C8821B73D870022E64F /* WKSyntheticFlagsChangedWebEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = CE5B4C8621B73D870022E64F /* WKSyntheticFlagsChangedWebEvent.h */; }; > CE70EE5D22442BD000E0AF0F /* WKFormPeripheralBase.h in Headers */ = {isa = PBXBuildFile; fileRef = CE70EE5C22442BD000E0AF0F /* WKFormPeripheralBase.h */; }; > CEC8F9CB1FDF5870002635E7 /* WKWebProcessPlugInNodeHandlePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = CEC8F9CA1FDF5870002635E7 /* WKWebProcessPlugInNodeHandlePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; >@@ -4499,6 +4500,8 @@ > CE1A0BCF1A48E6C60054EF74 /* ManagedConfigurationSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ManagedConfigurationSPI.h; sourceTree = "<group>"; }; > CE1A0BD01A48E6C60054EF74 /* TCCSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TCCSPI.h; sourceTree = "<group>"; }; > CE1A0BD11A48E6C60054EF74 /* TextInputSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextInputSPI.h; sourceTree = "<group>"; }; >+ CE550E12228373C800D28791 /* InsertTextOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = InsertTextOptions.h; sourceTree = "<group>"; }; >+ CE550E132283744400D28791 /* InsertTextOptions.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = InsertTextOptions.cpp; sourceTree = "<group>"; }; > CE5B4C8621B73D870022E64F /* WKSyntheticFlagsChangedWebEvent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = WKSyntheticFlagsChangedWebEvent.h; path = ios/WKSyntheticFlagsChangedWebEvent.h; sourceTree = "<group>"; }; > CE5B4C8721B73D870022E64F /* WKSyntheticFlagsChangedWebEvent.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = WKSyntheticFlagsChangedWebEvent.mm; path = ios/WKSyntheticFlagsChangedWebEvent.mm; sourceTree = "<group>"; }; > CE70EE5A22442BB300E0AF0F /* WKFormPeripheralBase.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = WKFormPeripheralBase.mm; path = ios/forms/WKFormPeripheralBase.mm; sourceTree = "<group>"; }; >@@ -6349,6 +6352,8 @@ > 37BEC4DE19491486008B4286 /* CompletionHandlerCallChecker.mm */, > C55F916C1C595E440029E92D /* DataDetectionResult.h */, > C55F916D1C595E440029E92D /* DataDetectionResult.mm */, >+ CE550E132283744400D28791 /* InsertTextOptions.cpp */, >+ CE550E12228373C800D28791 /* InsertTextOptions.h */, > 2D1087621D2C641B00B85F82 /* LoadParametersCocoa.mm */, > CD2865EC2255562000606AC7 /* ProcessTaskStateObserver.h */, > CD2865ED2255562000606AC7 /* ProcessTaskStateObserver.mm */, >@@ -9272,6 +9277,7 @@ > BC33E0D112408E8600360F3F /* InjectedBundleRangeHandle.h in Headers */, > BC14DF77120B5B7900826C0C /* InjectedBundleScriptWorld.h in Headers */, > 2DD45ADE1E5F8972006C355F /* InputViewUpdateDeferrer.h in Headers */, >+ CE550E152283752200D28791 /* InsertTextOptions.h in Headers */, > A5E391FD2183C1F800C8FB31 /* InspectorTargetProxy.h in Headers */, > C5BCE5DF1C50766A00CDE3FA /* InteractionInformationAtPosition.h in Headers */, > 2D4D2C811DF60BF3002EB10C /* InteractionInformationRequest.h in Headers */, >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.cpp b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >index a3eac9c6d2efd1db10c6347e71729a885453820a..18ef1b9e1162dff42ae4a99bc89067d3b0553f41 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >@@ -42,6 +42,7 @@ > #include "InjectUserScriptImmediately.h" > #include "InjectedBundle.h" > #include "InjectedBundleScriptWorld.h" >+#include "InsertTextOptions.h" > #include "LibWebRTCProvider.h" > #include "LoadParameters.h" > #include "Logging.h" >@@ -5118,7 +5119,7 @@ void WebPage::setTextAsync(const String& text) > ASSERT_NOT_REACHED(); > } > >-void WebPage::insertTextAsync(const String& text, const EditingRange& replacementEditingRange, bool registerUndoGroup, uint32_t editingRangeIsRelativeTo, bool suppressSelectionUpdate) >+void WebPage::insertTextAsync(const String& text, const EditingRange& replacementEditingRange, InsertTextOptions&& options) > { > Frame& frame = m_page->focusController().focusedOrMainFrame(); > >@@ -5126,14 +5127,14 @@ void WebPage::insertTextAsync(const String& text, const EditingRange& replacemen > > bool replacesText = false; > if (replacementEditingRange.location != notFound) { >- if (auto replacementRange = EditingRange::toRange(frame, replacementEditingRange, static_cast<EditingRangeIsRelativeTo>(editingRangeIsRelativeTo))) { >- SetForScope<bool> isSelectingTextWhileInsertingAsynchronously(m_isSelectingTextWhileInsertingAsynchronously, suppressSelectionUpdate); >+ if (auto replacementRange = EditingRange::toRange(frame, replacementEditingRange, options.editingRangeIsRelativeTo)) { >+ SetForScope<bool> isSelectingTextWhileInsertingAsynchronously(m_isSelectingTextWhileInsertingAsynchronously, options.suppressSelectionUpdate); > frame.selection().setSelection(VisibleSelection(*replacementRange, SEL_DEFAULT_AFFINITY)); > replacesText = replacementEditingRange.length; > } > } > >- if (registerUndoGroup) >+ if (options.registerUndoGroup) > send(Messages::WebPageProxy::RegisterInsertionUndoGrouping()); > > if (!frame.editor().hasComposition()) { >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.h b/Source/WebKit/WebProcess/WebPage/WebPage.h >index a288bfecc0c97dcc94e64166ae1c7399dddd9140..3ea3d18a49ec0a70720b7bc73cd1d05e930c6f51 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.h >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.h >@@ -184,6 +184,7 @@ struct DictationAlternative; > struct GlobalFrameIdentifier; > struct GlobalWindowIdentifier; > struct Highlight; >+struct InsertTextOptions; > struct KeypressCommand; > struct PromisedAttachmentInfo; > struct TextCheckingResult; >@@ -778,7 +779,7 @@ public: > void sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput); > > void setTextAsync(const String&); >- void insertTextAsync(const String& text, const EditingRange& replacementRange, bool registerUndoGroup = false, uint32_t editingRangeIsRelativeTo = (uint32_t)EditingRangeIsRelativeTo::EditableRoot, bool suppressSelectionUpdate = false); >+ void insertTextAsync(const String& text, const EditingRange& replacementRange, InsertTextOptions&&); > void getMarkedRangeAsync(CallbackID); > void getSelectedRangeAsync(CallbackID); > void characterIndexForPointAsync(const WebCore::IntPoint&, CallbackID); >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.messages.in b/Source/WebKit/WebProcess/WebPage/WebPage.messages.in >index 3ff4e408712a47d62127d01455ec657ef2238061..ad1cb0e0df3f47e7f5abf91a162be3277df02420 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.messages.in >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.messages.in >@@ -428,7 +428,7 @@ messages -> WebPage LegacyReceiver { > AcceptsFirstMouse(int eventNumber, WebKit::WebMouseEvent event) -> (bool result) Synchronous > > SetTextAsync(String text) >- InsertTextAsync(String text, struct WebKit::EditingRange replacementRange, bool registerUndoGroup, uint32_t editingRangeIsRelativeTo, bool suppressSelectionUpdate) >+ InsertTextAsync(String text, struct WebKit::EditingRange replacementRange, struct WebKit::InsertTextOptions options) > GetMarkedRangeAsync(WebKit::CallbackID callbackID) > GetSelectedRangeAsync(WebKit::CallbackID callbackID) > CharacterIndexForPointAsync(WebCore::IntPoint point, WebKit::CallbackID callbackID);
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 197710
:
369424
|
369427
|
369431