Re: [clipboard-apis] The ClipboardEvent constructor is strange (#10)

> What you're missing is some line somewhere saying that if dispatchEvent() is called with an event object whose constructor is ClipboardEvent, the implementation should run the "fire a clipboard event" steps?

That would amount to monkey patching of DOM's [dispatch](https://dom.spec.whatwg.org/#concept-event-dispatch), and I don't think any other spec adds special steps to run as part of that algorithm, at least in Blink's implementation I see nothing like it. CC @annevk

I can see two solutions:
 1. Add a `DataTransfer` constructor and make `ClipboardEventInit` like [`DragEventInit`](https://html.spec.whatwg.org/#the-dragevent-interface).
 2. Let `ClipboardEventInit` and `DragEventInit` have no dictionary members at all, and make the constructors create events with a `DataTransfer` instance with nothing in it. It looks like `DataTransferItemList.add()` can be used to populate it.

---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/clipboard-apis/issues/10#issuecomment-124009204

Received on Thursday, 23 July 2015 07:52:39 UTC