Re: Expected behavior on getFeature() when feature does not introduce a specialized interface?

Curt Arnold <carnold@houston.rr.com> wrote:

> Validation does not introduce a specialized interface for DOM 
> implementations (neither does Events) and the spec does not give 
> explicit guidance to the expected return value. My instinct is that it 
> should be null.

Hmm. As the spec stands, I agree - the only alternative it could return a
non-implementation object associated with the feature such as a NodeEditVAL
or EventTarget, but without a document it is unclear where the object
instance would come from or what use it would be.

> Returns an object which implements the specialized APIs of the specified 
> feature and version, if any, or null if there is no object which 
> implements interfaces associated with that feature

> + or the feature does not define a specialization of DOMImplementation.

However non-DOMImplementation objects may also be returned (theoretically;
I haven't seen any DOM modules that actually use this - is the whole
hasFeature '+' business really a useful option?). The tricky bit is to tell
the difference between an interface that is intended to be returned from
getFeature but is not a specialisation of the owner interface, and
unrelated interfaces defined by the spec. IMO it should be up to each
module to state which extended interfaces are associated with which core
interfaces through getFeature, but currently Events and Validation don't
explicitly say.

-- 
Andrew Clover
mailto:and@doxdesk.com
http://www.doxdesk.com/

Received on Tuesday, 6 January 2004 19:08:47 UTC