Bug 95911

Summary: Releasing mouse button during an image drag results in a graphical glitch
Product: WebKit Reporter: Zev Eisenberg <zev>
Component: ImagesAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Minor CC: ap, bdakin, rniwa, simon.fraser
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac (Intel)   
OS: OS X 10.8   
Attachments:
Description Flags
video recording of bug none

Description Zev Eisenberg 2012-09-05 16:49:28 PDT
Created attachment 162369 [details]
video recording of bug

Summary:
If you start dragging an image (<img> tag) from a page, for example to save it to your desktop, and then release the drag while moving the mouse, the image glitches weirdly.

Steps to reproduce:
1. Go to a page, for example http://www.webkit.org
2. Start dragging an image on the page. I used the "Download Nightly builds" button image. A partially-transparent copy of the image will move with the mouse cursor.
3. While still moving the cursor, release the mouse button.

Expected results:
The partially-transparent image will animate smoothly back to the point where the drag started.

Actual Results:
The animation starts correctly, but about halfway through the animating image vanishes and reappears under the cursor at the position where it was released, and then fades out without moving further.

Regression:
I first noticed this when I installed the first public release of Mountain Lion (10.8). I have observed it in the latest stable Chrome (21.0.1180.89), latest Safari (Version 6.0.1 (8536.26.9)), and Webkit Nightly (8536.26.9, 537+).

Notes:
If you stop moving your cursor before releasing the mouse button, the animation works smoothly. It has the weird behavior only if the cursor is still moving when the button is released.

I have attached a video recording of this bug in action. The framerate isn't great but it gets the point across. You can see the bug best just after the 28 second mark if you step through one frame at a time. The video was recorded on the 10.8.2 developer preview with Webkit Nightly, but I've seen it in the aforementioned browsers.
Comment 1 Alexey Proskuryakov 2012-09-06 16:31:34 PDT
Confirmed, curious effect.
Comment 2 Zev Eisenberg 2016-07-07 07:44:53 PDT
I was just going through old emails and came across this bug. I tried it in Safari 9.1.1 (11601.6.17) on OS X 10.11.5 (15F34), and the dragged image starts to snap back, but then disappears before it gets back to its original coordinates, independent of whether I'm actively dragging when I release. This seems like a regression.

I then tried it in Safari Technology Preview Release 8 (Safari 9.1.2, WebKit 11602.1.39) on the same OS X. The image snaps back all the way to the source if the cursor is not moving. But if the cursor is moving, the image has a similar move-then-disappear behavior as stable Safari.