Allow browsing contexts to resolve to cross-origin windows.

This commit is contained in:
Alan Jeffrey 2017-01-31 08:56:38 -06:00
parent 4a0b730caf
commit e8d765557f
11 changed files with 598 additions and 16 deletions

View file

@ -1514,7 +1514,10 @@ impl Window {
// Suspend timer events.
self.upcast::<GlobalScope>().suspend();
// TODO: set the window proxy to resolve to an object which throws security errors. #15233
// Set the window proxy to be a cross-origin window.
if self.browsing_context().currently_active() == Some(self.global().pipeline_id()) {
self.browsing_context().unset_currently_active();
}
// A hint to the JS runtime that now would be a good time to
// GC any unreachable objects generated by user script,
@ -1528,7 +1531,7 @@ impl Window {
self.upcast::<GlobalScope>().resume();
// Set the window proxy to be this object.
self.browsing_context().set_window_proxy(&self);
self.browsing_context().set_currently_active(self);
// Push the document title to the compositor since we are
// activating this document due to a navigation.