On 10/14/15 1:48 PM, Bobby Holley wrote:
Isolated worlds and wrappers should provide the same observable
semantics
There are various cases where this is not true.
For example, with wrappers getting .onload on a node in the DOM return
an Xray for the content function the page set, while with isolated
worlds it returns null unless your world set .onload on that node (and
in general event targets keep a per-world list for every on* property).
Similarly, setting .onfoo with wrappers will clobber a page-set value
while with isolated worlds it just adds another "foo" event listener to
the same event target, unless your world has already set .onfoo on it.
There are similar issues for any property or method that returns or
takes an ES object, not an IDL object: typed arrays, functions,
promises, "any" values, etc. In isolated worlds each world gets its own
separate thing, while with wrappers the privileged code gets an Xray to
the same object the content sees.
I do wonder what that means for, say, CustomEvent listeners in Chrome
extensions. What do they see for the .detail of the event, if anything?
But Bill is right. If we're trying to expose isolated world semantics
to addons, we need to think some about how to actually do it. :(
Especially if we want to avoid the tons of manual work by API
implementors and lots of fragility and complication that it involves in
Chrome.
The only issue I've heard of people having is the TypedArray thing
This is bug 1198934, just to make sure we're on the same page?
don't think there's actually any wild behavioral divergence there. I'm
pretty sure we can fix most of the TypedArray issues that people are
seeing with bug 946906 - somebody just needs to do it.
This will work for cases when the TypedArray is [Cached] in the binding
layer and created each time in the C++ object, but not for cases where
it's stored in the actual C++ object, right? So if an extension gets
its hands on a content-side XHR object with responseType = "arraybuffer"
and does .response it will get an Xray, not a separate typed array,
whereas I assume in Chrome it would get the latter.
-Boris
_______________________________________________
dev-fxos mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-fxos