Re: [Bindings] comments

On Tue, 01 Jan 2008 08:39:10 +0100, Cameron McCormack <cam@mcc.id.au>  
wrote:
> Well, I think the IDL is only interesting when it can be mapped to
> concrete languages.  I don’t feel terribly strongly about either the
> current name or “Web IDL”.  Renaming has some non-zero overhead, though.
> If others think it’s a more accurate name and is worth the effort of
> renaming, I don’t mind.

I suppose, my main point is that "Language Bindings for DOM  
Specifications" doesn't tell that the specification defines an IDL  
language.


>> It would be really good if we had a way to say that a particular  
>> interface is exposed on the global object in ECMAScript. For instance,  
>> it makes
>> sense to have window.XMLHttpRequest, but window.DocumentSelector is not
>> necessary given that you already have window.Document.
>
> Would you settle for a way to say a particular interface isn’t exposed
> on the global object? :)

That works. It's probably the less common case anyway.


> One possible reason to expose DocumentSelector is so that you can
> replace methods on the prototype, e.g.:
>
>   DocumentSelector.prototype.enableStylesheetsForSet = …
>
> which you can’t really do if you just have access to Document.

Maybe the problem is more how things are implemented then. When working on  
the CSSOM I looked at the WebKit source code and the sheet DOM attribute  
was put directly on HTMLStyleElement for instance with a comment above it  
mentioning the LinkStyle interface.


>> For constructors, I was wondering whether it's desirable to be able to
>> express the Image() constructor on HTMLImageElement or not. (If so,  
>> you'd need a way to name a constructor.) The way HTML 5 solves that  
>> problem
>> currently seems pretty simple too. In addition constructors probably  
>> need to be able to deal with overloading as well.
>
> Maybe.  They are peculiarities, and there probably won’t be more of
> these type of constructors-with-different-names.  Since they are only
> useful for ECMAScript, and given the relatively simple definition of
> them in HTML 5, I’m inclined not to add some more syntax to allow it.
> I’ve put an ednote in the document mentioning it, though.

I guess the "problem" is that if you say there's a constructor Foo(x, y),  
Foo(x) and define that it returns an object implementing the FooElement  
element interface it's not entirely clear how that constructor is exposed  
in various languages. I'm not sure how important that is though.


-- 
Anne van Kesteren
<http://annevankesteren.nl/>
<http://www.opera.com/>

Received on Thursday, 3 January 2008 00:11:40 UTC