[whatwg/url] Define the "extract an origin" operation. (PR #892)

https://github.com/whatwg/html/pull/11846 added an `Origin` interface, which relies on an "extract an origin" operation to support the creation of new `Origin` objects via `Origin.from(...)`. This PR defines that operation for `URL` objects.

Addresses a remaining portion of https://github.com/whatwg/html/issues/11534.

- [X] At least two implementers are interested (and none opposed):
   * https://github.com/whatwg/html/pull/11846 records the support for the underlying change.
- [X] [Tests](https://github.com/web-platform-tests/wpt) are written and can be reviewed and commented upon at:
   * https://wpt.fyi/results/html/browsers/origin/tentative/api/origin-from-url.any.html?label=experimental&label=master&aligned (will be non-tentative shortly).
- [X] [Implementation bugs](https://github.com/whatwg/meta/blob/main/MAINTAINERS.md#handling-pull-requests) are filed:
   * This work is part of the work necessary for the bugs recorded in the HTML PR above.
- [X] [MDN issue](https://github.com/whatwg/meta/blob/main/MAINTAINERS.md#handling-pull-requests) is filed: Same as the HTML PR above.
- [X] The top of this comment includes a [clear commit message](https://github.com/whatwg/meta/blob/main/COMMITTING.md) to use. <!-- If you created this PR from a single commit, Github copied its message. Otherwise, you need to add a commit message yourself. -->

(See [WHATWG Working Mode: Changes](https://whatwg.org/working-mode#changes) for more details.)


<!--
    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://whatpr.org/url/892.html" title="Last updated on Dec 4, 2025, 8:49 AM UTC (149c199)">Preview</a> | <a href="https://whatpr.org/url/892/5252665...149c199.html" title="Last updated on Dec 4, 2025, 8:49 AM UTC (149c199)">Diff</a>
You can view, comment on, or merge this pull request online at:

  https://github.com/whatwg/url/pull/892

-- Commit Summary --

  * Define the "extract an origin" operation.

-- File Changes --

    M url.bs (5)

-- Patch Links --

https://github.com/whatwg/url/pull/892.patch
https://github.com/whatwg/url/pull/892.diff

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

Message ID: <whatwg/url/pull/892@github.com>

Received on Thursday, 4 December 2025 08:49:48 UTC