[webkit-reviews] review granted: [Bug 173293] Unable to paste text that was copied from a page into the universal search field : [Attachment 312745] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jun 12 20:14:01 PDT 2017


Ryosuke Niwa <rniwa at webkit.org> has granted Wenson Hsieh
<wenson_hsieh at apple.com>'s request for review:
Bug 173293: Unable to paste text that was copied from a page into the universal
search field
https://bugs.webkit.org/show_bug.cgi?id=173293

Attachment 312745: Patch

https://bugs.webkit.org/attachment.cgi?id=312745&action=review




--- Comment #3 from Ryosuke Niwa <rniwa at webkit.org> ---
Comment on attachment 312745
  --> https://bugs.webkit.org/attachment.cgi?id=312745
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=312745&action=review

> Source/WebCore/ChangeLog:11
> +	   copying both rich and plain web content in PlatformPasteboardIOS.mm.
This is because "public.content" is no
> +	   longer a which UITextView is capable of interpreting and inserting
text from in iOS 11.

This is a wordy way of saying that "UITextView no longer supports
'public.content' in iOS 11".

> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:5281
> +- (void)executeEditCommand:(NSString *)command
completionHandler:(void(^)(BOOL))completionHandler
> +{
> +    _page->executeEditCommand(command, [completion =
makeBlockPtr(completionHandler)](WebKit::CallbackBase::Error error) {
> +	   completion(error == WebKit::CallbackBase::Error::None);
> +    });
> +}
> +

I don't think you need this. See my comment below.

> Tools/TestWebKitAPI/Tests/ios/UIPasteboardTests.mm:53
> +    __block bool doneExecutingCommand = false;
> +    [webView executeEditCommand:@"copy" completionHandler:^(BOOL success) {
> +	   EXPECT_TRUE(success);
> +	   doneExecutingCommand = true;
> +    }];

You don't really need this new API. You just need to set the preference to
enable copy & paste from JS.
See PasteboardNotification.mm.


More information about the webkit-reviews mailing list