aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlscriptelement.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2014-10-13 08:20:06 -0400
committerJosh Matthews <josh@joshmatthews.net>2015-05-11 13:41:51 -0400
commit7f0706ed42b33ec1da6bf9741811ca97d566ed45 (patch)
tree9d74b8a50145afb05bd10d6860227f4af17a5754 /components/script/dom/htmlscriptelement.rs
parent29a43a00b39e544596e3bcce9bdfca2159313ba5 (diff)
downloadservo-7f0706ed42b33ec1da6bf9741811ca97d566ed45.tar.gz
servo-7f0706ed42b33ec1da6bf9741811ca97d566ed45.zip
Implement a DocumentLoader type that tracks pending loads and notifies the script task when the queue is empty. Dispatch the document load event based on the DocumentLoader's notification.
Diffstat (limited to 'components/script/dom/htmlscriptelement.rs')
-rw-r--r--components/script/dom/htmlscriptelement.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/components/script/dom/htmlscriptelement.rs b/components/script/dom/htmlscriptelement.rs
index aaf36f95cb4..2f7a52ec272 100644
--- a/components/script/dom/htmlscriptelement.rs
+++ b/components/script/dom/htmlscriptelement.rs
@@ -4,6 +4,7 @@
use std::ascii::AsciiExt;
+use document_loader::LoadType;
use dom::attr::Attr;
use dom::attr::AttrHelpers;
use dom::bindings::cell::DOMRefCell;
@@ -34,7 +35,7 @@ use script_task::{ScriptMsg, Runnable};
use encoding::all::UTF_8;
use encoding::label::encoding_from_whatwg_label;
use encoding::types::{Encoding, EncodingRef, DecoderTrap};
-use net_traits::{load_whole_resource, Metadata};
+use net_traits::Metadata;
use util::str::{DOMString, HTML_SPACE_CHARACTERS, StaticStringVec};
use std::borrow::ToOwned;
use std::cell::Cell;
@@ -261,7 +262,9 @@ impl<'a> HTMLScriptElementHelpers for JSRef<'a, HTMLScriptElement> {
// state of the element's `crossorigin` content attribute, the origin being
// the origin of the script element's node document, and the default origin
// behaviour set to taint.
- ScriptOrigin::External(load_whole_resource(&window.resource_task(), url))
+ let doc = document_from_node(self).root();
+ let contents = doc.r().load_sync(LoadType::Script(url));
+ ScriptOrigin::External(contents)
}
}
},