Dispatch load events for cross origin iframes. Resolves #6672.

This commit is contained in:
Josh Matthews 2015-11-17 01:01:40 -05:00
parent 2a125b5613
commit c23cbd4163
23 changed files with 470 additions and 66 deletions

View file

@ -758,6 +758,20 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
})).unwrap();
}
fn handle_subframe_loaded(&mut self, pipeline_id: PipelineId) {
let subframe_pipeline = self.pipeline(pipeline_id);
let subframe_parent = match subframe_pipeline.parent_info {
Some(ref parent) => parent,
None => return,
};
let parent_pipeline = self.pipeline(subframe_parent.0);
let msg = ConstellationControlMsg::DispatchFrameLoadEvent {
target: pipeline_id,
parent: subframe_parent.0
};
parent_pipeline.script_chan.send(msg).unwrap();
}
// The script task associated with pipeline_id has loaded a URL in an iframe via script. This
// will result in a new pipeline being spawned and a frame tree being added to
// containing_page_pipeline_id's frame tree's children. This message is never the result of a
@ -908,6 +922,8 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
if webdriver_reset {
self.webdriver.load_channel = None;
}
self.handle_subframe_loaded(pipeline_id);
}
fn handle_navigate_msg(&mut self,