[whatwg] Changing the type of event.dataTransfer.types

Daniel Cheng dcheng at chromium.org
Thu Feb 23 17:38:08 PST 2012


For a long time, WebKit returned types as an Array rather than a
DOMStringList. I fixed this recently, but arv pointed out that
DOMStringList is deprecated in favor of Array:
http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#interface-domstringlist

Given that, wouldn't it make sense to change event.dataTransfer.types to be
a live Array instead of a live DOMStringList? It's not needed for legacy
compatibility with IE, which didn't have .types. It was implemented
differently in Gecko and WebKit, so pages ought to be checking for this
already with:
if (event.dataTransfer.contains) {
  ...
} else if (event.dataTransfer.indexOf) {
  ...
}
As a result, the burden of such a change to well-behaved web developers
should be minimal.

Daniel


More information about the whatwg mailing list