aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom')
-rw-r--r--components/script/dom/document.rs14
-rw-r--r--components/script/dom/htmliframeelement.rs5
2 files changed, 13 insertions, 6 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs
index 2728bc757fb..91824f0e354 100644
--- a/components/script/dom/document.rs
+++ b/components/script/dom/document.rs
@@ -96,8 +96,8 @@ use ipc_channel::ipc::{self, IpcSender};
use js::jsapi::{JSContext, JSObject, JSRuntime};
use js::jsapi::JS_GetRuntime;
use msg::constellation_msg::{ALT, CONTROL, SHIFT, SUPER};
+use msg::constellation_msg::{FrameId, ReferrerPolicy};
use msg::constellation_msg::{Key, KeyModifiers, KeyState};
-use msg::constellation_msg::{PipelineId, ReferrerPolicy};
use net_traits::{FetchResponseMsg, IpcSend};
use net_traits::CookieSource::NonHTTP;
use net_traits::CoreResourceMsg::{GetCookiesForUrl, SetCookiesForUrl};
@@ -1400,7 +1400,7 @@ impl Document {
if let Some((parent_pipeline_id, _)) = self.window.parent_info() {
let global_scope = self.window.upcast::<GlobalScope>();
let event = ConstellationMsg::MozBrowserEvent(parent_pipeline_id,
- Some(global_scope.pipeline_id()),
+ global_scope.pipeline_id(),
event);
global_scope.constellation_chan().send(event).unwrap();
}
@@ -1513,8 +1513,10 @@ impl Document {
}
}
- let loader = self.loader.borrow();
- if !loader.is_blocked() && !loader.events_inhibited() {
+ if !self.loader.borrow().is_blocked() && !self.loader.borrow().events_inhibited() {
+ // Schedule a task to fire a "load" event (if no blocking loads have arrived in the mean time)
+ // NOTE: we can end up executing this code more than once, in case more blocking loads arrive.
+ debug!("Document loads are complete.");
let win = self.window();
let msg = MainThreadScriptMsg::DocumentLoadsComplete(
win.upcast::<GlobalScope>().pipeline_id());
@@ -1630,11 +1632,11 @@ impl Document {
}
/// Find an iframe element in the document.
- pub fn find_iframe(&self, pipeline: PipelineId) -> Option<Root<HTMLIFrameElement>> {
+ pub fn find_iframe(&self, frame_id: FrameId) -> Option<Root<HTMLIFrameElement>> {
self.upcast::<Node>()
.traverse_preorder()
.filter_map(Root::downcast::<HTMLIFrameElement>)
- .find(|node| node.pipeline_id() == Some(pipeline))
+ .find(|node| node.frame_id() == frame_id)
}
pub fn get_dom_loading(&self) -> u64 {
diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs
index fef2cd70d85..e9ccf61cc7a 100644
--- a/components/script/dom/htmliframeelement.rs
+++ b/components/script/dom/htmliframeelement.rs
@@ -207,6 +207,11 @@ impl HTMLIFrameElement {
self.pipeline_id.get()
}
+ #[inline]
+ pub fn frame_id(&self) -> FrameId {
+ self.frame_id
+ }
+
pub fn change_visibility_status(&self, visibility: bool) {
if self.visibility.get() != visibility {
self.visibility.set(visibility);