W3C home > Mailing lists > Public > public-script-coord@w3.org > January to March 2013

RE: Solving the "how do I tell whether I have an HTML element?" (or image element, or whatever) problem

From: Travis Leithead <travis.leithead@microsoft.com>
Date: Thu, 17 Jan 2013 21:27:06 +0000
To: Boris Zbarsky <bzbarsky@MIT.EDU>, "public-script-coord@w3.org" <public-script-coord@w3.org>, es-discuss <es-discuss@mozilla.org>
Message-ID: <9768D477C67135458BF978A45BCF9B3853B7D853@TK5EX14MBXW605.wingroup.windeploy.ntdev.microsoft.com>
> From: Boris Zbarsky [mailto:bzbarsky@MIT.EDU]
> On 12/31/12 11:33 PM, Boris Zbarsky wrote:
> > 1)  Hack instanceof as Gecko has in the past.  This is actually a bit
> > of a pain to implement even in Gecko, without changes to SpiderMonkey,
> > because function objects can't have the magic behavior the RHS needs
> > above in SpiderMonkey at the moment.
> 
> We have decided to go this route in Gecko, I believe, given that Allen
> says this will be describable in ES6.
> 
> In the short term that means that our WebIDL interface objects will
> probably not be function objects but reasonable facsimiles.  In the longer
> term we'll probably add a way to have functions have custom instanceof
> behavior to SpiderMonkey.
> 
> The next step is presumably getting WebIDL changed accordingly.  With that
> in mind, I would welcome one single representative of another browser or
> browser engine commenting here... ;)

This grabbed my attention :)

Is the idea to change the interface object such that instanceof can answer true for any instance of that type (from any Javascript engine instance)? For example:

x instanceof Element === true
(where x and Element are from different engine instances?
Received on Thursday, 17 January 2013 21:29:02 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:08 UTC