Unable to paste text that was copied from a page into the universal search field
https://bugs.webkit.org/show_bug.cgi?id=173293
<rdar://problem/
32440918>
Reviewed by Ryosuke Niwa.
Source/WebCore:
Vend "public.utf8-plain-text" and "public.utf16-plain-text" as additional representations on the pasteboard when
copying both rich and plain web content in PlatformPasteboardIOS.mm. This is because UITextView no longer
supports pasting "public.text" as text in iOS 11.
Tests:
UIPasteboardTests.CopyPlainTextWritesConcreteTypes
UIPasteboardTests.CopyRichTextWritesConcreteTypes
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::writePlainText):
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::write):
Source/WebKit2:
Add boilerplate SPI on WKPreferences to enable JavaScript access to copy and paste.
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _setJavaScriptCanAccessClipboard:]):
(-[WKPreferences _javaScriptCanAccessClipboard]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
Tools:
Adds 2 new unit tests for copying plain and rich selected web content.
See WebCore and WebKit ChangeLogs for more detail.
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/rich-and-plain-text.html: Added.
* TestWebKitAPI/Tests/ios/UIPasteboardTests.mm: Added.
(TestWebKitAPI::dataForPasteboardType):
(TestWebKitAPI::setUpWebViewForPasteboardTests):
(TestWebKitAPI::TEST):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@218180
268f45cc-cd09-0410-ab3c-
d52691b4dbfc