<rdar://problem/32440918>
Created attachment 312737 [details] Patch
Created attachment 312745 [details] Patch
Comment on attachment 312745 [details] 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.
Comment on attachment 312745 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=312745&action=review Thanks! (I'll probably need a WK2 r+ for this before landing though) >> Source/WebCore/ChangeLog:11 >> + 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". Good point -- reworded. (I also had a typo: "public.content" should have been "public.text" here). >> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:5281 >> + > > I don't think you need this. See my comment below. 👍 >> Tools/TestWebKitAPI/Tests/ios/UIPasteboardTests.mm:53 >> + }]; > > You don't really need this new API. You just need to set the preference to enable copy & paste from JS. > See PasteboardNotification.mm. Done!
Created attachment 312750 [details] Patch for landing (holding for wk2r+)
Comment on attachment 312750 [details] Patch for landing (holding for wk2r+) View in context: https://bugs.webkit.org/attachment.cgi?id=312750&action=review > Source/WebCore/platform/ios/PlatformPasteboardIOS.mm:263 > + // FIXME: For backwards compatibility with clients that expect pre-iOS 11 behavior ('public.text' with an NSString as the value) when copying rich web content. I don’t understand the comment. What is the FIXME here? What needs to be fixed? Are you saying that this should be removed some day? > Source/WebCore/platform/ios/PlatformPasteboardIOS.mm:353 > + // FIXME: Writing an NSString directly to the pasteboard is only for backwards compability with apps that expect a copy from web content to vend > + // public.text, and not more specific subtypes. Ditto.
Comment on attachment 312750 [details] Patch for landing (holding for wk2r+) View in context: https://bugs.webkit.org/attachment.cgi?id=312750&action=review >> Source/WebCore/platform/ios/PlatformPasteboardIOS.mm:263 >> + // FIXME: For backwards compatibility with clients that expect pre-iOS 11 behavior ('public.text' with an NSString as the value) when copying rich web content. > > I don’t understand the comment. What is the FIXME here? What needs to be fixed? Are you saying that this should be removed some day? Yes -- I'm trying to say that this is only here to ensure backwards compatibility, and that we should remove it in the future. I'll tweak this comment to make it more clear. >> Source/WebCore/platform/ios/PlatformPasteboardIOS.mm:353 >> + // public.text, and not more specific subtypes. > > Ditto. I'll edit this comment to clarify that this is something we should remove in the future.
Created attachment 312777 [details] Patch
Comment on attachment 312777 [details] Patch Thanks Tim!
Comment on attachment 312777 [details] Patch Clearing flags on attachment: 312777 Committed r218180: <http://trac.webkit.org/changeset/218180>