Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 758a3d5efac98095352c9755ed1894f9b1d1f638
      
https://github.com/WebKit/WebKit/commit/758a3d5efac98095352c9755ed1894f9b1d1f638
  Author: Aditya Keerthi <akeer...@apple.com>
  Date:   2025-04-08 (Tue, 08 Apr 2025)

  Changed paths:
    M Source/WebKit/UIProcess/mac/WebViewImpl.mm

  Log Message:
  -----------
  [macOS] Dragging and dropping photos from PHPickerViewController results in 0 
byte files
https://bugs.webkit.org/show_bug.cgi?id=291245
rdar://145098086

Reviewed by Wenson Hsieh.

Photos dragged out of `PHPickerViewController` are backed by a file promise URL.
However, the file promise URLs do not use `NSFilePromiseReceiver` and
`NSFilesPromisePboardType` is not written to the pasteboard. Consequently, file
coordination must be used to obtain the actual file.

Fix by updating the drag and drop for files to use file coordination. Note that
file coordination works regardless of whether or not the file is backed by a
promise.

No new tests, since after consultation with FileProvider experts it is not
easily possible to create a file URL that *requires* coordination. Existing
tests cover the existing support for dragging and dropping files.

* Source/WebKit/UIProcess/mac/WebViewImpl.mm:
(WebKit::handleLegacyFilesPromisePasteboard):

Rename method to make it more clear it handles `NSFilesPromisePboardType`.

(WebKit::handleLegacyFilesPasteboard):

Use `NSFileCoordinator` to fulfill file promises. 
`prepareForReadingItemsAtURLs:`
and `coordinateReadingItemAtURL:` are synchronous, so they are performed on a
background thread.

(WebKit::WebViewImpl::performDragOperation):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to