Update test expectations. Mark script loads as complete when the response is complete.

This commit is contained in:
Josh Matthews 2015-05-21 09:53:19 -04:00
parent 8082df7d0d
commit ef8a127156
11 changed files with 14 additions and 39 deletions

View file

@ -100,6 +100,7 @@ impl DocumentLoader {
}
pub fn is_blocked(&self) -> bool {
//TODO: Ensure that we report blocked if parsing is still ongoing.
!self.blocking_loads.is_empty()
}

View file

@ -167,6 +167,8 @@ struct ScriptContext {
metadata: RefCell<Option<Metadata>>,
/// Whether the owning document's parser should resume once the response completes.
resume_on_completion: bool,
/// The initial URL requested.
url: Url,
}
impl AsyncResponseListener for ScriptContext {
@ -175,7 +177,8 @@ impl AsyncResponseListener for ScriptContext {
}
fn data_available(&self, payload: Vec<u8>) {
self.data.borrow_mut().extend(payload.into_iter());
let mut payload = payload;
self.data.borrow_mut().append(&mut payload);
}
fn response_complete(&self, status: Result<(), String>) {
@ -188,8 +191,10 @@ impl AsyncResponseListener for ScriptContext {
elem.r().execute(ScriptOrigin::External(load));
if self.resume_on_completion {
let document = document_from_node(elem.r()).root();
document.r().finish_load(LoadType::Script(self.url.clone()));
if self.resume_on_completion {
document.r().get_current_parser().unwrap().root().r().resume();
}
}
@ -316,6 +321,7 @@ impl<'a> HTMLScriptElementHelpers for JSRef<'a, HTMLScriptElement> {
data: RefCell::new(vec!()),
metadata: RefCell::new(None),
resume_on_completion: self.parser_inserted.get(),
url: url.clone(),
}));
let listener = box NetworkListener {

View file

@ -1,5 +0,0 @@
[async_008.htm]
type: testharness
[Async script element execution delays the window's load event]
expected: FAIL

View file

@ -1,5 +0,0 @@
[081.html]
type: testharness
[ scheduler: slow loading external script added with DOM (appendChild)]
expected: FAIL

View file

@ -1,5 +0,0 @@
[082.html]
type: testharness
[ scheduler: multiple slow loading external scripts added with DOM (appendChild)]
expected: FAIL

View file

@ -1,5 +0,0 @@
[092.html]
type: testharness
[ scheduler: defer script and slow-loading non-async external script]
expected: FAIL

View file

@ -1,4 +0,0 @@
[095.html]
type: testharness
[ scheduler: slow-loading script added from defer blocking load event]
expected: FAIL

View file

@ -1,8 +1,5 @@
[122.html]
type: testharness
[scheduler: altering the type attribute and adding/removing external script ]
expected: FAIL
[Reinserted script async IDL attribute]
expected: FAIL

View file

@ -1,5 +0,0 @@
[125.html]
type: testharness
[scheduler: altering the type attribute and changing script data external script ]
expected: FAIL

View file

@ -1,5 +0,0 @@
[130.html]
type: testharness
[scheduler: appending external script element to script ]
expected: FAIL

View file

@ -0,0 +1,5 @@
[134.html]
type: testharness
[scheduler: external HTML script added by SVG script]
expected: FAIL