Re: [whatwg/dom] "create an event" doesn't work for certain UI events (#414)

@hayatoito @TakayoshiKochi here's my rough idea:

* An event interface has "construction steps". By default these steps do nothing.
* Before returning from https://dom.spec.whatwg.org/#inner-event-creation-steps, for each inherited interface of _event_, starting with the outermost one, we run their construction steps.

So when you create a TouchEvent object, these construction steps can take care of initializing the "touch target list". When you create a MouseEvent, they can take of initializing "relatedTarget" (and maybe some other fields). Same for KeyboardEvent's special requirements, etc.

Does that make sense?

(I'm not entirely sure if the inheritance is needed or if we can do with a single set of steps per event class. Maybe we should just have a single set of steps for now and if inheritance becomes a need somewhere they can implement their own.)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/414#issuecomment-373682220

Received on Friday, 16 March 2018 11:11:30 UTC