[whatwg] more drag/drop feedback
Thomas Broyer
t.broyer at gmail.com
Wed Jun 18 14:31:48 PDT 2008
On Wed, Jun 18, 2008 at 4:46 PM, Neil Deakin wrote:
> The initDragEvent/initDragEvent methods take a DataTransfer as an argument.
> Is it expected that the DataTransfer to use here can be created with 'new
> DataTransfer'?
>
> IE and Safari allow a no-argument form of clearData as well which clears all
> formats.
FWIW, Adobe AIR's Clipboard (which is equivalent to the DataTransfer
object) has a clear() no-argument method.
See:
http://livedocs.adobe.com/flex/3/langref/flash/events/NativeDragEvent.html
http://help.adobe.com/en_US/AIR/1.1/jslr/flash/desktop/Clipboard.html
> The description for the 'types' property implies that this should be a live
> list. Why?
Maybe so that you can keep a reference to it while setData/clearData
is being called? But couldn't you just keep a reference to the
DataTransfer object? It seems that IE doesn't have such a property.
Adobe AIR's WebKit does, but how about Safari?
> The clearData, setData and getData methods should clarify what happens if an
> empty format is supplied.
For my personal culture, what happens in IE and Safari?
> I still don't understand the purpose of the addElement method.
I think addElement is there to allow e.g. "dialog boxes" where the box
can be dragged using its "title bar": only the title-bar is draggable
but ondragstart it adds the whole dialog box to the list of what is
being dragged...
> Either this
> should be removed or there should be clarification of the difference between
> addElement and setDragImage
setDragImage is only about the "drag feedback", not "what is being
dragged", if I understand correctly...
> Previously, I said that DragEvents should be UIEvents. I think they should
> instead inherit from MouseEvent.
FWIW, NativeDragEvent in Adobe AIR inherits MouseEvent.
> We have a need to be able to support both dragging multiple items, as well
> as dragging non-string data, for instance dragging a set of files as a set
> of File objects (see http://www.w3.org/TR/file-upload/) from the file system
> onto a page.
That would be new data formats.
That's how Adobe AIR solved the problem. They added a Bitmap and File
list data formats, for which getData returns AIR-specific objets (a
BitmapData and an array of File objects respectively)
http://help.adobe.com/en_US/AIR/1.1/jslr/flash/desktop/ClipboardFormats.html
http://livedocs.adobe.com/air/1/devappshtml/DragAndDrop_2.html#1048911
> For this, we would also like to propose methods like the following, which
> are analagous to the existing methods (where Variant is just any type of
> object):
I don't see a real need for them (others didn't need them while
providing the same features) and they wouldn't be backwards compatible
with IE and Safari, while AFAIK the current draft is.
--
Thomas Broyer
More information about the whatwg
mailing list