Bug 37012

Summary: dropEffect not set to correct default values in dragenter / dragover
Product: WebKit Reporter: Daniel Cheng <dcheng>
Component: UI EventsAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: bweinstein, danya.postfactum, dbates, dtrebbien, eric, ian, oliver, rniwa, tony, webkit
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
URL: http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#dropEffect-initialization
Bug Depends on:    
Bug Blocks: 79171    
Attachments:
Description Flags
Testcase
none
Patch
none
Patch
none
Patch
none
Patch
dcheng: review-, dcheng: commit-queue-
Patch
dcheng: review-, dcheng: commit-queue-
Patch
abarth: review-
Expanded test page
none
drag/drop testcase none

Description Daniel Cheng 2010-04-01 22:46:27 PDT
Per the section on the initialization of event.dataTransfer.dropEffect, dropEffect's initial value should not be "none" during dragenter / dragover.
Comment 1 Daniel Cheng 2010-04-01 22:46:56 PDT
Created attachment 52380 [details]
Testcase
Comment 2 Daniel Cheng 2010-04-01 23:15:17 PDT
Created attachment 52381 [details]
Patch
Comment 3 Daniel Cheng 2010-04-01 23:35:09 PDT
Created attachment 52383 [details]
Patch
Comment 4 Daniel Cheng 2010-04-01 23:35:38 PDT
Created attachment 52384 [details]
Patch
Comment 5 Daniel Cheng 2010-04-02 00:38:58 PDT
Created attachment 52399 [details]
Patch
Comment 6 Daniel Cheng 2010-04-04 00:06:21 PDT
Created attachment 52506 [details]
Patch
Comment 7 Tony Chang 2010-04-04 21:24:20 PDT
Adding bweinstein who I think originally set these values in http://trac.webkit.org/changeset/53287
Comment 8 Daniel Cheng 2010-04-05 15:22:46 PDT
Created attachment 52580 [details]
Patch

Fix incorrect initialization, remove unnecessary contentEditable handling.
Comment 9 Oliver Hunt 2010-04-05 15:23:44 PDT
Can you please compare the test results with that produced by mozilla?
Comment 10 Daniel Cheng 2010-04-05 15:41:20 PDT
Firefox's behavior differs slightly from the spec:
From DOM-initiated drags, if effectAllowed is "all", "copyMove", "linkMove", or "uninitialized", the default dropEffect is "move".

Firefox doesn't seem to set effectAllowed to "uninitialized" for drags from text boxes. When dragging links, effectAllowed is set to "uninitialized" but default dropEffect is set to "move".
Comment 11 Daniel Cheng 2010-04-15 14:31:59 PDT
From IRC:

< dcheng> olliej: just curious if you're interested in reviewing https://bugs.webkit.org/show_bug.cgi?id=37012 since you commented on it a few days ago.
< olliej> dcheng: does the new behaviour match ie?
< olliej> dcheng: matching the spec comes secondary to matching what implementations do -- the spec for dnd is mostly an attempt to reverse engineer what browser already did
< dcheng> I'll check.

Results can be found at http://spreadsheets.google.com/pub?key=tPZ1c0LEi4RBJ2CG4jV13Fw&output=html

What's the proper approach here? If you don't mind, I'll update the patch to follow IE behavior and email whatwg@ for clarification on why the spec differs from IE in that respect.
Comment 12 Daniel Cheng 2010-04-20 18:33:30 PDT
Created attachment 53910 [details]
Expanded test page
Comment 13 Daniel Cheng 2010-04-20 18:37:24 PDT
Updated the page with information for Firefox and Safari. I also found some interesting issues that seem to be specific to Safari.
Comment 14 Oliver Hunt 2010-04-21 15:38:52 PDT
Created attachment 53997 [details]
drag/drop testcase
Comment 15 Ojan Vafai 2010-04-21 16:15:23 PDT
Ian, can you comment on the specced behavior for dropEffect? It seems what's currently specced doesn't match any browser, assuming dcheng's testing was correct of course. Was that intentional?

I looked, but couldn't find any relevant discussion on whatwg@ about dropEffect.

dcheng, maybe it's worth writing an email to whatwg@ with your data?
Comment 16 Adam Barth 2010-06-20 10:06:28 PDT
Comment on attachment 52580 [details]
Patch

It looks like this change is blocked on interacting with the whatwg.  Ideally, we'd get the spec updated to the desired behavior and the change all the implementations to match.  Feel free to re-nominate for review (or to post a new patch) once we've got the spec onboard.
Comment 17 danya.postfactum 2013-01-26 19:07:47 PST
What is the current status of this bug report ?
Comment 18 webkit 2014-08-10 13:01:33 PDT
On reviewing this case, it appears that if the value of datatransfer.effectAllowed is set in dragstart, it is supposed to be retained during the drag, but it's being reset to "all" sometime before the dragenter event. This means that drag sources can't specify that they only allow copying, moving or linking from their data. 

You may need to solve both of these to actually "fix" this bug.