Make stylesheets block page load.

This commit is contained in:
Josh Matthews 2014-10-17 11:11:46 -04:00
parent 7f0706ed42
commit 32a89c9455
10 changed files with 106 additions and 30 deletions

View file

@ -19,7 +19,7 @@
#![allow(unsafe_code)]
use document_loader::{DocumentLoader, NotifierData};
use document_loader::{LoadType, DocumentLoader, NotifierData};
use dom::bindings::cell::DOMRefCell;
use dom::bindings::codegen::Bindings::DocumentBinding::{DocumentMethods, DocumentReadyState};
use dom::bindings::codegen::InheritTypes::{ElementCast, EventTargetCast, HTMLIFrameElementCast, NodeCast, EventCast};
@ -731,6 +731,8 @@ impl ScriptTask {
self.handle_webdriver_msg(pipeline_id, msg),
ConstellationControlMsg::TickAllAnimations(pipeline_id) =>
self.handle_tick_all_animations(pipeline_id),
ConstellationControlMsg::StylesheetLoadComplete(id, url) =>
self.handle_resource_loaded(id, LoadType::Stylesheet(url)),
}
}
@ -839,6 +841,12 @@ impl ScriptTask {
}
/// Handle a request to load a page in a new child frame of an existing page.
fn handle_resource_loaded(&self, pipeline: PipelineId, load: LoadType) {
let page = get_page(&self.root_page(), pipeline);
let doc = page.document().root();
doc.r().finish_load(load);
}
fn handle_new_layout(&self, new_layout_info: NewLayoutInfo) {
let NewLayoutInfo {
containing_pipeline_id,