REGRESSION(309943@main): No drag event fired when pasteboard has only custom data type#62302
Merged
webkit-commit-queue merged 1 commit intoWebKit:mainfrom Apr 9, 2026
Merged
Conversation
Collaborator
|
EWS run on previous version of this PR (hash 3171fa5) Details
|
whsieh
approved these changes
Apr 8, 2026
Collaborator
|
EWS run on current version of this PR (hash 78e5f6e) Details
|
Member
Author
|
Thank you for the review! |
… custom data type https://bugs.webkit.org/show_bug.cgi?id=311762 rdar://174354602 Reviewed by Wenson Hsieh. The migration to beginDraggingSessionWithItems: in the regressing commit removed the line that wrote WebDummyPboardType to the pasteboard before starting the drag. WebDummyPboardType ("Apple WebKit dummy pasteboard type") is one of the types the web view registers for via registerForDraggedTypes:. When the pasteboard contains only types the view isn't registered for (e.g. com.apple.WebKit.custom-pasteboard-data), AppKit does not recognize the view as a valid drag destination and never calls draggingEntered: or draggingUpdated:. As a result, drag events never fire, breaking sites like Slack which hide the default drag preview with a 1x1 drag image and place a custom overlay via drag events. To fix this, we restore WebDummyPboardType on the drag pasteboard after restoring legacy data in the DHTML/legacy drag path. Tests: TestWebKitAPI.DragAndDropTests.DraggableElementWithOnlyCustomPasteboardDataFiresDragEvents * Source/WebKit/UIProcess/mac/WebViewImpl.mm: (WebKit::WebViewImpl::startDrag): * Tools/TestWebKitAPI/Resources/cocoa/draggable-only-custom-data.html: Added. * Tools/TestWebKitAPI/Tests/WebKit/WKWebView/mac/DragAndDropTestsMac.mm: (TEST(DragAndDropTests, DraggableElementWithOnlyCustomPasteboardDataFiresDragEvents)): Canonical link: https://commits.webkit.org/310833@main
78e5f6e to
9df7894
Compare
Collaborator
|
Committed 310833@main (9df7894): https://commits.webkit.org/310833@main Reviewed commits have been landed. Closing PR #62302 and removing active labels. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
9df7894
78e5f6e
🛠 mac🛠 win🧪 wpe-wk2🧪 win-tests🧪 ios-wk2🧪 api-mac🧪 api-wpe🧪 ios-wk2-wpt🧪 api-mac-debug🧪 api-ios🧪 mac-wk1🛠 ios-safer-cpp🧪 mac-wk2🛠 vision🧪 mac-AS-debug-wk2🧪 mac-wk2-stress🛠 playstation🧪 vision-wk2🧪 mac-intel-wk2🛠 mac-safer-cpp🛠 tv-sim🛠 watch