Re: [touch-events] TouchEvent constructor is very unusual since it converts one type of object (sequence) to another type (TouchList) (#54)

I wouldn't want to say it's necessarily too late to remove `sequence<Touch>` from `TouchEventInitDict`.  We could certainly try (eg. support both, flip our guidance, measure usage of the current approach and remove once usage is low enough).  My guess is that this is new enough that we could probably pull it off, but we'd need good justification for doing so.

To me, from a web dev perspective that design seems strictly worse.  They don't think about `TouchList` when using touch events.  To a JS web dev, they feed in arrays and get something that they treat like an array out.  So forcing them to create a weird `TouchList` thing as an extra layer around their array seems like a net loss for the developer.

I looked for precedent elsewhere and found [one example of something similar](https://notifications.spec.whatwg.org/#dom-notificationoptions-actions) in the notifications spec.  There they use a `sequence<NotificationAction>` for input and a `FrozenArray<NotificationAction>` for output.

It would probably be compatible to replace `TouchList` with `FrozenArray<Touch>` in `TouchEvent`, right?  Of course we'd have to keep `TouchList` around for anyone using `createTouchList`, but we could deprecate it.

---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/touch-events/issues/54#issuecomment-166749309

Received on Tuesday, 22 December 2015 22:23:43 UTC