[Webkit-unassigned] [Bug 28293] [Chromium] event.datatransfer.getdata("text/uri-list") treated the same as getdata("URL")
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Dec 23 11:08:25 PST 2009
https://bugs.webkit.org/show_bug.cgi?id=28293
--- Comment #13 from Erik Arvidsson <arv at chromium.org> 2009-12-23 11:08:24 PST ---
This does not seem to handle comments in the uri-list correctly.
See http://www.rfc-editor.org/rfc/rfc2483.txt for more info on the
text/uri-list format.
The following should work:
var CRLF = '\r\n';
var SAMPLE_URI_LIST = [
'# This is a comment',
'http://webkit.org',
'http://chromium.org'
].join(CRLF);
function handleDragStart(e) {
e.dataTransfer.setData('text/uri-list', SAMPLE_URI_LIST);
}
function handleDrop(e) {
var uris = e.dataTransfer.getData('text/uri-list').split(CRLF);
// remove potential comments
uris = uris.filter(function(uri) {
return uri[0] !== '#';
});
assertEquals(2, uris.length);
assertEquals('http://webkit.org', uris[0]);
assertEquals('http://chromium.org', uris[1]);
}
I don't think we need to preserve the comments but I think it would be
acceptable if we did.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list