Solving the "how do I tell whether I have an HTML element?" (or image element, or whatever) problem
bzbarsky at MIT.EDU
Thu Jan 17 13:33:09 PST 2013
On 1/17/13 4:27 PM, Travis Leithead wrote:
> This grabbed my attention :)
Oh, good. This is only my third try at getting a response... ;)
> x instanceof Element === true
> (where x and Element are from different engine instances?
I'm not sure what you mean by "engine instance".
The proposal is that the expression "x instanceof Foo" where "Foo" is a
WebIDL interface object for a non-callback interface as defined at
http://dev.w3.org/2006/webapi/WebIDL/#interface-object will return true
if and only "x" is a platform object implementing the relevant interface.
So "x instanceof Element" would be true if x is an Element, no matter
what its owner document is.
More information about the es-discuss