Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 59cdc6c756949563050436d2e83326afa7c93840
https://github.com/WebKit/WebKit/commit/59cdc6c756949563050436d2e83326afa7c93840
Author: Wenson Hsieh <[email protected]>
Date: 2024-08-27 (Tue, 27 Aug 2024)
Changed paths:
M Source/WebKit/UIProcess/mac/WebViewImpl.mm
M Tools/TestWebKitAPI/mac/TestDraggingInfo.mm
M Tools/TestWebKitAPI/mac/TestFilePromiseReceiver.h
M Tools/TestWebKitAPI/mac/TestFilePromiseReceiver.mm
Log Message:
-----------
REGRESSION (281966@main): Unable to drag images from Photos into Mail compose
on macOS
https://bugs.webkit.org/show_bug.cgi?id=278749
rdar://134780008
Reviewed by Aditya Keerthi and Charlie Wolfe.
The refactoring around `WebViewImpl::performDragOperation` in
https://commits.webkit.org/281966@main
introduced a bug, wherein dragging multiple promised files over a web view
causes the drop to fail.
This is because the reference to `page` is moved (and cleared) when invoking
the iteration block,
causing subsequent calls to exit early (in the `!page` branch).
Fix this by copying a reference to the `WebPageProxy` into each iteration block.
Tested by an existing API test, after augmenting test infrastructure (see
below).
Test: WKAttachmentTestsMac.InsertDroppedFilePromisesAsAttachments
* Source/WebKit/UIProcess/mac/WebViewImpl.mm:
(WebKit::handleLegacyFilesPasteboard):
* Tools/TestWebKitAPI/mac/TestDraggingInfo.mm:
Refactor some test infrastructure that was intended to simulate dragging and
dropping one or more
promised file(s), such that it's consistent with how AppKit delivers promised
data on drop.
Currently, the test harness handles multiple promised file URLs (written via
`-writePromisedFiles:`)
by creating a single drag item that contains multiple URLs. However, when
dragging and dropping
multiple files or photos into Mail compose, it's actually dropped as multiple
drag items, each with
a single URL and type.
(-[TestDraggingInfo
enumerateDraggingItemsWithOptions:forView:classes:searchOptions:usingBlock:]):
* Tools/TestWebKitAPI/mac/TestFilePromiseReceiver.h:
* Tools/TestWebKitAPI/mac/TestFilePromiseReceiver.mm:
(-[TestFilePromiseReceiver initWithTypeIdentifier:fileURL:]):
(-[TestFilePromiseReceiver fileTypes]):
(-[TestFilePromiseReceiver fileNames]):
(-[TestFilePromiseReceiver dealloc]):
(-[TestFilePromiseReceiver
receivePromisedFilesAtDestination:options:operationQueue:reader:]):
(-[TestFilePromiseReceiver
initWithPromisedTypeIdentifiers:dragAndDropSimulator:]): Deleted.
Canonical link: https://commits.webkit.org/282828@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes