Re: Implementation requirements for [Callback] interfaces

David Flanagan:
> So NodeFilter needs an interface object to define constants on, and
> XPathNSResolver needs an interface object and a prototype object
> because there might actually be host objects that inherit from the
> prototype.  Should WebIDL require implementations to define
> NodeFilter.prototype?

Good question – probably not?  How should we indicate this?  Would it be
sufficient in prose to say something like “If no host objects can
implement the interface, then the prototype property of the interface
object instead does not exist”?  Or do we need a [NoPrototypeObject] or
similar to allow specifications to explicitly indicate this?

(If we do invert the meaning of [NoIntefaceObject] on callback
interfaces to [RequireInterfaceObject], then we would do that too for

> And if so, that presumably means that the DOM Traversal spec needs
> to specify the default behavior of NodeFilter.prototype.acceptNode()
> and similarly for any other spec that defines a [Callback] interface.

Yeah, if the function exists it needs to have some defined behaviour.

> (Unless, WebIDL specifies that these dummy methods do nothing and
> return undefined, but that then violates their signature).

They could throw an exception indicating that they have no

Cameron McCormack ≝

Received on Thursday, 16 June 2011 00:35:17 UTC