Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 647d04f9129a03d9ac6b455d9d13cc2de39c1e0f
https://github.com/WebKit/WebKit/commit/647d04f9129a03d9ac6b455d9d13cc2de39c1e0f
Author: Abrar Rahman Protyasha <[email protected]>
Date: 2026-10-01 (Thu, 01 Oct 2026)
Changed paths:
M Source/WebCore/page/DragController.cpp
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/BundleEditingDelegatePlugIn.mm
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/mac/DragAndDropTestsMac.mm
Log Message:
-----------
[macOS] Drags may fail between multiple <attachment> elements in Mail
https://bugs.webkit.org/show_bug.cgi?id=325629
rdar://183561189
Reviewed by Aditya Keerthi and Megan Gardner.
We create an attachment's drag image from the selection after asking the
editor client for pasteboard data. However, the injected bundle can run
script from that callback that collapses the selection, for instance by
temporarily removing attachment elements. That leaves no drag image, and
then the drag is silently dropped.
To address this gap, we create the drag image before calling out to the
client, and we don't start a drag if we were unable to procure an image.
Tests: DragAndDropTests.DraggingAttachmentWhenEditingDelegateReplacesAttachments
* Source/WebCore/page/DragController.cpp:
(WebCore::DragController::startDrag):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/BundleEditingDelegatePlugIn.mm:
(-[BundleEditingDelegatePlugIn
webProcessPlugIn:didCreateBrowserContextController:]):
(-[BundleEditingDelegatePlugIn
_webProcessPlugInBrowserContextController:pasteboardDataForRange:]):
Teach the injected bundle to replacement <attachment> with placeholders,
much like how this bug manifests in client applications.
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/mac/DragAndDropTestsMac.mm:
(TEST(DragAndDropTests,
DraggingAttachmentWhenEditingDelegateReplacesAttachments)):
Canonical link: https://commits.webkit.org/322391@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications