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

Re: Global variables and id lookup for elements

From: Cameron McCormack <cam@mcc.id.au>
Date: Fri, 29 Apr 2011 11:05:45 +1200
To: Boris Zbarsky <bzbarsky@MIT.EDU>
Cc: public-webapps@w3.org
Message-ID: <20110428230545.GF29132@wok.mcc.id.au>
Boris Zbarsky:
> For what it's worth, the way Gecko implements this is by inserting
> an object into the prototype chain of the Window that handles these
> property gets.  This means that |var| (which defines a prop on the
> Window itself) will always shadow the named props, which is the
> behavior you observe.

If we solve the problem in this way, with an extra object in the
prototype chain, then this could be defined in HTML without any special
prose.

  [NoInterfaceObject]
  interface WindowNames {
    getter any (in DOMString name);
  };

  interface Window : WindowNames {
    ...
  };

-- 
Cameron McCormack ≝ http://mcc.id.au/
Received on Thursday, 28 April 2011 23:06:20 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:45 GMT