[webkit-changes] [WebKit/WebKit] d7150a: REGRESSION (255932 at main): Text copied from Notes p...

Wenson Hsieh noreply at github.com
Thu Nov 10 23:48:00 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d7150a05e06e7ec60c42b1814acacdd7bdb91b8d
      https://github.com/WebKit/WebKit/commit/d7150a05e06e7ec60c42b1814acacdd7bdb91b8d
  Author: Wenson Hsieh <wenson_hsieh at apple.com>
  Date:   2022-11-10 (Thu, 10 Nov 2022)

  Changed paths:
    M Source/WebCore/platform/ios/PasteboardIOS.mm
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm

  Log Message:
  -----------
  REGRESSION (255932 at main): Text copied from Notes pastes as attachment in Mail compose
https://bugs.webkit.org/show_bug.cgi?id=247778
rdar://96853551

Reviewed by Aditya Keerthi.

After the fix in `255932 at main`, copying rich text from Notes on iOS and pasting into Mail compose
results in an attachment being inserted into the document. This is because Notes writes the UTI
"com.apple.notes.richtext" to the pasteboard, which conforms to `UTTypeCompositeContent` but
isn't one of RTFD/WebArchive, so we treat it as an attachment by default.

To avoid this problem while preserving the original intent behind `255932 at main`, we narrow the fix
to special case `UTTypePDF`, rather than adding blanket rules to treat composite content as
attachments.

Test: WKAttachmentTestsIOS.PasteRichTextCopiedFromNotes

* Source/WebCore/platform/ios/PasteboardIOS.mm:
(WebCore::shouldTreatAsAttachmentByDefault):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:
(TestWebKitAPI::TEST):

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




More information about the webkit-changes mailing list