diff --git a/components/script/document_loader.rs b/components/script/document_loader.rs index 14e107e9d02..7520bac32cb 100644 --- a/components/script/document_loader.rs +++ b/components/script/document_loader.rs @@ -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() } diff --git a/components/script/dom/htmlscriptelement.rs b/components/script/dom/htmlscriptelement.rs index 365d1a75e85..2011a31bf66 100644 --- a/components/script/dom/htmlscriptelement.rs +++ b/components/script/dom/htmlscriptelement.rs @@ -167,6 +167,8 @@ struct ScriptContext { metadata: RefCell>, /// 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) { - 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)); + let document = document_from_node(elem.r()).root(); + document.r().finish_load(LoadType::Script(self.url.clone())); + if self.resume_on_completion { - let document = document_from_node(elem.r()).root(); 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 { diff --git a/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/async_008.htm.ini b/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/async_008.htm.ini deleted file mode 100644 index b32fda7d128..00000000000 --- a/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/async_008.htm.ini +++ /dev/null @@ -1,5 +0,0 @@ -[async_008.htm] - type: testharness - [Async script element execution delays the window's load event] - expected: FAIL - diff --git a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/081.html.ini b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/081.html.ini deleted file mode 100644 index 298e96afb43..00000000000 --- a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/081.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[081.html] - type: testharness - [ scheduler: slow loading external script added with DOM (appendChild)] - expected: FAIL - diff --git a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/082.html.ini b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/082.html.ini deleted file mode 100644 index 8b8e5f9f8c4..00000000000 --- a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/082.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[082.html] - type: testharness - [ scheduler: multiple slow loading external scripts added with DOM (appendChild)] - expected: FAIL - diff --git a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/092.html.ini b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/092.html.ini deleted file mode 100644 index 53ace1e41ae..00000000000 --- a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/092.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[092.html] - type: testharness - [ scheduler: defer script and slow-loading non-async external script] - expected: FAIL - diff --git a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/095.html.ini b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/095.html.ini deleted file mode 100644 index ceab463aa64..00000000000 --- a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/095.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[095.html] - type: testharness - [ scheduler: slow-loading script added from defer blocking load event] - expected: FAIL diff --git a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/122.html.ini b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/122.html.ini index 941e581f20c..6432a9d5140 100644 --- a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/122.html.ini +++ b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/122.html.ini @@ -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 diff --git a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/125.html.ini b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/125.html.ini deleted file mode 100644 index e6269fe2954..00000000000 --- a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/125.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[125.html] - type: testharness - [scheduler: altering the type attribute and changing script data external script ] - expected: FAIL - diff --git a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/130.html.ini b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/130.html.ini deleted file mode 100644 index 07a5de2740e..00000000000 --- a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/130.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[130.html] - type: testharness - [scheduler: appending external script element to script ] - expected: FAIL - diff --git a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/134.html.ini b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/134.html.ini new file mode 100644 index 00000000000..a836fbc66c9 --- /dev/null +++ b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/134.html.ini @@ -0,0 +1,5 @@ +[134.html] + type: testharness + [scheduler: external HTML script added by SVG script] + expected: FAIL +