[Webkit-unassigned] [Bug 30266] REGRESSION(r47852): Crash on drag and drop

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Nov 3 10:09:57 PST 2009


https://bugs.webkit.org/show_bug.cgi?id=30266





--- Comment #31 from noel gordon <noel.gordon at gmail.com>  2009-11-03 10:09:56 PDT ---
To answer eric's questions:

> Is it supposed to contain both "text" and "text/plain"?  Is this spec'd
> somewhere?  I don't think Chrome and Apple WebKit should diverge here, so
> I'm confused as to why this change would be needed.

Agree, not looking to diverge here.  And for the first two questions;
when text is added to the dataTransfer object, format "text/plain", and
the relevant Section is 7.9.2 The DragEvent and DataTransfer Interfaces of
http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#dnd

Section 7.9.2 first talks about data "formats" and states that the formats
are case-sensitive and that there are legacy values:

'DataTransfer objects can hold pieces of data, each associated with a unique
 format. Formats are generally given by MIME types, with some values special-
 cased for legacy reasons. For the purposes of this API, however, the format
 strings are opaque, case-sensitive, strings, and the empty string is a valid
 format string.'

The data formats are used only in the Section 7.9.2 dataTransfer methods
clearData(format), getData(format), and setData(format, data).  These methods
mention the handling of the legacy formats similarly, and setData() is a
good example:

'The setData(format, data) method must add data to the data stored in the
 DataTransfer object, labeled as being of the type format. This must replace
 any previous data that had been set for that format. If format is the value
 "Text", then it must be treated as "text/plain". If the format is "URL",
 then it must be treated as "text/uri-list".'

So for setData("text/plain", "foo"), I'd expect to see "text/plain" in the
dataTransfer.types, and if "Text" must be treated as "text/plain", is it
reasonable to conclude that setData("Text", "foo") must do likewise?

I also see nothing in Section 7.9 Drag and Drop, that restricts the UA from
adding other formats during drag drop initialization, and they typically do.
If I select some text on the page, drag drop it on a target in the page, and
enumerate the dataTransfer.types in the drop event, my results are:

Safari 4 Mac OS X
 0:public.utf8-plain-text
 1:dyn.agu8y63n2nuuha5dbrf1ca2pxqry0wkduqf31k3pcr7u1e3basv61a3k
 2:text/plain

Chrome 3.0.195.27 Vista
 0:Text
 1:text/plain

FF 3.5.3, 3.6b1 Vista
 0:text/_moz_htmlcontext
 1:text/_moz_htmlinfo
 2:text/html
 3:text/plain

Hope that answers your last question about sort order etc.  When I write
cross-browser js for HTML5 text drag drop, I look for "text/plain" in the
dataTransfer.types only.  That's the only point of convergence I've found,
and agrees with my understanding of the HTML5 drag drop spec.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list