SomethingEventInit dictionaries

The draft currently includes an interesting pattern (thanks Yang for
inadvertently reminding me of this) for declaration of Event classes.
It goes like this:

[Constructor(SomethingEventInit data)]
interface SomethingEvent : Event {
    readonly attribute Something attr;
}
dictionary SomethingEventInit {
    Something attr;
}

After having actually implemented most of this stuff, most of the time
it is sufficient (in JavaScript at least) to instantiate Event and
tack the necessary attributes on.  Even in a formal sense, the
SomethingEventInit object has no need to be in the public namespace,
let alone the specification.  I can understand why the internals of
your implementation might use these, but are really just browser
internals.  Applications don't need either definition.  Why isn't the
pattern like so?

[NoInterfaceObject]
interface SomethingEvent : Event {
    readonly attribute Something attr;
}

It would be a lot clearer that way.  You also don't have to worry
about putting the RTC prefix on these either, since the name is only a
specification convenience.

Received on Friday, 19 October 2012 00:31:32 UTC