[webkit-changes] [WebKit/WebKit] 4690d8: iOS Mail app issues with copying attachments from ...
Richard Robinson
noreply at github.com
Mon Dec 5 07:58:06 PST 2022
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 4690d8d04a27a89412a880798fb2ac374a0770a3
https://github.com/WebKit/WebKit/commit/4690d8d04a27a89412a880798fb2ac374a0770a3
Author: Richard Robinson <richard_robinson2 at apple.com>
Date: 2022-12-05 (Mon, 05 Dec 2022)
Changed paths:
M Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm
Log Message:
-----------
iOS Mail app issues with copying attachments from an email and pasting into new email or note or Files
https://bugs.webkit.org/show_bug.cgi?id=248746
rdar://70201914
Reviewed by Wenson Hsieh.
When copying an attachment in Mail, and pasting it in Mail or another app, the
file becomes corrupted. This is because when copying the file to the clipboard,
we use `-[NSFileWrapper serializedRepresentation]` to serialize the file and
then send that data.
However, when pasting the file, clients such as Mail do not expect the data
to be serialized, and so they use `-[NSFileWrapper initRegularFileWithContents:]`
to try to read it, which causes the file to be corrupted.
There are two solutions to this:
1. Get all clients to use the correct initializer, `-[NSFileWrapper initWithSerializedRepresentation:]`
2. Do not serialize the data when copying it to the clipboard
This PR does the latter, as it is the safer option.
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(createItemProvider):
Canonical link: https://commits.webkit.org/257371@main
More information about the webkit-changes
mailing list