[webkit-changes] [WebKit/WebKit] cb14ef: [iOS] Write web archive data using the `com.apple....

Wenson Hsieh noreply at github.com
Fri Jan 5 11:11:46 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cb14ef555f423f7bdc379fd132644197e2fcdf44
      https://github.com/WebKit/WebKit/commit/cb14ef555f423f7bdc379fd132644197e2fcdf44
  Author: Wenson Hsieh <wenson_hsieh at apple.com>
  Date:   2024-01-05 (Fri, 05 Jan 2024)

  Changed paths:
    M Source/WebCore/platform/ios/PlatformPasteboardIOS.mm
    M Tools/TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm

  Log Message:
  -----------
  [iOS] Write web archive data using the `com.apple.webarchive` UTI when copying/dragging
https://bugs.webkit.org/show_bug.cgi?id=267131
rdar://120545471

Reviewed by Aditya Keerthi.

Publish `com.apple.webarchive` alongside the legacy `Apple Web Archive pasteboard type` when writing
web archive data to the pasteboard when copying or dragging, so that the system can automatically
coerce from web archive data (which may include attachments) to `NSAttributedString`, RTF, or flat
RTFD if needed.

Note that landing this change no longer requires rdar://46830277 to be fixed after the (more recent)
UIKit changes in rdar://116051491, because writing `com.apple.webarchive` data now additionally
registers "derived" types for `public.rtf` and `com.apple.flat-rtfd`. This ensures that Messages
won't prefer pasting text copied in Safari as a `.webarchive` file over plain text in the entry
view.

* Source/WebCore/platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::write):
* Tools/TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm:

Additionally rebaseline an API test, to reflect the fact that we should now register
`com.apple.webarchive` when dragging.

Canonical link: https://commits.webkit.org/272697@main




More information about the webkit-changes mailing list