Bug 181596 - Drag is prevented on video elements without controls attribute
Summary: Drag is prevented on video elements without controls attribute
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Mac macOS 10.13
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-01-12 09:56 PST by Scott Steele
Modified: 2018-01-16 04:40 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Scott Steele 2018-01-12 09:56:38 PST
Overview:
Video elements without the controls attribute should support drag.

Steps to reproduce:
1. Create a webpage with a video element without the controls attribute as a child of a draggable div.
2. Cause the video to be reloaded and played.
3. Select and attempt to drag the video.

Actual results:
Video element does not drag. dragend is fired immediately.

Expected results:
Video element is draggable.  dragend is fired only after the mouse button is released.

Other useful information:
In /Source/WebCore/Modules/modern-media-controls/controls/media-controls.js, dragstart is cancelled in handleEvent() as follows:

+    handleEvent(event)
     {
+        if (event.type === "focusin" && event.currentTarget === this.element)
+            this.faded = false;
+        else if (event.type === "dragstart" && this.isPointInControls(new DOMPoint(event.clientX, event.clientY)))
+            event.preventDefault();
     }

Instead, drag should only be prevented when the controls attribute is present on the media element.
Comment 1 Radar WebKit Bug Importer 2018-01-16 04:40:25 PST
<rdar://problem/36540541>