-
rolandsteiner@chromium.org authored
Bug 28293 - [Chromium] event.datatransfer.getdata("text/uri-list") is treated the same as getdata("URL") https://bugs.webkit.org/show_bug.cgi?id=28293 Reviewed by David Levin. WebCore: Change ChromiumDataObject such that it treats types "URL" and "text/uri-list" correctly for event.dataTransfer.getData/setData. Currently both are treated as synonyms, but for "URL", getData is supposed to only return the first valid URL contained within the data for "text/uri-list" (see HTML5 spec). Tests: editing/pasteboard/dataTransfer-setData-getData.html * platform/chromium/ChromiumDataObject.cpp: (WebCore::ChromiumDataObject::clear): (WebCore::ChromiumDataObject::clearAllExceptFiles): (WebCore::ChromiumDataObject::hasData): (WebCore::ChromiumDataObject::ChromiumDataObject): * platform/chromium/ChromiumDataObject.h: (WebCore::ChromiumDataObject::clearURL): (WebCore::ChromiumDataObject::hasValidURL): (WebCore::ChromiumDataObject::getURL): (WebCore::ChromiumDataObject::setURL): * platform/chromium/ClipboardChromium.cpp: (WebCore::): (WebCore::clipboardTypeFromMIMEType): (WebCore::ClipboardChromium::clearData): (WebCore::ClipboardChromium::getData): (WebCore::ClipboardChromium::setData): (WebCore::ClipboardChromium::types): * platform/chromium/DragDataChromium.cpp: (WebCore::DragData::asURL): (WebCore::DragData::canSmartReplace): WebKit/chromium: Change ChromiumDataObject such that it treats types "URL" and "text/uri-list" correctly for event.dataTransfer.getData/setData. Currently both are treated as synonyms, but for "URL", getData is supposed to only return the first valid URL contained within the data for "text/uri-list" (see HTML5 spec). Tests: editing/pasteboard/dataTransfer-setData-getData.html * src/WebDragData.cpp: (WebKit::WebDragData::url): (WebKit::WebDragData::setURL): LayoutTests: Change ChromiumDataObject such that it treats types "URL" and "text/uri-list" correctly for event.dataTransfer.getData/setData. Currently both are treated as synonyms, but for "URL", getData is supposed to only return the first valid URL contained within the data for "text/uri-list" (see HTML5 spec). Layout test checks various combinations in a drag-n-drop operation. Skipping on all other platforms since they don't implement this correctly, either. * editing/pasteboard/dataTransfer-setData-getData.html: Added. * editing/pasteboard/script-tests/dataTransfer-setData-getData.js: Added. (dragTarget): (moveMouseToCenterOfElement): (dragOntoDragTarget): (doDrop): (test): (runTest): * platform/mac/Skipped: * platform/gtk/Skipped: * platform/qt/Skipped: * platform/win/Skipped: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55766 268f45cc-cd09-0410-ab3c-d52691b4dbfc
c8cdfb93