[whatwg] Drag-and-drop feedback

Garrett Smith dhtmlkitchen at gmail.com
Sun Oct 11 15:12:58 PDT 2009

On Tue, Nov 25, 2008 at 6:52 PM, Ian Hickson <ian at hixie.ch> wrote:
> (Note: feedback relating to drag-and-drop of files from the filesystem,
> with possible uploading of content, isn't included in this e-mail. I am
> waiting to see what happens with the Web Apps File Upload spec.)
> On Mon, 30 Apr 2007, Jon Barnett wrote:
>> On 4/30/07, Ian McKellar <ian at mckellar.org> wrote:
>> > On 4/25/07, David Hyatt <hyatt at apple.com> wrote:
>> > > The use case of being able to drop images into a contenteditable
>> > > region and have them show up as <img> elements at the appropriate
>> > > place and then get automatically uploaded somewhere is a really
>> > > compelling one.
>> Is there already an API for knowing exactly where something is dropped?
>> Possibly - an empty Range object as either the relatedTarget or part of
>> the detail of a drop event.
> There isn't, but isn't the cursor moved to the drop target position
> automatically in most systems? And in systems where that doesn't happen,
> shouldn't the drop happen where the cursor is anyway?
> On Wed, 18 Jun 2008, 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'?
> No. If you really wanted to create your own DragEvent object, you'd have
> to "fake" a DataTransfer object using a JS object that happened to
> implement all the right attributes and methods.

If I understand correctly, the rationale for the design decisions for
HTML5 drag and drop was largely founded upon existing functionality in
IE and Safari.

My question is:
Which browser does document.initDragEvent work in?

Document.initDragEvent is inordinately long and cumbersome, taking 16
arguments, and requiring the creation of a DataTransfer object. That
seems extremely cumbersome just to get a drag event to fire. This
method doesn't seem to be implemented anywhere FWICT. Was it copied
from an existing implementation? It seems to have been an invention.
But whose?

There doesn't seem to be any implementation for creating and
dispatching drop events. The  problem of creating and dispatching drag
events still exists and needs a good solution. The solution provided
by HTML 5 is cumbersome. As proposed:

  createInitedEvent(type, options);
     The event has default values, based on the type.

    |options| type: object
    |options| provides property/value pairs that replace
default values for the event. If a default value is not
replaced by an option property value, then the default value
is used instead.



More information about the whatwg mailing list