Re: Non-constructible constructors and Arrays

On 9/9/11, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> On 9/9/11 2:45 PM, Garrett Smith wrote:
>>> For example, what should |new Element()| do if the specification doesn't
>>> define it?
> ...
>>>     There's no sane behavior, because you have no idea what tag
>>> name to give it.
>>>
>> Possibly HTMLUnknownElement
>
> Which will return what, exactly, from the localName getter?
>
> And the point is that the answer to this question cannot be defined in
> the general IDL spec.  It needs to be defined in the spec that defines
> the Element interface.  So if you want a constructor here, the spec
> defining Element needs to have explicit verbiage defining the behavior
> of that constructor.
>
>>> You can find some examples where the behavior is "clear"... But even in
>>> the |new HTMLDivElement| case, what would define what the ownerDocument
>>> of the new element is?  WebIDL itself certainly can't make such a
>>> definition.  The fact that an ownerDocument even exists is specific to
>>> the HTMLDivElement interface, and whatever spec defines that interface
>>> would need to explicitly address that.
>>>
>> The global object's window's document -- window.document
>
> Yes, but the point is that WebIDL itself can't define that!  It can't
> define the behavior of random properties on random interfaces.  The only
> thing that can define that is the spec that defines that interface.  In
> this case, the spec defining Element would need to say what the
> ownerDocument of the result is set to.
>
OK, so in the case of Element, that would be web dom core, right?
http://www.w3.org/TR/domcore/

> Is this really such a hard concept to grasp?  I'm getting the feeling
> that people are really confused about what WebIDL itself can define and
> what specs using WebIDL as their interface description language can
> define...
>
"This document defines an interface definition language, Web IDL, that
can be used to describe interfaces that are intended to be implemented
in web browsers."

So essentially, you want to describe in a general sense how interface
objects work and leave the specifics of how they're implemented to the
specifications in which define them. Did I get that right?

It might help if WebIDL had a small section on "Scope of this
Document", to define what it defines and what it does not define.
-- 
Garrett

Received on Friday, 9 September 2011 19:05:17 UTC