[webkit-dev] On IDL files, events and writing DOM bindings

Adam Barth abarth at webkit.org
Tue Aug 10 11:32:43 PDT 2010

On Tue, Aug 10, 2010 at 11:26 AM, Xan Lopez <xan at gnome.org> wrote:
> as we all know, when writing DOM bindings on top of WebKit we are
> supposed to use the IDL files it ships as the source of the structure
> and behavior of the DOM. At first I had assumed that to figure out
> which events apply to each type/class it was OK to see which
> EventListeners were defined, and go on from there (ie, if there's a
> onabort defined in Element.idl, Element has an 'abort' Event defined).
> This, though, seems to be not completely accurate in many cases, and
> in others it's downright absent:
> Media elements are defined to have, for example, an 'ended' event,
> emitted when the playback has finished. The matching attribute is
> defined in HTMLMediaElement.idl, but the event listener for it is in
> DOMWindow.idl. This was done here
> https://bugs.webkit.org/show_bug.cgi?id=26100 completely on purpose,
> so I assume this is how it's meant to work.
> So the question is: is it possible to know which Events are defined
> for each class just from the IDL files, or are we expected to inject
> part of this knowledge ourselves when writing the bindings?

I'm not sure I understand your question.  Every event can happen on
every EventTarget.


More information about the webkit-dev mailing list