[w3c/ServiceWorker] Teach ExtendableMessageEvent to work with origins. (PR #1821)

Currently, ExtendableMessageEvent's origin holds a serialized origin. In order for Origin.from(...) to function as intended for sources with opaque origins, we need to hold an origin on ExtendableMessageEvent instead.

This patch adds an "origin" concept to `ExtendableMessageEvent`, and shifts call sites to initialize that value with an origin whenever possible. It also adds "extract an origin" steps to return the stored origin when present, and to return null in cases where the object was initialized with an untrusted origin representation (e.g., when its constructor is called with a ExtendableMessageEventInit dictionary).

This replicates whatwg/html#11993's work on `MessageEvent`, and should fix w3c/ServiceWorker#1820.


<!--
    This comment and the below content is programmatically generated.
    You may add a comma-separated list of anchors you'd like a
    direct link to below (e.g. #idl-serializers, #idl-sequence):

    Don't remove this comment or modify anything below this line.
    If you don't want a preview generated for this pull request,
    just replace the whole of this comment's content by "no preview"
    and remove what's below.
-->
***
<a href="https://pr-preview.s3.amazonaws.com/mikewest/ServiceWorker/pull/1821.html" title="Last updated on Mar 10, 2026, 7:00 AM UTC (c92ea02)">Preview</a> | <a href="https://pr-preview.s3.amazonaws.com/w3c/ServiceWorker/1821/4a9e044...mikewest:c92ea02.html" title="Last updated on Mar 10, 2026, 7:00 AM UTC (c92ea02)">Diff</a>
You can view, comment on, or merge this pull request online at:

  https://github.com/w3c/ServiceWorker/pull/1821

-- Commit Summary --

  * Teach ExtendableMessageEvent to work with origins.

-- File Changes --

    M index.bs (26)

-- Patch Links --

https://github.com/w3c/ServiceWorker/pull/1821.patch
https://github.com/w3c/ServiceWorker/pull/1821.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/pull/1821
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/ServiceWorker/pull/1821@github.com>

Received on Tuesday, 10 March 2026 07:00:40 UTC