RESOLVED DUPLICATE of bug 30527 33738
DataTransfer interface does not work on Windows
https://bugs.webkit.org/show_bug.cgi?id=33738
Summary DataTransfer interface does not work on Windows
Daniel Cheng
Reported 2010-01-15 14:05:45 PST
The format enumerator isn't being called correctly in ClipboardWin::types and ClipboardWin::hasData.
Attachments
Patch for the problems described (2.37 KB, patch)
2010-01-15 14:10 PST, Daniel Cheng
aroben: review-
Patch (4.61 KB, patch)
2010-01-15 16:57 PST, Daniel Cheng
aroben: review-
dcheng: commit-queue-
Daniel Cheng
Comment 1 2010-01-15 14:10:41 PST
Created attachment 46711 [details] Patch for the problems described
Adam Roben (:aroben)
Comment 2 2010-01-15 14:43:42 PST
Comment on attachment 46711 [details] Patch for the problems described > + Not sure how to add a good test for it. I'll bet we can come up with a test. If .types and .getData are completely broken, it should be pretty easy! There are probably existing tests you can build off of; grep through LayoutTests for uses of event.dataTransfer. > + * platform/win/ClipboardWin.cpp: > + (WebCore::addMimeTypesForFormat): > + (WebCore::ClipboardWin::types): > + (WebCore::ClipboardWin::hasData): You should add function-level comments about what your patch does and why. > @@ -568,7 +568,7 @@ HashSet<String> ClipboardWin::types() co > > FORMATETC data; > > - while (SUCCEEDED(itr->Next(1, &data, 0))) { > + while (itr->Next(1, &data, 0) == S_OK) { > addMimeTypesForFormat(results, data); > } > > @@ -789,7 +789,7 @@ bool ClipboardWin::hasData() > > FORMATETC data; > > - if (SUCCEEDED(itr->Next(1, &data, 0))) { > + if (itr->Next(1, &data, 0) == S_OK) { > // There is at least one item in the IDataObject > return true; > } It might be worth adding a comment about the return value of IEnumFORMATETC::Next. The code changes look good, but r- so we can come up with a test and fix up the ChangeLog.
Daniel Cheng
Comment 3 2010-01-15 16:57:49 PST
Created attachment 46719 [details] Patch Updated ChangeLog, added a few comments in the code, and updated a layout test. As it turns out, fast/events/drag-and-drop-dataTransfer-types-nocrash.html already partially covers this so I extended it to test event.dataTransfer.getData() as well.
Adam Roben (:aroben)
Comment 4 2010-01-18 06:20:21 PST
Comment on attachment 46719 [details] Patch This looks great! The one thing we still need to do is actually enable that test on Windows. You will find it listed in LayoutTests/platform/win/Skipped. Please remove it from that file and resubmit your patch and we can get this committed!
Adam Roben (:aroben)
Comment 5 2010-01-18 06:21:38 PST
Duping to bug 30527. Daniel, please attach your next revision of the patch to that bug. *** This bug has been marked as a duplicate of bug 30527 ***
Note You need to log in before you can comment on or make changes to this bug.