W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2013

Re: [whatwg] Should UA start dragging if [draggable] attr was set after mousedown?

From: Ian Hickson <ian@hixie.ch>
Date: Tue, 26 Nov 2013 21:30:24 +0000 (UTC)
To: Даниил Костин <danya.postfactum@gmail.com>
Message-ID: <alpine.DEB.2.00.1311262127360.27766@ps20323.dreamhostps.com>
Cc: whatwg@lists.whatwg.org
On Sat, 7 Sep 2013, Даниил Костин wrote:
> Hello. I am web developer. I contribute to the ACE (ace.ajax.org) project
> (web-based code editor).
> I faced with the issue that IE does not start dragging element if it's
> [draggable] attribute was set with some delay after mousedown event:
> element.draggable = false;
> > element.onmousedown = function() {
> >     setTimeout(function(){ element.draggable = true }, 150);
> > };
> Meanwhile, this works fine in other browsers. I tried to find this behavior
> to be defined by DND specification (
> http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#dnd)
> but found nothing related.
> I reported the bug (
> https://connect.microsoft.com/IE/feedback/details/799913/ie-8-11-ignores-draggable-attribute-when-set-after-mousedown-event-using-settimeout)
> but I am not sure this is really bug.
> May we we should add more specific explanation of DND initiatialization, to
> prevent such kind of misunderstanding?

This is actually defined already.

The key is that the algorithm here:


...triggers when the user "attempts to begin a drag operation". Only at 
that point does the "draggable" attribute have any effect.

The question is, when does the user "attempt to begin" a drag operation? 
You can tell becaus immediately after the user does so, a "dragstart" 
event is fired.

In the case of IE, is the dragstart event fired immediately after the 
mousedown event, or is it fired over 150ms after? Does the event fire 
before or after the timeout?

Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Tuesday, 26 November 2013 21:30:48 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:14 UTC