On 12/27/12 11:20 PM, Boris Zbarsky wrote:
On 12/27/12 2:49 PM, Justin Dolske wrote:
Hmm. My first reaction is to gently challenge if this really has to
change

Well, it really has to change as exposed to web content (or we have to
convince every single other browser to change behavior and get the
ECMAScript spec changed and so forth).

Meaning we're the exception here? How does this impact web content?

After all, if it's changing a frequently used chrome/addon pattern,
that's a pretty big incompatibility step. And I'd sort of expect an
HTMLAnchorElement to always be an HTMLAnchorElement, without the
creator's context mattering... [1]

Unfortunately, that's not how instanceof works in JS.  Try it with
Object instead of HTMLAnchorElement...
[...]
If HTMLAnchorElement is switched to follow the spec, it will set
isAnchor to false, because the implicit adoptNode during the appendChild
changes the prototype chain in Gecko.

Hmm. This is what makes my head hurt a bit. The common case would, apparently, be wanting to know if someElement is a HTMLFoo or not. Which seems like it shouldn't matter if it's a Foo in content or a Foo in chrome.

But if Object is already inconsistent here (and unfixable?), maybe it's just one of those weird "wat" cases of JS that we have to live with? Seems quite unfortunate, though.

Justin
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to