W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2011

Re: Selectors API IDL Issues

From: Lachlan Hunt <lachlan.hunt@lachy.id.au>
Date: Sat, 02 Apr 2011 11:46:02 +0200
Message-ID: <4D96F05A.7080508@lachy.id.au>
To: public-webapps <public-webapps@w3.org>
On 2011-04-02 07:20, Cameron McCormack wrote:
> Lachlan Hunt:
>>> [Supplemental]
>>> interface Element {
>>> Element querySelector(in DOMString selectors, in optional any
>>> ...
>>> }
>> This adds another method to Element.prototype
>>> [NoInterfaceObject]
>>> interface NodeSelector {
>>> Element querySelector(in DOMString selectors, in optional any
>>> ...
>>> };
>>> Element implements NodeSelector
> Boris Zbarsky:
>> This adds a new interface called NodeSelector and says that any
>> instance of Element must implement this interface.

Right, I get that much, but that mail I linked to previously claimed 
this difference was somehow observable from scripts, but I don't see 
how.  Since [NoInterfaceObject] means that no script can possibly see 
whether or not NodeSelector really exists, from a black box perspective 
I don't see how that has any effect on the implementation.

>> But it does not add to Element.prototype; the method goes on the
>> mixin prototype object.

If that's the case, if the spec uses [NoInterfaceObject] and 
'implements', does that mean the spec will disagree with WebKit, Gecko, 
IE and Opera's implementation of selectors API?  AFAICS, all of them 
expose the querySelector* methods on Element.prototype.

See this:


Check the log at the bottom, where it shows all four browsers find 
querySelector/querySelectorAll in Element.prototype.

>> See http://www.w3.org/TR/WebIDL/#host-object-mixin-prototype
> Boris is right, that’s the difference, as it currently stands in Web IDL
> (forgetting for a moment that [Supplemental] isn’t defined).
> What I will do in the near future is implement the proposed changes to remove
> multiple inheritance from Web IDL and add the “mixin prototype” concept,
> which will allow you to specify the augment-an-existing-prototype
> behaviour that [Supplemental] would have given you.

OK, what I need to know is before Chaals and I proceed with taking the 
spec to PR, should I a) wait for you to make these changes and then make 
whatever relevant IDL changes to Selectors API, or b) just use 
[NoInterfaceObject] and "foo implements NodeSelector" and publish that?

Lachlan Hunt - Opera Software
Received on Saturday, 2 April 2011 09:46:42 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:18 UTC