W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2011

Re: Question about implementing DataTransfer.addElement

From: Ian Hickson <ian@hixie.ch>
Date: Mon, 10 Oct 2011 22:26:15 +0000 (UTC)
To: Daniel Cheng <dcheng@chromium.org>
cc: public-webapps <public-webapps@w3.org>
Message-ID: <Pine.LNX.4.64.1110102224200.20981@ps20323.dreamhostps.com>
On Fri, 7 Oct 2011, Daniel Cheng wrote:
>
> What's the difference between addElement and setDragImage()?
> 
> The spec says:
> 
> > The difference between setDragImage() and addElement() is that the 
> > latter automatically generates the image based on the current 
> > rendering of the elements added (potentially keeping it updated as the 
> > drag continues, e.g. if the elements include an actively playing 
> > video), whereas the former uses the exact specified image at the time 
> > the method is invoked.
> 
> For technical reasons, animating the drag image is non-trivial and not 
> likely to be implemented in the near future, if it is ever implemented. 
> However, if we don't implement dynamic drag image updates, doesn't that 
> make it essentially the same as setDragImage()? In that case, what's the 
> point of having addElement(); wouldn't it make more sense to just remove 
> it rather than having two different ways of doing the same thing?

The parenthetical isn't the important part (that's why it's 
parenthetical). The important difference between setDragImage() and 
addElement() is that the latter automatically generates the image based on 
the current rendering of the elements added whereas the former uses the 
exact specified image. So for example if the user is dragging an element 
with some complicated CSS styles, that's what gets drawn with 
addElement(), whereas the author has no sane way of providing an image 
that contains equivalent pixels.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Monday, 10 October 2011 22:30:25 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:48 GMT