aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmliframeelement.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/htmliframeelement.rs')
-rw-r--r--components/script/dom/htmliframeelement.rs16
1 files changed, 9 insertions, 7 deletions
diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs
index 1503ff28e06..75d828e73c9 100644
--- a/components/script/dom/htmliframeelement.rs
+++ b/components/script/dom/htmliframeelement.rs
@@ -18,7 +18,6 @@ use dom::bindings::codegen::Bindings::HTMLIFrameElementBinding::HTMLIFrameElemen
use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
use dom::bindings::conversions::ToJSValConvertible;
use dom::bindings::error::{Error, ErrorResult, Fallible};
-use dom::bindings::global::GlobalRef;
use dom::bindings::inheritance::Castable;
use dom::bindings::js::{JS, LayoutJS, MutNullableHeap, Root};
use dom::bindings::reflector::Reflectable;
@@ -30,6 +29,7 @@ use dom::domtokenlist::DOMTokenList;
use dom::element::{AttributeMutation, Element, RawLayoutElementHelpers};
use dom::event::Event;
use dom::eventtarget::EventTarget;
+use dom::globalscope::GlobalScope;
use dom::htmlelement::HTMLElement;
use dom::node::{Node, NodeDamage, UnbindContext, document_from_node, window_from_node};
use dom::urlhelper::UrlHelper;
@@ -126,9 +126,10 @@ impl HTMLIFrameElement {
let private_iframe = self.privatebrowsing();
let frame_type = if self.Mozbrowser() { FrameType::MozBrowserIFrame } else { FrameType::IFrame };
+ let global_scope = window.upcast::<GlobalScope>();
let load_info = IFrameLoadInfo {
load_data: load_data,
- parent_pipeline_id: window.pipeline_id(),
+ parent_pipeline_id: global_scope.pipeline_id(),
old_pipeline_id: old_pipeline_id,
new_pipeline_id: new_pipeline_id,
sandbox: sandboxed,
@@ -136,7 +137,8 @@ impl HTMLIFrameElement {
frame_type: frame_type,
replace: replace,
};
- window.constellation_chan()
+ global_scope
+ .constellation_chan()
.send(ConstellationMsg::ScriptLoadedURLInIFrame(load_info))
.unwrap();
@@ -217,7 +219,7 @@ impl HTMLIFrameElement {
let window = window_from_node(self);
let window = window.r();
let msg = ConstellationMsg::SetVisible(pipeline_id, visible);
- window.constellation_chan().send(msg).unwrap();
+ window.upcast::<GlobalScope>().constellation_chan().send(msg).unwrap();
}
}
@@ -316,7 +318,7 @@ pub fn build_mozbrowser_custom_event(window: &Window, event: MozBrowserEvent) ->
rooted!(in(cx) let mut detail = UndefinedValue());
let event_name = Atom::from(event.name());
unsafe { build_mozbrowser_event_detail(event, cx, detail.handle_mut()); }
- CustomEvent::new(GlobalRef::Window(window),
+ CustomEvent::new(window.upcast(),
event_name,
true,
true,
@@ -408,7 +410,7 @@ pub fn Navigate(iframe: &HTMLIFrameElement, direction: TraversalDirection) -> Er
if iframe.upcast::<Node>().is_in_doc() {
let window = window_from_node(iframe);
let msg = ConstellationMsg::TraverseHistory(iframe.pipeline_id(), direction);
- window.constellation_chan().send(msg).unwrap();
+ window.upcast::<GlobalScope>().constellation_chan().send(msg).unwrap();
}
Ok(())
@@ -642,7 +644,7 @@ impl VirtualMethods for HTMLIFrameElement {
(Some(sender), Some(receiver))
};
let msg = ConstellationMsg::RemoveIFrame(pipeline_id, sender);
- window.constellation_chan().send(msg).unwrap();
+ window.upcast::<GlobalScope>().constellation_chan().send(msg).unwrap();
if let Some(receiver) = receiver {
receiver.recv().unwrap()
}