Fix null realm assertion when activating a service worker (#36256)

Ensure there is an active realm when dispatching the `activation` DOM
event to the ServiceWorker global.

Testing: Existing WPT coverage.
Fixes: #36114
Fixes: #36235
Fixes: #36231

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
Josh Matthews 2025-04-01 04:13:02 -04:00 committed by GitHub
parent be38c5478f
commit fcef1dff9d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
50 changed files with 579 additions and 116 deletions

View file

@ -1,2 +1,4 @@
[error-message-event.https.html]
expected: CRASH
expected: TIMEOUT
[Verify error event is received]
expected: TIMEOUT

View file

@ -1,2 +1,4 @@
[message-event-ports.https.html]
expected: CRASH
expected: TIMEOUT
[Verify MessageEvent.ports getter returns the same object]
expected: TIMEOUT

View file

@ -1,2 +1,4 @@
[claim-affect-other-registration.https.html]
expected: CRASH
expected: TIMEOUT
[claim() should affect the originally controlling registration.]
expected: TIMEOUT

View file

@ -1,2 +1,7 @@
[claim-not-using-registration.https.html]
expected: CRASH
expected: TIMEOUT
[Test claim client which is not using registration]
expected: FAIL
[Test claim client when there's a longer-matched registration not already used by the page]
expected: TIMEOUT

View file

@ -1,2 +1,2 @@
[claim-with-redirect.https.html]
expected: CRASH
expected: ERROR

View file

@ -1,2 +1,10 @@
[controlled-dedicatedworker-postMessage.https.html]
expected: CRASH
expected: TIMEOUT
[Register service worker]
expected: TIMEOUT
[Verify dedicated worker gets messages if setting event listener early]
expected: NOTRUN
[Verify dedicated worker does not get all messages if not setting event listener early]
expected: NOTRUN

View file

@ -1,2 +1,13 @@
[controlled-iframe-postMessage.https.html]
expected: CRASH
expected: TIMEOUT
[Register service worker]
expected: TIMEOUT
[Verify frame gets early messages if setting synchronously message event listener]
expected: NOTRUN
[Verify frame does not get all messages if not setting event listener early]
expected: NOTRUN
[Verify frame does get messages in order]
expected: NOTRUN

View file

@ -1,2 +1,7 @@
[fetch-event-within-sw.https.html]
expected: CRASH
expected: TIMEOUT
[Service worker intercepts requests from window]
expected: TIMEOUT
[Service worker does not intercept fetch/cache requests within service worker]
expected: NOTRUN

View file

@ -1,2 +1,4 @@
[immutable-prototype-serviceworker.https.html]
expected: CRASH
expected: TIMEOUT
[worker prototype chain should be immutable]
expected: TIMEOUT

View file

@ -1,2 +1,10 @@
[url-parsing.https.html]
expected: CRASH
expected: TIMEOUT
[register should use the relevant global of the object it was called on to resolve the script URL and the default scope URL]
expected: TIMEOUT
[register should use the relevant global of the object it was called on to resolve the script URL and the given scope URL]
expected: NOTRUN
[getRegistration should use the relevant global of the object it was called on to resolve the script URL]
expected: NOTRUN

View file

@ -1,2 +1,49 @@
[navigation-sets-cookie.https.html]
expected: CRASH
expected: TIMEOUT
[Setup service workers]
expected: TIMEOUT
[Same-site top-level navigation with fallback service worker should be able to set SameSite=* cookies.]
expected: NOTRUN
[Cross-site top-level navigation with fallback service worker should be able to set SameSite=* cookies.]
expected: NOTRUN
[Same-site top-level POST with fallback service worker should be able to set SameSite=* cookies.]
expected: NOTRUN
[Cross-site top-level with fallback service worker POST should be able to set SameSite=* cookies.]
expected: NOTRUN
[Same-site top-level navigation with passthrough service worker should be able to set SameSite=* cookies.]
expected: NOTRUN
[Cross-site top-level navigation with passthrough service worker should be able to set SameSite=* cookies.]
expected: NOTRUN
[Same-site top-level POST with passthrough service worker should be able to set SameSite=* cookies.]
expected: NOTRUN
[Cross-site top-level with passthrough service worker POST should be able to set SameSite=* cookies.]
expected: NOTRUN
[Same-site top-level navigation with navpreload service worker should be able to set SameSite=* cookies.]
expected: NOTRUN
[Cross-site top-level navigation with navpreload service worker should be able to set SameSite=* cookies.]
expected: NOTRUN
[Same-site top-level navigation with change-request service worker should be able to set SameSite=* cookies.]
expected: NOTRUN
[Cross-site top-level navigation with change-request service worker should be able to set SameSite=* cookies.]
expected: NOTRUN
[Same-site top-level POST with change-request service worker should be able to set SameSite=* cookies.]
expected: NOTRUN
[Cross-site top-level with change-request service worker POST should be able to set SameSite=* cookies.]
expected: NOTRUN
[Cleanup service workers]
expected: NOTRUN

View file

@ -1,4 +1,4 @@
[register-wait-forever-in-install-worker.https.html]
expected: CRASH
expected: ERROR
[register worker that calls waitUntil with a promise that never resolves in oninstall]
expected: FAIL

View file

@ -1,2 +1,108 @@
[registration-mime-types.https.html]
expected: CRASH
[Registering script with no MIME type]
expected: FAIL
[Registering script with bad MIME type]
expected: FAIL
[Registering script that imports script with no MIME type]
expected: FAIL
[Registering script that imports script with bad MIME type]
expected: FAIL
[Registering script with good MIME type application/ecmascript]
expected: FAIL
[Registering script that imports script with good MIME type application/ecmascript]
expected: FAIL
[Registering script with good MIME type application/javascript]
expected: FAIL
[Registering script that imports script with good MIME type application/javascript]
expected: FAIL
[Registering script with good MIME type application/x-ecmascript]
expected: FAIL
[Registering script that imports script with good MIME type application/x-ecmascript]
expected: FAIL
[Registering script with good MIME type application/x-javascript]
expected: FAIL
[Registering script that imports script with good MIME type application/x-javascript]
expected: FAIL
[Registering script with good MIME type text/ecmascript]
expected: FAIL
[Registering script that imports script with good MIME type text/ecmascript]
expected: FAIL
[Registering script with good MIME type text/javascript]
expected: FAIL
[Registering script that imports script with good MIME type text/javascript]
expected: FAIL
[Registering script with good MIME type text/javascript1.0]
expected: FAIL
[Registering script that imports script with good MIME type text/javascript1.0]
expected: FAIL
[Registering script with good MIME type text/javascript1.1]
expected: FAIL
[Registering script that imports script with good MIME type text/javascript1.1]
expected: FAIL
[Registering script with good MIME type text/javascript1.2]
expected: FAIL
[Registering script that imports script with good MIME type text/javascript1.2]
expected: FAIL
[Registering script with good MIME type text/javascript1.3]
expected: FAIL
[Registering script that imports script with good MIME type text/javascript1.3]
expected: FAIL
[Registering script with good MIME type text/javascript1.4]
expected: FAIL
[Registering script that imports script with good MIME type text/javascript1.4]
expected: FAIL
[Registering script with good MIME type text/javascript1.5]
expected: FAIL
[Registering script that imports script with good MIME type text/javascript1.5]
expected: FAIL
[Registering script with good MIME type text/jscript]
expected: FAIL
[Registering script that imports script with good MIME type text/jscript]
expected: FAIL
[Registering script with good MIME type text/livescript]
expected: FAIL
[Registering script that imports script with good MIME type text/livescript]
expected: FAIL
[Registering script with good MIME type text/x-ecmascript]
expected: FAIL
[Registering script that imports script with good MIME type text/x-ecmascript]
expected: FAIL
[Registering script with good MIME type text/x-javascript]
expected: FAIL
[Registering script that imports script with good MIME type text/x-javascript]
expected: FAIL

View file

@ -1,2 +1,15 @@
[registration-scope.https.html]
expected: CRASH
[Scope including URL-encoded multibyte characters]
expected: FAIL
[Scope including non-escaped multibyte characters]
expected: FAIL
[Scope including self-reference]
expected: FAIL
[Scope including parent-reference]
expected: FAIL
[Scope including consecutive slashes]
expected: FAIL

View file

@ -1,2 +1,30 @@
[registration-script-module.https.html]
expected: CRASH
[Registering invalid chunked encoding script]
expected: FAIL
[Registering invalid chunked encoding script with flush]
expected: FAIL
[Registering script including parse error]
expected: FAIL
[Registering script including undefined error]
expected: FAIL
[Registering script including uncaught exception]
expected: FAIL
[Registering script with top-level await]
expected: FAIL
[Registering script with module instantiation error]
expected: FAIL
[Registering script with module instantiation error and top-level await]
expected: FAIL
[Registering non-existent script]
expected: FAIL
[Registering script including caught exception]
expected: FAIL

View file

@ -1,2 +1,6 @@
[registration-script-url.https.html]
expected: CRASH
[Script URL including self-reference]
expected: FAIL
[Script URL including parent-reference]
expected: FAIL

View file

@ -1,2 +1,27 @@
[registration-script.https.html]
expected: CRASH
[Registering invalid chunked encoding script]
expected: FAIL
[Registering invalid chunked encoding script with flush]
expected: FAIL
[Registering script including parse error]
expected: FAIL
[Registering script including undefined error]
expected: FAIL
[Registering script including uncaught exception]
expected: FAIL
[Registering script importing malformed script]
expected: FAIL
[Registering non-existent script]
expected: FAIL
[Registering script importing non-existent script]
expected: FAIL
[Registering script including caught exception]
expected: FAIL

View file

@ -1,2 +1,25 @@
[registration-security-error.https.html]
expected: CRASH
expected: TIMEOUT
[Registering same scope as the script directory without the last slash]
expected: FAIL
[Registration scope outside the script directory]
expected: FAIL
[Registering scope outside domain]
expected: TIMEOUT
[Registering script outside domain]
expected: NOTRUN
[Registering redirected script]
expected: NOTRUN
[Scope including parent-reference and not under the script directory]
expected: NOTRUN
[Script URL including consecutive slashes]
expected: NOTRUN
[Script URL is same-origin filesystem: URL]
expected: NOTRUN

View file

@ -1,2 +1,199 @@
[same-site-cookies.https.html]
expected: CRASH
expected: TIMEOUT
[Setup service workers]
expected: TIMEOUT
[same-origin, window.open with no service worker]
expected: NOTRUN
[same-origin, window.open with fallback]
expected: NOTRUN
[same-origin, window.open with passthrough]
expected: NOTRUN
[same-origin, window.open with change-request]
expected: NOTRUN
[same-origin, window.open with navpreload]
expected: NOTRUN
[same-site, window.open with no service worker]
expected: NOTRUN
[same-site, window.open with fallback]
expected: NOTRUN
[same-site, window.open with passthrough]
expected: NOTRUN
[same-site, window.open with change-request]
expected: NOTRUN
[same-site, window.open with navpreload]
expected: NOTRUN
[cross-site, window.open with no service worker]
expected: NOTRUN
[cross-site, window.open with fallback]
expected: NOTRUN
[cross-site, window.open with passthrough]
expected: NOTRUN
[cross-site, window.open with change-request]
expected: NOTRUN
[cross-site, window.open with navpreload]
expected: NOTRUN
[same-origin, window.open with no service worker and same-site redirect]
expected: NOTRUN
[same-origin, window.open with fallback and same-site redirect]
expected: NOTRUN
[same-origin, window.open with passthrough and same-site redirect]
expected: NOTRUN
[same-origin, window.open with change-request and same-site redirect]
expected: NOTRUN
[same-origin, window.open with navpreload and same-site redirect]
expected: NOTRUN
[same-origin, window.open with no service worker and cross-site redirect]
expected: NOTRUN
[same-origin, window.open with fallback and cross-site redirect]
expected: NOTRUN
[same-origin, window.open with passthrough and cross-site redirect]
expected: NOTRUN
[same-origin, window.open with change-request and cross-site redirect]
expected: NOTRUN
[same-origin, window.open with navpreload and cross-site redirect]
expected: NOTRUN
[same-origin, window.open with no service worker, cross-site redirect, and same-origin redirect]
expected: NOTRUN
[same-origin, window.open with fallback, cross-site redirect, and same-origin redirect]
expected: NOTRUN
[same-origin, window.open with passthrough, cross-site redirect, and same-origin redirect]
expected: NOTRUN
[same-origin, window.open with change-request, cross-site redirect, and same-origin redirect]
expected: NOTRUN
[same-origin, window.open with navpreload, cross-site redirect, and same-origin redirect]
expected: NOTRUN
[same-origin, nested window.open with cross-site middle frame and no service worker]
expected: NOTRUN
[same-origin, nested window.open with cross-site middle frame and fallback service worker]
expected: NOTRUN
[same-origin, nested window.open with cross-site middle frame and passthrough service worker]
expected: NOTRUN
[same-origin, nested window.open with cross-site middle frame and change-request service worker]
expected: NOTRUN
[same-origin, nested window.open with cross-site middle frame and navpreload service worker]
expected: NOTRUN
[same-origin, nested set location with cross-site middle frame and no service worker]
expected: NOTRUN
[same-origin, nested set location with cross-site middle frame and fallback service worker]
expected: NOTRUN
[same-origin, nested set location with cross-site middle frame and passthrough service worker]
expected: NOTRUN
[same-origin, nested set location with cross-site middle frame and change-request service worker]
expected: NOTRUN
[same-origin, nested set location with cross-site middle frame and navpreload service worker]
expected: NOTRUN
[same-origin, form post with no service worker]
expected: NOTRUN
[same-origin, form post with fallback]
expected: NOTRUN
[same-origin, form post with passthrough]
expected: NOTRUN
[same-origin, form post with change-request]
expected: NOTRUN
[same-site, form post with no service worker]
expected: NOTRUN
[same-site, form post with fallback]
expected: NOTRUN
[same-site, form post with passthrough]
expected: NOTRUN
[same-site, form post with change-request]
expected: NOTRUN
[cross-site, form post with no service worker]
expected: NOTRUN
[cross-site, form post with fallback]
expected: NOTRUN
[cross-site, form post with passthrough]
expected: NOTRUN
[cross-site, form post with change-request]
expected: NOTRUN
[same-origin, form post with no service worker and same-site redirect]
expected: NOTRUN
[same-origin, form post with fallback and same-site redirect]
expected: NOTRUN
[same-origin, form post with passthrough and same-site redirect]
expected: NOTRUN
[same-origin, form post with change-request and same-site redirect]
expected: NOTRUN
[same-origin, form post with no service worker and cross-site redirect]
expected: NOTRUN
[same-origin, form post with fallback and cross-site redirect]
expected: NOTRUN
[same-origin, form post with passthrough and cross-site redirect]
expected: NOTRUN
[same-origin, form post with change-request and cross-site redirect]
expected: NOTRUN
[same-origin, form post with no service worker, cross-site redirect, and same-origin redirect]
expected: NOTRUN
[same-origin, form post with fallback, cross-site redirect, and same-origin redirect]
expected: NOTRUN
[same-origin, form post with passthrough, cross-site redirect, and same-origin redirect]
expected: NOTRUN
[same-origin, form post with change-request, cross-site redirect, and same-origin redirect]
expected: NOTRUN
[Cleanup service workers]
expected: NOTRUN

View file

@ -1,2 +1,2 @@
[svg-target-reftest.https.html]
expected: CRASH
expected: TIMEOUT

View file

@ -1,5 +1,4 @@
[unregister.https.html]
expected: CRASH
[Unregister twice]
expected: FAIL

View file

@ -1,2 +1,4 @@
[update-result.https.html]
expected: CRASH
expected: TIMEOUT
[ServiceWorkerRegistration.update() should resolve a registration object]
expected: TIMEOUT

View file

@ -1,2 +1,4 @@
[worker-client-id.https.html]
expected: CRASH
expected: TIMEOUT
[Verify workers have a unique client id separate from their owning documents window]
expected: TIMEOUT