On 12/30/12 10:53 PM, Andreas Gal wrote:
"In terms of implementation complexity on our end, it's trivial as long as we don't
follow the WebIDL spec and make things like HTMLAnchorElement actual Function
instances."
You said you want to make it a function. I am just trying to say thats ok, as long it
says "object" for typeof.
Ah, sorry. That was ambiguous. The "as long as we don't" applied to
everything after it. Per WebIDL, interface objects are plain vanilla
functions. In Gecko's WebIDL bindings that's what they are, except in
cases when we need to make instanceof do the non-ECMAScript thing, in
which case we have to make them non-function objects because we need a
custom JSClass with a custom hasInstance hook.
We fake things a bit to make them look sort of like functions, but
they're not actually functions, and that's web-detectable (e.g.
Function.prototype.toString.call(Node) will throw). We could obviously
try to fix things up somehow to make them look completely like functions...
But that sidetracks from the main questions which are:
1) How do we want this to work going forward for chrome touching content?
2) How do we want this to work going forward for web pages touching
other web pages?
3) Can we make #1 and #2 look identical?
3) If #2 doesn't match what WebIDL/ES5 does right now, can we get the
relevant specs and other UAs to align with what we want?
Answers to #1 and especially #2 are what I'm primarily after so far...
-Boris
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform