diff --git a/html/semantics/scripting-1/the-script-element/module/dynamic-import/scripts/setTimeout-eval.js b/html/semantics/scripting-1/the-script-element/module/dynamic-import/scripts/setTimeout-eval.js new file mode 100644 index 00000000000000..5c1e22223508ba --- /dev/null +++ b/html/semantics/scripting-1/the-script-element/module/dynamic-import/scripts/setTimeout-eval.js @@ -0,0 +1,2 @@ +// import()s in eval are resolved relative to the script, even when indirected through Web IDL callbacks +setTimeout(eval, 0, `import('../../imports-a.js?label=' + window.label).then(window.continueTest, window.errorTest)`); diff --git a/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-base-url-external-classic.html b/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-base-url-external-classic.html index 7cf2dac0ac6e9c..8813afec46e6f0 100644 --- a/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-base-url-external-classic.html +++ b/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-base-url-external-classic.html @@ -31,6 +31,7 @@ const evaluators = [ "setTimeout", "eval", + "setTimeout-eval", "Function", "reflected-inline-event-handlers", "inline-event-handlers-UA-code" diff --git a/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-base-url-external-module.html b/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-base-url-external-module.html index 73986c2c9970ca..b234fbc0748c97 100644 --- a/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-base-url-external-module.html +++ b/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-base-url-external-module.html @@ -32,6 +32,7 @@ const evaluators = [ "setTimeout", "eval", + "setTimeout-eval", "Function", "reflected-inline-event-handlers", "inline-event-handlers-UA-code" diff --git a/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-base-url-inline-classic.html b/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-base-url-inline-classic.html index 1bd6d7dfd7560b..8def0dbb9c9b83 100644 --- a/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-base-url-inline-classic.html +++ b/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-base-url-inline-classic.html @@ -23,6 +23,9 @@ const evaluators = { setTimeout, eval, + "setTimeout + eval"(x) { + setTimeout(eval, 0, x); + }, "the Function constructor"(x) { Function(x)(); }, diff --git a/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-base-url-inline-module.html b/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-base-url-inline-module.html index f5b85740f5550c..0c5e8c24f54d50 100644 --- a/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-base-url-inline-module.html +++ b/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-base-url-inline-module.html @@ -23,6 +23,9 @@ const evaluators = { setTimeout, eval, + "setTimeout + eval"(x) { + setTimeout(eval, 0, x); + }, "the Function constructor"(x) { Function(x)(); }, diff --git a/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-classic.html b/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-classic.html index 34ea00abc83ce6..f4a32d65d16f48 100644 --- a/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-classic.html +++ b/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-classic.html @@ -24,6 +24,9 @@ "the Function constructor"(x) { Function(x)(); }, + "setTimeout + eval"(x) { + setTimeout(eval, 0, x); + }, "reflected inline event handlers"(x) { dummyDiv.setAttribute("onclick", x); dummyDiv.onclick(); diff --git a/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-module.html b/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-module.html index b85d446d8dae01..0cdd09cf79d782 100644 --- a/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-module.html +++ b/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-module.html @@ -21,6 +21,9 @@ const evaluators = { eval, setTimeout, + "setTimeout + eval"(x) { + setTimeout(eval, 0, x); + }, "the Function constructor"(x) { Function(x)(); }, diff --git a/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-nonce-classic.html b/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-nonce-classic.html index b582eba8b03353..2cdb702e4f4191 100644 --- a/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-nonce-classic.html +++ b/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-nonce-classic.html @@ -59,6 +59,14 @@ return promise.then(assertSuccessful); }, "indirect eval must inherit the nonce from the triggering script, thus execute"); +promise_test(t => { + const promise = createTestPromise(t); + + setTimeout(eval, 0, `import('../imports-a.js?label=direct eval').then(window.continueTest, window.errorTest)`); + + return promise.then(assertSuccessful); +}, "setTimeout + eval must inherit the nonce from the triggering script, thus execute"); + promise_test(t => { const promise = createTestPromise(t); diff --git a/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-nonce-module.html b/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-nonce-module.html index 4fa1cc58771119..357ba4035ede6a 100644 --- a/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-nonce-module.html +++ b/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-nonce-module.html @@ -58,6 +58,14 @@ return promise.then(assertSuccessful); }, "indirect eval must inherit the nonce from the triggering script, thus execute"); +promise_test(t => { + const promise = createTestPromise(t); + + setTimeout(eval, 0, `import('../imports-a.js?label=direct eval').then(window.continueTest, window.errorTest)`); + + return promise.then(assertSuccessful); +}, "setTimeout + eval must inherit the nonce from the triggering script, thus execute"); + promise_test(t => { const promise = createTestPromise(t); diff --git a/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-of-promise-result.html b/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-of-promise-result.html index e0e3ec8a94df8b..4d02e41f500ba2 100644 --- a/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-of-promise-result.html +++ b/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-of-promise-result.html @@ -1,6 +1,6 @@ -