The issue here seems to be that setData('URL') and setData('text/uri-list') do not preserve the original string. Patch forthcoming.
Committed r69174: <http://trac.webkit.org/changeset/69174>
Created attachment 69885 [details] Patch
Sorry, my patch went to the wrong bug. Is there any way to delete that?
Created attachment 69966 [details] Patch for this issue
Comment on attachment 69966 [details] Patch for this issue View in context: https://bugs.webkit.org/attachment.cgi?id=69966&action=review (not changing the review flag because I don't feel qualified to r+ the gtk+ specific code) > WebCore/platform/gtk/DataObjectGtk.cpp:66 > + // This code is originally from: platform/chromium/ChromiumDataObject.cpp. Can you add a FIXME that says we should try to refactor this code for sharing across platforms? > WebCore/platform/gtk/DataObjectGtk.cpp:104 > void DataObjectGtk::setURL(const KURL& url, const String& label) > { > + m_url = url; This seems redundant since setURIList should do this for you. > WebCore/platform/gtk/PasteboardHelper.cpp:141 > + CString uriList = dataObject->uriList().utf8(); > + gtk_selection_data_set(selectionData, uriListAtom, 8, > + reinterpret_cast<const guchar*>(uriList.data()), strlen(uriList.data()) + 1); Would urList.length() + 1 be better than calling strlen?
Created attachment 69975 [details] Patch with Tony's suggestions
(In reply to comment #5) Thanks for the comments. > > WebCore/platform/gtk/DataObjectGtk.cpp:66 > > + // This code is originally from: platform/chromium/ChromiumDataObject.cpp. > Can you add a FIXME that says we should try to refactor this code for sharing across platforms? Done. > > WebCore/platform/gtk/DataObjectGtk.cpp:104 > > void DataObjectGtk::setURL(const KURL& url, const String& label) > > { > > + m_url = url; > This seems redundant since setURIList should do this for you. Instead of using setURIList here, I've switched it to simply do m_uriList = url;, to avoid any unintended side-effects (like settings files on the DataObject). > > WebCore/platform/gtk/PasteboardHelper.cpp:141 > > + CString uriList = dataObject->uriList().utf8(); > > + gtk_selection_data_set(selectionData, uriListAtom, 8, > > + reinterpret_cast<const guchar*>(uriList.data()), strlen(uriList.data()) + 1); > Would urList.length() + 1 be better than calling strlen? It definitely is! Fixed.
Comment on attachment 69975 [details] Patch with Tony's suggestions I still think it would be nice if someone more familiar with the GTK+ port would review.
Comment on attachment 69975 [details] Patch with Tony's suggestions Clearing flags on attachment: 69975 Committed r69530: <http://trac.webkit.org/changeset/69530>
Comitted as http://trac.webkit.org/changeset/69530 .