Bug 191069 - [Cocoa] WebKit doesn’t use file coordination when creating file wrapper for dropped file
Summary: [Cocoa] WebKit doesn’t use file coordination when creating file wrapper for d...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-10-30 10:32 PDT by mitz
Modified: 2022-02-09 10:14 PST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2018-10-30 10:32:12 PDT
When dropping a file or folder from Finder into an attachment-element-enabled web view, WebKit immediately initializes an NSFileWrapper instance with the dropped item’s URL. This can fail in some cases, including when the file comes from iCloud Drive and is not yet available locally.

WebKit should use NSFileCoordinator to coordinate reading from the URL, and initialize the NSFileWrapper with the URL passed to the accessor block. It may also need to expose _WKAttachment and/or WKUIDelegatePrivate API to inform clients when an attachment’s file wrapper becomes available (or changes), and have a way to represent an attachment pending coordinated reading.
Comment 1 mitz 2018-10-30 10:35:06 PDT
<rdar://problem/45672625>
Comment 2 mitz 2018-12-05 11:56:23 PST
This can probably use the “file wrapper invalidated” mechanism that was added for editable images.