diff options
author | WPT Sync Bot <josh+wptsync@joshmatthews.net> | 2021-09-07 11:16:33 +0000 |
---|---|---|
committer | cybai <cyb.ai.815@gmail.com> | 2022-01-17 16:30:29 +0900 |
commit | 58e8ee674b032274959b4461fd46ceda8f709e96 (patch) | |
tree | 4953c044dba6b52224d5144747af1bc3773a7ebc /tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/execution-timing | |
parent | 35e95f55a1b9e488d1c796c8fb39d764d090d660 (diff) | |
download | servo-58e8ee674b032274959b4461fd46ceda8f709e96.tar.gz servo-58e8ee674b032274959b4461fd46ceda8f709e96.zip |
Update web-platform-tests to revision b'468d01bbd84da2babf265c6af46947be68713440'
Diffstat (limited to 'tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/execution-timing')
4 files changed, 50 insertions, 5 deletions
diff --git a/tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/execution-timing/050.html b/tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/execution-timing/050.html index 143fc917e09..a400749f18e 100644 --- a/tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/execution-timing/050.html +++ b/tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/execution-timing/050.html @@ -21,8 +21,28 @@ var t = async_test() function test() { - assert_array_equals(eventOrder, ['inline script #1', 'end script #1', 'include-5 before removing scripts', 'include-5 after removing scripts', 'external script #1', 'external script #2']), - t.done(); + // Per-spec, non-blocking/async scripts can execute at any time. + // Therefore, there are two possibilities for the script order here. + // 1. inline script first, followed by include-5 (async), then + // external script #1 (slow async) and finally external #2 + // (inline). + // 2. inline script, external '2, 'include 5', then include-1. + assert_array_equals(eventOrder.slice(0, 2), [ + 'inline script #1', 'end script #1' + ]); + if (eventOrder[2] == 'include-5 before removing scripts') { + assert_array_equals(eventOrder.slice(3), [ + 'include-5 after removing scripts', 'external script #1', + 'external script #2' + ]); + } else { + assert_array_equals(eventOrder.slice(2), ['external script #2', + 'include-5 before removing scripts', + 'include-5 after removing scripts', + 'external script #1' + ]); + } + t.done(); } onload = t.step_func(test) </script> diff --git a/tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/execution-timing/146-href.html b/tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/execution-timing/146-href.html new file mode 100644 index 00000000000..6c0869db541 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/execution-timing/146-href.html @@ -0,0 +1,22 @@ +<!DOCTYPE html> +<html><head> + <title>scheduler: SVG script adding src attribute </title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="testlib/testlib.js"></script> +</head> +<div id="log"></div> +<script>var t = async_test();</script> +<svg> +<script></script> +</svg> +<script> +t.step(function() { + var s = document.querySelector("svg > script"); + s.setAttribute("href", "scripts/include-1.js"); +}); +onload = t.step_func(function() { + assert_array_equals(eventOrder, ["external script #1"]); + t.done(); +}); +</script> diff --git a/tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/execution-timing/146.html b/tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/execution-timing/146.html index 9cf6bb7b7ba..333ac3fa0fd 100644 --- a/tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/execution-timing/146.html +++ b/tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/execution-timing/146.html @@ -16,7 +16,8 @@ t.step(function() { s.src = "scripts/include-1.js"; }); onload = t.step_func(function() { - assert_array_equals(eventOrder, ["external script #1"]); + // SVG <script> element uses href attribute, so src attribute is ignored. + assert_array_equals(eventOrder, []); t.done(); }); </script> diff --git a/tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/execution-timing/scripts/find-body.js b/tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/execution-timing/scripts/find-body.js index 22e1050ffc3..1ce198f13ed 100644 --- a/tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/execution-timing/scripts/find-body.js +++ b/tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/execution-timing/scripts/find-body.js @@ -1,2 +1,4 @@ -log('document.body: '+(document.body?'<BODY>':null)); -var findBodyLoaded=true;
\ No newline at end of file +log( + 'document.body: ' + + (document.body ? '<' + document.body.localName.toUpperCase() + '>' : null)); +var findBodyLoaded=true; |