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

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

Received on Thursday, 23 February 2012 17:38:08 UTC