mirror of
https://github.com/servo/servo.git
synced 2025-07-15 03:13:41 +01:00
Update test expectations. Mark script loads as complete when the response is complete.
This commit is contained in:
parent
8082df7d0d
commit
ef8a127156
11 changed files with 14 additions and 39 deletions
|
@ -100,6 +100,7 @@ impl DocumentLoader {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_blocked(&self) -> bool {
|
pub fn is_blocked(&self) -> bool {
|
||||||
|
//TODO: Ensure that we report blocked if parsing is still ongoing.
|
||||||
!self.blocking_loads.is_empty()
|
!self.blocking_loads.is_empty()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -167,6 +167,8 @@ struct ScriptContext {
|
||||||
metadata: RefCell<Option<Metadata>>,
|
metadata: RefCell<Option<Metadata>>,
|
||||||
/// Whether the owning document's parser should resume once the response completes.
|
/// Whether the owning document's parser should resume once the response completes.
|
||||||
resume_on_completion: bool,
|
resume_on_completion: bool,
|
||||||
|
/// The initial URL requested.
|
||||||
|
url: Url,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl AsyncResponseListener for ScriptContext {
|
impl AsyncResponseListener for ScriptContext {
|
||||||
|
@ -175,7 +177,8 @@ impl AsyncResponseListener for ScriptContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn data_available(&self, payload: Vec<u8>) {
|
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>) {
|
fn response_complete(&self, status: Result<(), String>) {
|
||||||
|
@ -188,8 +191,10 @@ impl AsyncResponseListener for ScriptContext {
|
||||||
|
|
||||||
elem.r().execute(ScriptOrigin::External(load));
|
elem.r().execute(ScriptOrigin::External(load));
|
||||||
|
|
||||||
|
let document = document_from_node(elem.r()).root();
|
||||||
|
document.r().finish_load(LoadType::Script(self.url.clone()));
|
||||||
|
|
||||||
if self.resume_on_completion {
|
if self.resume_on_completion {
|
||||||
let document = document_from_node(elem.r()).root();
|
|
||||||
document.r().get_current_parser().unwrap().root().r().resume();
|
document.r().get_current_parser().unwrap().root().r().resume();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -316,6 +321,7 @@ impl<'a> HTMLScriptElementHelpers for JSRef<'a, HTMLScriptElement> {
|
||||||
data: RefCell::new(vec!()),
|
data: RefCell::new(vec!()),
|
||||||
metadata: RefCell::new(None),
|
metadata: RefCell::new(None),
|
||||||
resume_on_completion: self.parser_inserted.get(),
|
resume_on_completion: self.parser_inserted.get(),
|
||||||
|
url: url.clone(),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
let listener = box NetworkListener {
|
let listener = box NetworkListener {
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[async_008.htm]
|
|
||||||
type: testharness
|
|
||||||
[Async script element execution delays the window's load event]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[081.html]
|
|
||||||
type: testharness
|
|
||||||
[ scheduler: slow loading external script added with DOM (appendChild)]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[082.html]
|
|
||||||
type: testharness
|
|
||||||
[ scheduler: multiple slow loading external scripts added with DOM (appendChild)]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[092.html]
|
|
||||||
type: testharness
|
|
||||||
[ scheduler: defer script and slow-loading non-async external script]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[095.html]
|
|
||||||
type: testharness
|
|
||||||
[ scheduler: slow-loading script added from defer blocking load event]
|
|
||||||
expected: FAIL
|
|
|
@ -1,8 +1,5 @@
|
||||||
[122.html]
|
[122.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
[scheduler: altering the type attribute and adding/removing external script ]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Reinserted script async IDL attribute]
|
[Reinserted script async IDL attribute]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[125.html]
|
|
||||||
type: testharness
|
|
||||||
[scheduler: altering the type attribute and changing script data external script ]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[130.html]
|
|
||||||
type: testharness
|
|
||||||
[scheduler: appending external script element to script ]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
[134.html]
|
||||||
|
type: testharness
|
||||||
|
[scheduler: external HTML script added by SVG script]
|
||||||
|
expected: FAIL
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue