Bug 181896 - [macOS] [WK2] Drag location is computed incorrectly when dragging content from subframes
Summary: [macOS] [WK2] Drag location is computed incorrectly when dragging content fro...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: InRadar
: 179733 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-01-19 19:47 PST by Wenson Hsieh
Modified: 2018-01-22 10:40 PST (History)
8 users (show)

See Also:


Attachments
Reduced test case (730 bytes, text/html)
2018-01-19 19:51 PST, Wenson Hsieh
no flags Details
Patch (5.50 KB, patch)
2018-01-19 20:37 PST, Wenson Hsieh
thorton: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Wenson Hsieh 2018-01-19 19:47:37 PST
When dragging content from an iframe on macOS, the drag image location is computed incorrectly if the iframe is not at (0, 0). To reproduce, try dragging the logo in <https://www.w3schools.com/html/tryit.asp?filename=tryhtml5_draganddrop>. Reproduces on Safari 11 and later (on macOS 10.13, the drag image is clamped to the mouse cursor with an animation, so it looks like the drag image flies in from offscreen).
Comment 1 Wenson Hsieh 2018-01-19 19:48:21 PST
This is fallout from refactoring in r218837.
Comment 2 Wenson Hsieh 2018-01-19 19:51:42 PST
Created attachment 331828 [details]
Reduced test case
Comment 3 Wenson Hsieh 2018-01-19 20:02:57 PST
<rdar://problem/35479043>
Comment 4 Wenson Hsieh 2018-01-19 20:37:43 PST
Created attachment 331830 [details]
Patch
Comment 5 Wenson Hsieh 2018-01-19 22:30:05 PST
*** Bug 179733 has been marked as a duplicate of this bug. ***
Comment 6 Wenson Hsieh 2018-01-19 22:54:59 PST
Comment on attachment 331830 [details]
Patch

Thanks for the review!
Comment 7 Wenson Hsieh 2018-01-19 23:26:02 PST
Comment on attachment 331830 [details]
Patch

Manually landed r227266: <https://trac.webkit.org/changeset/227266>

Commit queue doesn't seem to be processing this patch...
Comment 8 Aakash Jain 2018-01-20 08:50:19 PST
> Commit queue doesn't seem to be processing this patch...

Tracking in https://bugs.webkit.org/show_bug.cgi?id=181907
Comment 9 Simon Fraser (smfr) 2018-01-22 10:36:12 PST
Comment on attachment 331830 [details]
Patch

No test?
Comment 10 Wenson Hsieh 2018-01-22 10:40:48 PST
(In reply to Simon Fraser (smfr) from comment #9)
> Comment on attachment 331830 [details]
> Patch
> 
> No test?

(from the ChangeLog:)

"Since this bug only affects drag and drop in the macOS WebKit2 port, there's currently no way to test this. I'll be using <https://bugs.webkit.org/show_bug.cgi?id=181898> to track adding test support for drag and drop on macOS WebKit2. Manually tested dragging in both WebKit1 and WebKit2 on macOS. dragLocationInWindowCoordinates isn't used at all for iOS drag and drop."

I've begun investigating drag and drop testing support for macOS using WebKit2, but this would require significant (feature level) work, which I don't think this fix should be blocked on.

The infrastructure needed to write cross-platform WebKit2 drag and drop tests is something I'm actively working towards.