Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a7b43d111be6635c87e62fd22a968c01b7771714
      
https://github.com/WebKit/WebKit/commit/a7b43d111be6635c87e62fd22a968c01b7771714
  Author: Jessica Cheung <[email protected]>
  Date:   2025-10-10 (Fri, 10 Oct 2025)

  Changed paths:
    M Source/WebCore/page/DragClient.h
    M Source/WebCore/page/DragController.cpp
    M Source/WebCore/page/DragController.h
    M Source/WebCore/page/EventHandler.cpp
    M Source/WebCore/platform/DragItem.h
    M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
    M Source/WebKit/UIProcess/mac/WebViewImpl.mm
    M Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm
    M Source/WebKitLegacy/mac/WebCoreSupport/WebDragClient.h
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/SiteIsolation.mm

  Log Message:
  -----------
  [Site Isolation] (macOS) Drag & drop element comes from top of screen
https://bugs.webkit.org/show_bug.cgi?id=300343
rdar://160294054

Reviewed by Abrar Rahman Protyasha and Aditya Keerthi.

Due to Site Isolation, conversion of coordinates to root view coordinates
no longer works as expected for drag & drop with iframes. This causes
the drag position in root view coordinates to be wrong, resulting in a
smaller y-value and the element appearing to drag from above the actual drag
location.

Use `convertPointToMainFrameCoordinates` to accurately convert
coordinates to actual root view coordinates. To do so, it requires the root
frame identifier. So, store the root frame identifier on DragItem, which can 
then be used.
DragItem is passed from EventHandler to WebViewImpl. Inside 
WebViewImpl::startDrag,
the clientDragLocation is now relative to the root view and passed into 
setDraggingFrame
and dragImage.

Add a new API test that exercises this change.

* Source/WebCore/page/DragClient.h:
* Source/WebCore/page/DragController.cpp:
(WebCore::DragController::startDrag):
(WebCore::DragController::doImageDrag):
(WebCore::DragController::doSystemDrag):
* Source/WebCore/page/DragController.h:
* Source/WebCore/page/EventHandler.cpp:
(WebCore::EventHandler::handleDrag):
* Source/WebCore/platform/DragItem.h:
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/UIProcess/mac/WebViewImpl.mm:
(WebKit::WebViewImpl::startDrag):
* Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
* Source/WebKitLegacy/mac/WebCoreSupport/WebDragClient.h:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/SiteIsolation.mm:
(TestWebKitAPI::(SiteIsolation, DragImageLocation)):

Canonical link: https://commits.webkit.org/301306@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

Reply via email to