Bug fixes, mainly about document loading.

This commit is contained in:
Alan Jeffrey 2016-10-24 15:15:37 -05:00
parent cda9099396
commit 21d8235a82
10 changed files with 87 additions and 81 deletions

View file

@ -1399,7 +1399,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();
}
@ -1512,8 +1512,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());

View file

@ -231,7 +231,11 @@ impl HTMLIFrameElement {
}
/// https://html.spec.whatwg.org/multipage/#iframe-load-event-steps steps 1-4
pub fn iframe_load_event_steps(&self) {
pub fn iframe_load_event_steps(&self, loaded_pipeline: PipelineId) {
// TODO(#9592): assert that the load blocker is present at all times when we
// can guarantee that it's created for the case of iframe.reload().
assert_eq!(loaded_pipeline, self.pipeline_id().unwrap());
// TODO A cross-origin child document would not be easily accessible
// from this script thread. It's unclear how to implement
// steps 2, 3, and 5 efficiently in this case.