Bug 1856235 [wpt PR 42269] - LoAF: change the way script nesting is handled, a=testonly
commite8941b2dbf8a48b3eb4ab373e97a026b345d6e66
authorNoam Rosenthal <nrosenthal@chromium.org>
Wed, 18 Oct 2023 08:57:39 +0000 (18 08:57 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Thu, 26 Oct 2023 08:56:43 +0000 (26 08:56 +0000)
treecaed426c0607f0b3116cc51f8da1ccce01e93776
parent381bbf304e7fcd2a5e289b48b30e60f7fddf354b
Bug 1856235 [wpt PR 42269] - LoAF: change the way script nesting is handled, a=testonly

Automatic update from web-platform-tests
LoAF: change the way script nesting is handled

The logic to avoid nested scripts (only count for entry points)
was not handling the fact that script blocks can be nested in
callbacks and vice-versa.

The stack is a lot clearer now, with all script probes calling
PushScriptEntryPoint & PopScriptEntryPoint, the exception being
promise-resolver, which pops only when the task is complete.

The probe handling for script blocks is now changed, so that
ExecuteScript either creates a module entry or sets the execution time
on a script that has started.

Moved script internal timings (layout/style/alert/sync-XHR) to the end of the file (unmodified).

Added a few tests that reproduce the nesting issue, and removed the test
that relies on trusted-types as we don't require that dependency.

Also this fix changes a few existing test results:
- A script block executed synchronously from within a callback is
  attributed to the callback, as it's nested. The way to reproduce
  a top level classic script block is to have it parsed from the
  HTML.

- There is no more "execute-script" type, that's now a module.

Bug: 1485516
Change-Id: I405f1075191d8c16084b06866fba49a8d5f6e023
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4907347
Commit-Queue: Noam Rosenthal <nrosenthal@chromium.org>
Reviewed-by: Yoav Weiss <yoavweiss@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1207104}

--

wpt-commits: dea33c4db773deca29da6e7494c93bc8dd42826a
wpt-pr: 42269
testing/web-platform/tests/long-animation-frame/tentative/loaf-callback-after-promise.html [deleted file]
testing/web-platform/tests/long-animation-frame/tentative/loaf-script-block.html
testing/web-platform/tests/long-animation-frame/tentative/loaf-script-nested-callback.html [new file with mode: 0644]
testing/web-platform/tests/long-animation-frame/tentative/loaf-trusted-types.html [deleted file]
testing/web-platform/tests/long-animation-frame/tentative/resources/loaf-after-callback.js [new file with mode: 0644]
testing/web-platform/tests/long-animation-frame/tentative/resources/loaf-in-microtask-after-callback.js [new file with mode: 0644]