Following up from bug #30107, when effectAllowed = "uninitialized", the returned dropEffect is incorrect when the specified dropEffect is "copy", "move" or "link". Currently, the resulting drop effect is determined by the followings mapping when effectAllowed == "uninitialized": dropEffect: Actual drop effect: Expected drop effect: "none" -----------> "none" "none" "copy" -----------> "none" "copy" "move" -----------> "none" "move" "link" -----------> "none" "link" "dummy" -----------> "none" "none" As per section 7.9.2 of the HTML 5 specification <http://dev.w3.org/html5/spec/Overview.html#the-dragevent-and-datatransfer-interfaces>, when effectAllowed = "uninitialized" the resulting dropEffect should be the user-specified dropEffect (i.e. "copy", "move", "link") and "none" for any other case.
Created attachment 41831 [details] Layout test DRT-compatible layout test. Can also be manually run.
Created attachment 41832 [details] Self contained test For convenience, here is a self-contained version of the test included in the patch Layout test.
*** Bug 26700 has been marked as a duplicate of this bug. ***
Created attachment 42885 [details] Patch No test case is included because we have an existing test case (fast/events/drag-and-drop.html) from bug #24731. We just need to rebase the results of that test case.
Comment on attachment 42885 [details] Patch r=me But this test could be improved with one tiny change. This line: shouldEvaluateTo('event.dataTransfer.dropEffect', 'dropEffectElem.options[dropEffectElem.selectedIndex].value'); Should be changed to: shouldBe('event.dataTransfer.dropEffect', dropEffectElem.options[dropEffectElem.selectedIndex].value); This would then make the test output easy to read because you could see the actual result strings instead of the expression over and over again. I'm really surprised by the shouldEvaluateTo function. I don't know who added it and when, and I think I should look into this a bit more. When the second argument is a string, it's the same as shouldBe, so I'm kind of mystified why we would need it in that case.
Filed a new bug #31326 with regards to cleaning up the output, which was just r+'ed. I was able to get the prettier output by using shouldBeEqualToString as opposed to shouldBe. From looking at js-test-pre.js, shouldBe causes an exception to be thrown using the line you provided because of line 102 <http://trac.webkit.org/browser/trunk/LayoutTests/fast/js/resources/js-test-pre.js#L102>, in which eval(_b) is called. And if _b is a string, say "none", then eval("none") will be interpreted as script code, instead of returning a string. I will rebase the test with the passing of bug #31326 before I land this patch. Thanks for your suggestion. This definitely makes the test much more beautiful. (In reply to comment #5) > (From update of attachment 42885 [details]) > r=me > > But this test could be improved with one tiny change. > > This line: > > shouldEvaluateTo('event.dataTransfer.dropEffect', > 'dropEffectElem.options[dropEffectElem.selectedIndex].value'); > > Should be changed to: > > shouldBe('event.dataTransfer.dropEffect', > dropEffectElem.options[dropEffectElem.selectedIndex].value); > > This would then make the test output easy to read because you could see the > actual result strings instead of the expression over and over again. > > I'm really surprised by the shouldEvaluateTo function. I don't know who added > it and when, and I think I should look into this a bit more. When the second > argument is a string, it's the same as shouldBe, so I'm kind of mystified why > we would need it in that case.
Committed r50888: <http://trac.webkit.org/changeset/50888>