Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9df7894d2af3a88365856881afcb60eaa691e9e1
      
https://github.com/WebKit/WebKit/commit/9df7894d2af3a88365856881afcb60eaa691e9e1
  Author: Abrar Rahman Protyasha <[email protected]>
  Date:   2026-04-09 (Thu, 09 Apr 2026)

  Changed paths:
    M Source/WebKit/UIProcess/mac/WebViewImpl.mm
    A Tools/TestWebKitAPI/Resources/cocoa/draggable-only-custom-data.html
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/mac/DragAndDropTestsMac.mm

  Log Message:
  -----------
  REGRESSION(309943@main): No drag event fired when pasteboard has only 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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to