WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
33607
REGRESSION (
r49268
): DHTML drag not allowed unless event.dataTransfer.effectAllowed is set (differs from HTML5)
https://bugs.webkit.org/show_bug.cgi?id=33607
Summary
REGRESSION (r49268): DHTML drag not allowed unless event.dataTransfer.effectA...
Brian Weinstein
Reported
2010-01-13 10:18:46 PST
Created
attachment 46473
[details]
Doesn't Work REGRESSION (
r49268
): DHTML drag not allowed unless event.dataTransfer.effectAllowed is set (differs from HTML5).
Attachments
Doesn't Work
(841 bytes, text/html)
2010-01-13 10:18 PST
,
Brian Weinstein
no flags
Details
Works
(838 bytes, text/html)
2010-01-13 10:19 PST
,
Brian Weinstein
no flags
Details
WIP PATCH
(1.49 KB, patch)
2010-01-13 12:19 PST
,
Brian Weinstein
no flags
Details
Formatted Diff
Diff
WIP PATCH 2
(1.61 KB, patch)
2010-01-13 12:25 PST
,
Brian Weinstein
no flags
Details
Formatted Diff
Diff
WIP PATCH 3 - No ChangeLogs - But Code Finished
(3.48 KB, patch)
2010-01-13 12:56 PST
,
Brian Weinstein
no flags
Details
Formatted Diff
Diff
[PATCH] Fix
(5.14 KB, patch)
2010-01-13 13:16 PST
,
Brian Weinstein
bweinstein
: commit-queue-
Details
Formatted Diff
Diff
[PATCH] Simpler Fix with Adam's Comments
(5.09 KB, patch)
2010-01-13 13:54 PST
,
Brian Weinstein
aroben
: review+
bweinstein
: commit-queue-
Details
Formatted Diff
Diff
Show Obsolete
(4)
View All
Add attachment
proposed patch, testcase, etc.
Brian Weinstein
Comment 1
2010-01-13 10:19:08 PST
Created
attachment 46474
[details]
Works
Brian Weinstein
Comment 2
2010-01-13 10:26:24 PST
<
rdar://7507114
>
Brian Weinstein
Comment 3
2010-01-13 12:19:54 PST
Created
attachment 46484
[details]
WIP PATCH The additional test output with this change to the test is: 16 When effectAllowed == "undefined" 17 18 PASS event.dataTransfer.dropEffect is "none" 19 PASS event.dataTransfer.dropEffect is "none" 20 PASS event.dataTransfer.dropEffect is "none" 21 PASS event.dataTransfer.dropEffect is "none" 22 PASS event.dataTransfer.dropEffect is "none" 23 This patch fixes the test case that is attached here, but doesn't seem to be working correctly in DRT.
Brian Weinstein
Comment 4
2010-01-13 12:25:35 PST
Created
attachment 46485
[details]
WIP PATCH 2 This gives these additional results: 16 When effectAllowed == "undefined" 17 18 PASS event.dataTransfer.dropEffect is "none" 19 FAIL event.dataTransfer.dropEffect should be none. Was copy. 20 FAIL event.dataTransfer.dropEffect should be none. Was move. 21 FAIL event.dataTransfer.dropEffect should be none. Was link. 22 PASS event.dataTransfer.dropEffect is "none" 23 This is much closer.
Brian Weinstein
Comment 5
2010-01-13 12:56:18 PST
Created
attachment 46494
[details]
WIP PATCH 3 - No ChangeLogs - But Code Finished
Brian Weinstein
Comment 6
2010-01-13 13:16:01 PST
Created
attachment 46497
[details]
[PATCH] Fix
Adam Roben (:aroben)
Comment 7
2010-01-13 13:25:12 PST
Comment on
attachment 46497
[details]
[PATCH] Fix
> bool Clipboard::sourceOperation(DragOperation& op) const > { > - if (m_effectAllowed.isNull()) > - return false; > - op = dragOpFromIEOp(m_effectAllowed); > + op = dragOpFromIEOp(!m_effectAllowed.isNull() ? m_effectAllowed : String("uninitialized")); > return true; > }
Why not initialize m_effectAllowed to "uninitialized" in the Clipboard constructor? Is there other code that relies on m_effectAllowed being null?
> @@ -1,3 +1,17 @@ > +2010-01-13 Brian Weinstein <
bweinstein@apple.com
> > + > + Reviewed by NOBODY (OOPS!). > + > + REGRESSION (
r49268
): DHTML drag not allowed unless event.dataTransfer.effectAllowed > + is set (differs from HTML5). > + Fixes <
https://bugs.webkit.org/show_bug.cgi?id=33607
> and <
rdar://7507114
>. > + > + Updated the drag and drop test to test if effectAllowed isn't set, in addition > + to its other tets.
Typo: tets
> @@ -99,11 +101,11 @@ > // Extracted from the HTML 5 drag-and-drop section,
http://dev.w3.org/html5/spec/Overview.html#dnd
> if (chosenDropEffect == "none") > return true; > - if (chosenDropEffect == "copy" && ["copy", "copyLink", "copyMove", "uninitialized", "all"].indexOf(allowedDropEffect) != -1) > + if (chosenDropEffect == "copy" && ["copy", "copyLink", "copyMove", "uninitialized", "all", "undefined"].indexOf(allowedDropEffect) != -1) > return true; > - if (chosenDropEffect == "move" && ["move", "copyMove", "linkMove", "uninitialized", "all"].indexOf(allowedDropEffect) != -1) > + if (chosenDropEffect == "move" && ["move", "copyMove", "linkMove", "uninitialized", "all", "undefined"].indexOf(allowedDropEffect) != -1) > return true; > - if (chosenDropEffect == "link" && ["link", "copyLink", "linkMove", "uninitialized", "all"].indexOf(allowedDropEffect) != -1) > + if (chosenDropEffect == "link" && ["link", "copyLink", "linkMove", "uninitialized", "all", "undefined"].indexOf(allowedDropEffect) != -1) > return true; > return false; > }
I think it's a little confusing to make this change. Before your patch, isDropEffectAllowed matched a part of the HTML5 spec pretty closely. But now this function contains this new "undefined" string, which isn't mentioned in HTML5 at all. Maybe it would be better to have an explicit test somewhere that when the "undefined" effect was chosen, event.dataTransfer.effectAllowed continues to be "uninitialized"?
Brian Weinstein
Comment 8
2010-01-13 13:54:50 PST
Created
attachment 46500
[details]
[PATCH] Simpler Fix with Adam's Comments
Adam Roben (:aroben)
Comment 9
2010-01-13 13:57:54 PST
Comment on
attachment 46500
[details]
[PATCH] Simpler Fix with Adam's Comments
> Clipboard::Clipboard(ClipboardAccessPolicy policy, bool isForDragging) > : m_policy(policy) > + , m_effectAllowed("uninitialized")
At some point we should switch m_effectAllowed to be an AtomicString. Maybe when we fix setEffectAllowed to only allow setting it to certain values? r=me
Brian Weinstein
Comment 10
2010-01-13 14:00:34 PST
Committed in
r53203
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug