@@ -26062,6 +26062,18 @@ document.body.appendChild(wbr);</code></pre>
2606226062 <p>An element implementing the <code>HTMLHyperlinkElementUtils</code> mixin has an associated <dfn
2606326063 data-x="concept-hyperlink-url">url</dfn> (null or a <span>URL</span>). It is initially null.
2606426064
26065+ <div algorithm>
26066+ <p>An element implementing the <code>HTMLHyperlinkElementUtils</code> mixin has the following
26067+ <span>extract an origin</span> steps:</p>
26068+
26069+ <ol>
26070+ <li><p>If <span>this</span>'s <span data-x="concept-hyperlink-url">url</span> is null, return
26071+ null.</p></li>
26072+ <li><p>Return <span>this</span>'s <span data-x="concept-hyperlink-url">url</span>'s
26073+ <span data-x="concept-url-origin">origin</span>.</p></li>
26074+ </ol>
26075+ </div>
26076+
2606526077 <div algorithm>
2606626078 <p>An element implementing the <code>HTMLHyperlinkElementUtils</code> mixin has an associated <dfn
2606726079 data-x="concept-hyperlink-url-set">set the url</dfn> algorithm, which runs these steps:</p>
@@ -92415,6 +92427,104 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
9241592427
9241692428 </div>
9241792429
92430+ <h5>The <code data-x="dom-Origin-interface">Origin</code> interface</h5>
92431+
92432+ <p>The <code data-x="dom-Origin-interface">Origin</code> interface represents an
92433+ <span>origin</span>, allowing robust <span>same origin</span> and <span>same site</span>
92434+ comparisons.</p>
92435+
92436+ <pre><code class="idl">[Exposed=*]
92437+ interface <dfn interface data-x="dom-Origin-interface">Origin</dfn> {
92438+ <span data-x="dom-Origin-constructor">constructor</span>();
92439+
92440+ static <span data-x="dom-Origin-interface">Origin</span> <span data-x="dom-Origin-from">from</span>(any value);
92441+
92442+ readonly attribute boolean <span data-x="dom-Origin-opaque">opaque</span>;
92443+
92444+ boolean <span data-x="dom-Origin-isSameOrigin">isSameOrigin</span>(Origin other);
92445+ boolean <span data-x="dom-Origin-isSameSite">isSameSite</span>(Origin other);
92446+ };</code></pre>
92447+
92448+ <p><code data-x="dom-Origin-interface">Origin</code> objects have an
92449+ <dfn for="Origin" attribute>[[origin]]</dfn> internal slot, which holds an
92450+ <span>origin</span>.</p>
92451+
92452+ <p><span data-x="platform object">Platform objects</span> have an
92453+ <dfn for="platform object" export>extract an origin</dfn> operation, which returns null unless
92454+ otherwise specified.</p>
92455+
92456+ <div algorithm>
92457+ <p>Objects implementing the <code data-x="dom-Origin-interface">Origin</code> interface's
92458+ <span>extract an origin</span> steps are to return <span>this</span>'s
92459+ <span>[[origin]]</span>.</p>
92460+ </div>
92461+
92462+ <div algorithm>
92463+ <p>The <dfn constructor for="Origin"><code
92464+ data-x="dom-Origin-constructor">new Origin()</code></dfn> constructor steps are:</p>
92465+
92466+ <ol>
92467+ <li><p>Set <span>this</span>'s <span>[[origin]]</span> internal slot to a unique
92468+ <span data-x="concept-origin-opaque">opaque origin</span>.</p></li>
92469+ </ol>
92470+ </div>
92471+
92472+ <div algorithm>
92473+ <p>The static <dfn method for="Origin"><code data-x="dom-Origin-from">from(value)</code></dfn>
92474+ method accepts an arbitrary object <var>value</var>, and returns either a newly-constructed
92475+ <code data-x="dom-Origin-interface">Origin</code> object if one can be extracted from
92476+ <var>value</var>, or throws a <code>TypeError</code> otherwise:</p>
92477+
92478+ <ol>
92479+ <li>
92480+ <p>If <var>value</var> is a <span>platform object</span>:</p>
92481+ <ol>
92482+ <li><p>Let <var>origin</var> be the result of executing <var>value</var>'s <span>extract an
92483+ origin</span> operation.</p></li>
92484+ <li><p>If <var>origin</var> is not null, return a new
92485+ <code data-x="dom-Origin-interface">Origin</code> object whose <span>[[origin]]</span> is set
92486+ to <var>origin</var>.</p></li>
92487+ </ol>
92488+ </li>
92489+ <li>
92490+ <p>If <var>value</var> is a <span>string</span>:</p>
92491+ <ol>
92492+ <li><p>Let <var>parsed url</var> be the result of <span data-x="basic url parser">basic URL
92493+ parsing</span> <var>value</var>.</p></li>
92494+ <li><p>If <var>parsed url</var> is not failure, return a new
92495+ <code data-x="dom-Origin-interface">Origin</code> object whose <span>[[origin]]</span> is set
92496+ to <var>parsed url</var>'s <span data-x="concept-url-origin">origin</span>.</p></li>
92497+ </ol>
92498+ </li>
92499+ <li><p>Throw a <code>TypeError</code>.</p></li>
92500+ </ol>
92501+ </div>
92502+
92503+ <div algorithm>
92504+ <p>The <dfn attribute for="Origin"><code data-x="dom-Origin-opaque">opaque</code></dfn> attribute
92505+ getter steps are to return true if <span>this</span>'s <span>[[origin]]</span> is an <span
92506+ data-x="concept-origin-opaque">opaque origin</span>, and false otherwise.</p>
92507+ </div>
92508+
92509+ <div algorithm>
92510+ <p>The <dfn method for="Origin"><code
92511+ data-x="dom-Origin-isSameOrigin">isSameOrigin(other)</code></dfn> method returns true if
92512+ <span>this</span>'s <span>[[origin]]</span> is <span>same origin</span> with <var>other</var>'s
92513+ <span>[[origin]]</span>, and false otherwise.</p>
92514+ </div>
92515+
92516+ <div algorithm>
92517+ <p>The <dfn method for="Origin"><code
92518+ data-x="dom-Origin-isSameSite">isSameSite(other)</code></dfn> method returns true if
92519+ <span>this</span>'s <span>[[origin]]</span> is <span>same site</span> with <var>other</var>'s
92520+ <span>[[origin]]</span>, and false otherwise.</p>
92521+
92522+ <p class="note">This is a <span>same site</span>, <em>not</em> <span>schemelessly same
92523+ site</span>, comparison. For the reasons <a
92524+ href="https://url.spec.whatwg.org/#warning-avoid-psl">explained in <cite>URL</cite></a> The
92525+ <code data-x="dom-Origin-interface">Origin</code> origin does not offer schemeless comparison.</p>
92526+ </div>
92527+
9241892528
9241992529 <h4><span id="origin-isolation"></span>Origin-keyed agent clusters</h4>
9242092530
@@ -96906,6 +97016,21 @@ interface <dfn interface>Location</dfn> { // but see also <a href="#the-location
9690697016 <code>Document</code></span> is non-null, and <code>about:blank</code> otherwise.</p>
9690797017 </div>
9690897018
97019+ <div algorithm>
97020+ <p>An element implementing the <code>Location</code> interface has the following <span>extract an
97021+ origin</span> steps:</p>
97022+
97023+ <ol>
97024+ <li><p>If <span>this</span>'s <span>relevant <code>Document</code></span> is non-null and its
97025+ <span data-x="concept-document-origin">origin</span> is not <span>same origin-domain</span> with
97026+ the <span>entry settings object</span>'s
97027+ <span data-x="concept-settings-object-origin">origin</span>, then return null.</p></li>
97028+
97029+ <li><p>Return <span>this</span>'s <span data-x="concept-location-url">url</span>'s
97030+ <span data-x="concept-url-origin">origin</span>.</p></li>
97031+ </ol>
97032+ </div>
97033+
9690997034 <div algorithm>
9691097035 <p>A <code>Location</code> object has an associated <dfn
9691197036 data-x="concept-location-ancestor-origins-list">ancestor origins list</dfn>. When a
@@ -123029,6 +123154,24 @@ document.body.appendChild(frame)</code></pre>
123029123154 capability</span>.</p>
123030123155 </div>
123031123156
123157+ <div algorithm>
123158+ <p>An element implementing the <code>WindowOrWorkerGlobalScope</code> mixin has the following
123159+ <span>extract an origin</span> steps:</p>
123160+
123161+ <ol>
123162+ <li><p>If <span>this</span>'s <span>relevant settings object</span>'s <span
123163+ data-x="concept-settings-object-origin">origin</span> is not <span>same origin-domain</span>
123164+ with the <span>entry settings object</span>'s <span
123165+ data-x="concept-settings-object-origin">origin</span>, return null.</p></li>
123166+
123167+ <li><p>Return <span>this</span>'s return <span>this</span>'s <span>relevant settings
123168+ object</span>'s <span data-x="concept-settings-object-origin">origin</span>.</p></li>
123169+ </ol>
123170+
123171+ <p class="note">Since these objects are potentially accessible cross-origin (e.g. through
123172+ <code>WindowProxy</code>), we need a security check here before granting access to the origin.</p>
123173+ </div>
123174+
123032123175 </div>
123033123176
123034123177
@@ -127539,6 +127682,12 @@ typedef (<span>WindowProxy</span> or <span>MessagePort</span> or <span>ServiceWo
127539127682 <span data-x="concept-url-fragment">fragment</span>).</p>
127540127683 </div>
127541127684
127685+ <div algorithm>
127686+ <p>Objects implementing the <code>MessageEvent</code> interface's <span>extract an origin</span>
127687+ steps are to return <span>this</span>'s <span>relevant settings object</span>'s
127688+ <span data-x="concept-settings-object-origin">origin</span>.</p>
127689+ </div>
127690+
127542127691 <div algorithm>
127543127692 <p>The <dfn attribute for="MessageEvent"><code
127544127693 data-x="dom-MessageEvent-lastEventId">lastEventId</code></dfn> attribute must return the value it
@@ -131655,6 +131804,14 @@ interface <dfn interface>WorkerLocation</dfn> {
131655131804
131656131805 <div w-nodev>
131657131806
131807+ <div algorithm>
131808+ <p>Objects implementing the <code>WorkerLocation</code> interface's <span>extract an origin</span>
131809+ steps are to return <span>this</span>'s <span
131810+ data-x="concept-WorkerLocation-WorkerGlobalScope"><code>WorkerGlobalScope</code> object</span>'s
131811+ <span data-x="concept-WorkerGlobalScope-url">url</span>'s <span
131812+ data-x="concept-url-origin">origin</span>.</p>
131813+ </div>
131814+
131658131815 <p>A <code>WorkerLocation</code> object has an associated <dfn
131659131816 data-x="concept-WorkerLocation-WorkerGlobalScope"><code>WorkerGlobalScope</code> object</dfn> (a
131660131817 <code>WorkerGlobalScope</code> object).
0 commit comments