https://bugs.webkit.org/show_bug.cgi?id=79158
Reviewed by Tony Chang.
Source/WebKit/chromium:
We constructed the WebDragData::Item for dragging out an image but never added it to the
item list. This is normally covered by the fast/events/drag-image-filename.html layout test,
but the bug wasn't caught in the original patch since the implementations in Chrome and DRT
had diverged.
* src/WebDragData.cpp:
(WebKit::WebDragData::items):
Tools:
* DumpRenderTree/chromium/EventSender.cpp:
(EventSender::dumpFilenameBeingDragged):
(EventSender::beginDragWithFiles):
* DumpRenderTree/chromium/WebViewHost.cpp:
(addDRTFakeFileToDataObject):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108419
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-02-21 Daniel Cheng <dcheng@chromium.org>
+
+ [chromium] Fix image drag out on Chromium
+ https://bugs.webkit.org/show_bug.cgi?id=79158
+
+ Reviewed by Tony Chang.
+
+ We constructed the WebDragData::Item for dragging out an image but never added it to the
+ item list. This is normally covered by the fast/events/drag-image-filename.html layout test,
+ but the bug wasn't caught in the original patch since the implementations in Chrome and DRT
+ had diverged.
+
+ * src/WebDragData.cpp:
+ (WebKit::WebDragData::items):
+
2012-02-21 David Grogan <dgrogan@chromium.org>
IndexedDB: webFrame isn't threadsafe, don't use it from a worker thread
item.storageType = Item::StorageTypeBinaryData;
item.binaryData = m_private->fileContent();
item.title = m_private->fileContentFilename();
+ itemList.append(item);
}
// We don't handle filenames here, since they are never used for dragging out.
return itemList;
+2012-02-21 Daniel Cheng <dcheng@chromium.org>
+
+ [chromium] Fix image drag out on Chromium
+ https://bugs.webkit.org/show_bug.cgi?id=79158
+
+ Reviewed by Tony Chang.
+
+ * DumpRenderTree/chromium/EventSender.cpp:
+ (EventSender::dumpFilenameBeingDragged):
+ (EventSender::beginDragWithFiles):
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (addDRTFakeFileToDataObject):
+
2012-02-21 Dirk Pranke <dpranke@chromium.org>
webkitpy: speed up hot filesystem_mock functions
void EventSender::dumpFilenameBeingDragged(const CppArgumentList&, CppVariant*)
{
- printf("Filename being dragged: %s\n", currentDragData.fileContentFilename().utf8().data());
+ WebString filename;
+ WebVector<WebDragData::Item> items = currentDragData.items();
+ for (size_t i = 0; i < items.size(); ++i) {
+ if (items[i].storageType == WebDragData::Item::StorageTypeBinaryData) {
+ filename = items[i].title;
+ break;
+ }
+ }
+ printf("Filename being dragged: %s\n", filename.utf8().data());
}
WebMouseEvent::Button EventSender::getButtonTypeFromButtonNumber(int buttonCode)
{
currentDragData.initialize();
Vector<string> files = arguments[0].toStringVector();
- for (size_t i = 0; i < files.size(); ++i)
- currentDragData.appendToFilenames(webkit_support::GetAbsoluteWebStringFromUTF8Path(files[i]));
+ for (size_t i = 0; i < files.size(); ++i) {
+ WebDragData::Item item;
+ item.storageType = WebDragData::Item::StorageTypeFilename;
+ item.filenameData = webkit_support::GetAbsoluteWebStringFromUTF8Path(files[i]);
+ currentDragData.addItem(item);
+ }
currentDragEffectsAllowed = WebKit::WebDragOperationCopy;
// Provide a drag source.
// dragging a file.
static void addDRTFakeFileToDataObject(WebDragData* dragData)
{
- dragData->appendToFilenames(WebString::fromUTF8("DRTFakeFile"));
+ WebDragData::Item item;
+ item.storageType = WebDragData::Item::StorageTypeFilename;
+ item.filenameData = WebString::fromUTF8("DRTFakeFile");
+ dragData->addItem(item);
}
// Get a debugging string from a WebNavigationType.