Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d3dc96cb1d7baeefdcfa1201007f020b746fcdb7
      
https://github.com/WebKit/WebKit/commit/d3dc96cb1d7baeefdcfa1201007f020b746fcdb7
  Author: Richard Robinson <[email protected]>
  Date:   2023-09-08 (Fri, 08 Sep 2023)

  Changed paths:
    M Source/WebKit/UIProcess/ios/DragDropInteractionState.h
    M Source/WebKit/UIProcess/ios/DragDropInteractionState.mm
    M Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
    M Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

  Log Message:
  -----------
  Interaction: Drags from twitter.com (after scrolling down the page) have the 
wrong origin
https://bugs.webkit.org/show_bug.cgi?id=261354
rdar://113867128

Reviewed by Tim Horton.

When performing a drag-and-drop interaction while a context menu is currently 
present, UIKit expects
that both the context menu preview and the drag preview have the same size and 
origin. However, this
is not currently the case.

This is because in some cases, the context menu preview is created from a 
snapshot, which has a y-position
corresponding to the position relative to the entire page. However, the drag 
preview uses the drag
source directly, and it's position is relative to the view.

To fix, adopt the same snapshotting mechanism in the drag preview that is 
currently used in the context
menu preview, when applicable.

* Source/WebKit/UIProcess/ios/DragDropInteractionState.h:
* Source/WebKit/UIProcess/ios/DragDropInteractionState.mm:
(WebKit::DragDropInteractionState::previewForLifting const):
(WebKit::DragDropInteractionState::previewForCancelling):
(WebKit::DragDropInteractionState::createDragPreviewInternal const):

* Source/WebKit/UIProcess/ios/WKContentViewInteraction.h:
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _createTargetedContextMenuHintPreviewIfPossible]):
Detect when the snapshotting case happens, and save the indicator data for use 
later on by the drag preview.

(-[WKContentView dragInteraction:previewForLiftingItem:session:]):

Canonical link: https://commits.webkit.org/267819@main


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to