servo: Merge #8558 - Dispatch load events for cross origin iframes. Resolves #6672 (from jdm:crossoriginiframeload); r=glennw

Splitting it out from #6677.

Source-Repo: https://github.com/servo/servo
Source-Revision: 51c19fd733a863f2fae05e693795dbecce69f2ed
This commit is contained in:
Josh Matthews
2015-12-01 03:39:11 +05:00
parent 9de70e2b00
commit 6689e4a372
6 changed files with 71 additions and 15 deletions

View File

@@ -1006,6 +1006,9 @@ impl ScriptTask {
self.handle_tick_all_animations(pipeline_id),
ConstellationControlMsg::WebFontLoaded(pipeline_id) =>
self.handle_web_font_loaded(pipeline_id),
ConstellationControlMsg::DispatchFrameLoadEvent {
target: pipeline_id, parent: containing_id } =>
self.handle_frame_load_event(containing_id, pipeline_id),
ConstellationControlMsg::GetCurrentState(sender, pipeline_id) => {
let state = self.handle_get_current_state(pipeline_id);
sender.send(state).unwrap();
@@ -1535,6 +1538,15 @@ impl ScriptTask {
}
}
/// Notify the containing document of a child frame that has completed loading.
fn handle_frame_load_event(&self, containing_pipeline: PipelineId, id: PipelineId) {
let page = get_page(&self.root_page(), containing_pipeline);
let document = page.document();
if let Some(iframe) = document.find_iframe_by_pipeline(id) {
iframe.iframe_load_event_steps();
}
}
/// The entry point to document loading. Defines bindings, sets up the window and document
/// objects, parses HTML and CSS, and kicks off initial layout.
fn load(&self, metadata: Metadata, incomplete: InProgressLoad) -> Root<ServoHTMLParser> {