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

Ian Hickson ian at hixie.ch
Tue Nov 26 13:30:24 PST 2013


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:

   http://whatwg.org/html/#drag-and-drop-processing-model

...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.   `._.-(,_..'--(,_..'`-.;.'


More information about the whatwg mailing list