aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/script_task.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2014-10-17 11:11:46 -0400
committerJosh Matthews <josh@joshmatthews.net>2015-05-11 13:41:52 -0400
commit32a89c945593917f0d7d3c75231b920cf218f2b3 (patch)
treee0c0ab95f1ccfd0f5fe2d384c7645d5629a1f6ba /components/script/script_task.rs
parent7f0706ed42b33ec1da6bf9741811ca97d566ed45 (diff)
downloadservo-32a89c945593917f0d7d3c75231b920cf218f2b3.tar.gz
servo-32a89c945593917f0d7d3c75231b920cf218f2b3.zip
Make stylesheets block page load.
Diffstat (limited to 'components/script/script_task.rs')
-rw-r--r--components/script/script_task.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/components/script/script_task.rs b/components/script/script_task.rs
index 93b3c794234..3f6ce8c94fb 100644
--- a/components/script/script_task.rs
+++ b/components/script/script_task.rs
@@ -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,