PSA: document.createEvent will no longer automatically support new event interfaces

27 views
Skip to first unread message

Philip Jägenstedt

unread,
Aug 4, 2016, 11:32:27 AM8/4/16
to blink-dev, Anne van Kesteren
Hi Blinkers,

https://github.com/whatwg/dom/issues/289 prompted me to look at document.createEvent again today, and it became apparent that new event interfaces were still being automatically supported via document.createEvent. This is uncool for several reasons:
  • New interfaces have constructors and never have init*Event() methods, so it's not possible to do much with the returned event objects. (Use the constructor.)
  • Each event interface that is supported via createEvent needs a no-argument C++ constructor. In practice that means that things that are non-nullable in the IDL (like BlobEvent#data) end up initialized as null.
  • A growing list in https://dom.spec.whatwg.org/#dom-document-createevent is silly and makes DOM depend on every other spec.
No more!

I plan to also follow up with reducing the set of interfaces supported via document.createEvent, but will send intents to deprecate/remove for that.

Philip

Philip Jägenstedt

unread,
Aug 4, 2016, 11:35:20 AM8/4/16
to blink-dev, Anne van Kesteren

PhistucK

unread,
Aug 4, 2016, 11:48:41 AM8/4/16
to Philip Jägenstedt, blink-dev, Anne van Kesteren
I wrote it in the issue already - all of the upcoming events should be removed before they reach stable (PaymentRequest was approved to ship in late June, but maybe others also have and I missed them).


PhistucK

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

Philip Jägenstedt

unread,
Aug 4, 2016, 5:35:48 PM8/4/16
to PhistucK, blink-dev, Anne van Kesteren
https://codereview.chromium.org/2216593002/ is already in the CQ for that.

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
Reply all
Reply to author
Forward
0 new messages