Skip to content

Commit

Permalink
Remove Unicode serialization of an origin
Browse files Browse the repository at this point in the history
And rename “ASCII serialization of an origin” to “serialization of an
origin” though allow both to be used.

Not all implementations implemented the Unicode variant and the ones
that did, did so in a way that made it hard to use.

Tests:

* web-platform-tests/wpt#5939
* web-platform-tests/wpt#5940
* web-platform-tests/wpt#5941
* web-platform-tests/wpt#5944
* web-platform-tests/wpt#5946
* web-platform-tests/wpt#5955
* web-platform-tests/wpt#5957
* web-platform-tests/wpt#5958

URL Standard change: whatwg/url#311.

Service Worker specification follow-up issue: w3c/ServiceWorker#1142.

Fixes #2568.
  • Loading branch information
annevk committed May 18, 2017
1 parent 4257a9b commit 59ebd9c
Showing 1 changed file with 37 additions and 72 deletions.
109 changes: 37 additions & 72 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -22385,14 +22385,11 @@ interface <dfn>HTMLHyperlinkElementUtils</dfn> {
<li><p>If this element's <span data-x="concept-hyperlink-url">url</span> is null, return the
empty string.</p></li>

<li><p>Return the <span data-x="Unicode serialization of an origin">Unicode serialization</span>
of this element's <span data-x="concept-hyperlink-url">url</span>'s <span
<li><p>Return the <span data-x="serialization of an origin">serialization</span> of this
element's <span data-x="concept-hyperlink-url">url</span>'s <span
data-x="concept-url-origin">origin</span>.</p></li>
</ol>

<p class="note no-backref">It returns the Unicode rather than the ASCII serialization for
compatibility with <code>MessageEvent</code>.</p>

<p>The <dfn><code data-x="dom-hyperlink-protocol">protocol</code></dfn> attribute's getter must
run these steps:</p>

Expand Down Expand Up @@ -79532,8 +79529,8 @@ callback <dfn>FrameRequestCallback</dfn> = void (<span>DOMHighResTimeStamp</span
<dl>
<dt>An <dfn data-export="" data-x="concept-origin-opaque">opaque origin</dfn></dt>
<dd><p>An internal value, with no serialization it can be recreated from (it is serialized as
"<code data-x="">null</code>" per <span>ASCII serialization of an origin</span>), for which the
only meaningful operation is testing for equality.</p></dd>
"<code data-x="">null</code>" per <span>serialization of an origin</span>), for which the only
meaningful operation is testing for equality.</p></dd>

<dt>A <dfn data-export="" data-x="concept-origin-tuple">tuple origin</dfn></dt>
<dd>
Expand Down Expand Up @@ -79706,42 +79703,9 @@ callback <dfn>FrameRequestCallback</dfn> = void (<span>DOMHighResTimeStamp</span

<hr>

<p>The <!--en-GB--><dfn id="unicode-serialisation-of-an-origin" data-export="">Unicode
serialization of an origin</dfn> is the string obtained by applying the following algorithm to the
given <span>origin</span> <var>origin</var>:</p>

<ol>
<li><p>If <var>origin</var> is an <span data-x="concept-origin-opaque">opaque origin</span>, then
return "<code data-x="">null</code>".</p></li>

<li><p>Let <var>host</var> be <var>origin</var>'s <span
data-x="concept-origin-host">host</span>.</p></li>

<li><p>Let <var>unicodeHost</var> be <var>host</var> if <var>host</var> is not a <span
data-x="concept-domain">domain</span>, and the result of applying <span>domain to Unicode</span>
to <var>host</var> otherwise.</p></li>

<li><p>Let <var>unicodeOrigin</var> be a new <span data-x="concept-origin-tuple">tuple
origin</span> consisting <var>origin</var>'s <span data-x="concept-origin-scheme">scheme</span>,
<var>unicodeHost</var>, and <var>origin</var>'s <span
data-x="concept-origin-port">port</span>.</p></li>

<li>
<p>Return the <span>ASCII serialization of an origin</span>, given <var>unicodeOrigin</var>.</p>

<p class="note">The name <span>ASCII serialization of an origin</span> is misleading, as it
merely serializes an origin, which are all ASCII by default due to the <span>URL
parser</span>.</p>
</li>
</ol>

<p class="example">The <span data-x="Unicode serialization of an origin">Unicode
serialization</span> of ("<code data-x="">https</code>", "<code
data-x="">xn--maraa-rta.example</code>", null, null) is "<code
data-x="">https://maraña.example</code>".</p>

<p>The <!--en-GB--><dfn id="ascii-serialisation-of-an-origin" data-export="">ASCII serialization
of an origin</dfn> is the string obtained by applying the following algorithm to the given
<p>The <!--en-GB--><dfn id="ascii-serialisation-of-an-origin" data-export=""
data-lt="serialization of an origin|ASCII serialization of an origin">serialization of an
origin</dfn> is the string obtained by applying the following algorithm to the given
<span>origin</span> <var>origin</var>:</p>

<ol>
Expand All @@ -79764,6 +79728,13 @@ callback <dfn>FrameRequestCallback</dfn> = void (<span>DOMHighResTimeStamp</span
<li><p>Return <var>result</var>.</p></li>
</ol>

<p class="example">The <span data-x="serialization of an origin">serialization</span> of ("<code
data-x="">https</code>", "<code data-x="">xn--maraa-rta.example</code>", null, null) is "<code
data-x="">https://xn--maraa-rta.example</code>".</p>

<!--en-GB--><p class="note" id="unicode-serialisation-of-an-origin">There used to also be a
<i>Unicode serialization of an origin</i>. However, it was never widely adopted.</p>

<hr>

<p>Two <span data-x="origin">origins</span>, <var>A</var> and <var>B</var>, are said to be
Expand Down Expand Up @@ -81264,8 +81235,8 @@ State: &lt;OUTPUT NAME=I>1&lt;/OUTPUT> &lt;INPUT VALUE="Increment" TYPE=BUTTON O
<li><p>Let <var>current</var> be <var>current</var>'s <span>parent browsing
context</span>.</p></li>

<li><p><span data-x="list append">Append</span> the <span data-x="Unicode serialization of an
origin">Unicode serialization</span> of <var>current</var>'s <span>active document</span>'s
<li><p><span data-x="list append">Append</span> the <span data-x="serialization of an
origin">serialization</span> of <var>current</var>'s <span>active document</span>'s
<span>origin</span> to <var>output</var>.</p></li>

<li><p>Return to the step labeled <i>loop</i>.</p></li>
Expand Down Expand Up @@ -81357,14 +81328,11 @@ State: &lt;OUTPUT NAME=I>1&lt;/OUTPUT> &lt;INPUT VALUE="Increment" TYPE=BUTTON O
object</span>'s <span data-x="concept-settings-object-origin">origin</span>, then throw a
<span>"<code>SecurityError</code>"</span> <code>DOMException</code>.</p></li>

<li><p>Return the <span data-x="Unicode serialization of an origin">Unicode serialization</span>
of this <code>Location</code> object's <span data-x="concept-location-url">url</span>'s <span
<li><p>Return the <span data-x="serialization of an origin">serialization</span> of this
<code>Location</code> object's <span data-x="concept-location-url">url</span>'s <span
data-x="concept-url-origin">origin</span>.</p></li>
</ol>

<p class="note no-backref">It returns the Unicode rather than the ASCII serialization for
compatibility with <code>MessageEvent</code>.</p>

<p>The <dfn><code data-x="dom-location-protocol">protocol</code></dfn> attribute's getter must run
these steps:</p>

Expand Down Expand Up @@ -90211,7 +90179,7 @@ document.body.appendChild(frame)</pre>

<p>The <dfn data-x="dom-origin"><code>origin</code></dfn> attribute's getter must return this
object's <span>relevant settings object</span>'s <span
data-x="concept-settings-object-origin">origin</span>, <span data-x="Unicode serialization of an
data-x="concept-settings-object-origin">origin</span>, <span data-x="serialization of an
origin">serialized</span>.</p>


Expand Down Expand Up @@ -94345,10 +94313,10 @@ any-char = %x0000-0009 / %x000B-000C / %x000E-10FFFF
<li><p>Initialize <var>event</var>'s <code data-x="dom-Event-type">type</code> attribute to <code
data-x="event-message">message</code>, its <code data-x="dom-MessageEvent-data">data</code>
attribute to <var>data</var>, its <code data-x="dom-MessageEvent-origin">origin</code> attribute
to the <span data-x="Unicode serialization of an origin">Unicode serialization</span>
of the <span>origin</span> of the event stream's final URL (i.e. the URL after redirects), and
its <code data-x="dom-MessageEvent-lastEventId">lastEventId</code> attribute to the <span
data-x="concept-event-stream-last-event-id">last event ID string</span> of the event
to the <span data-x="serialization of an origin">serialization</span> of the <span
data-x="concept-url-origin">origin</span> of the event stream's final URL (i.e., the URL after
redirects), and its <code data-x="dom-MessageEvent-lastEventId">lastEventId</code> attribute to
the <span data-x="concept-event-stream-last-event-id">last event ID string</span> of the event
source.</p></li>

<li><p>If the <var>event type</var> buffer has a value other than the empty string, change the
Expand Down Expand Up @@ -95102,10 +95070,10 @@ socket.onopen = function () {
<li><p><span data-x="concept-event-fire">Fire an event</span> named <code
data-x="event-message">message</code> at the <code>WebSocket</code> object, using
<code>MessageEvent</code>, with the <code data-x="dom-MessageEvent-origin">origin</code>
attribute initialized to the <span data-x="Unicode serialization of an origin">Unicode
serialization</span> of the <code>WebSocket</code> object's <span
data-x="concept-websocket-url">url</span>'s <span data-x="concept-url-origin">origin</span>, and
the <code data-x="dom-MessageEvent-data">data</code> attribute initialized to
attribute initialized to the <span data-x="serialization of an origin">serialization</span> of
the <code>WebSocket</code> object's <span data-x="concept-websocket-url">url</span>'s <span
data-x="concept-url-origin">origin</span>, and the <code
data-x="dom-MessageEvent-data">data</code> attribute initialized to
<var>dataForEvent</var>.</p></li>

</ol>
Expand Down Expand Up @@ -95548,8 +95516,8 @@ function receiver(e) {
<code>Document</code></span>'s <span>origin</span> is not <span>same origin</span> with
<var>targetOrigin</var>, then abort these steps.</p></li>

<li><p>Let <var>origin</var> be the <span data-x="Unicode serialization of an origin">Unicode
serialization</span> of <var>incumbentSettings</var>'s <span
<li><p>Let <var>origin</var> be the <span data-x="serialization of an
origin">serialization</span> of <var>incumbentSettings</var>'s <span
data-x="concept-settings-object-origin">origin</span>.</p></li>

<li><p>Let <var>source</var> be the <code>WindowProxy</code> object's corresponding to
Expand Down Expand Up @@ -96354,17 +96322,17 @@ interface <dfn>BroadcastChannel</dfn> : <span>EventTarget</span> {
<p>If this throws an exception, then <span data-x="concept-event-fire">fire an event</span>
named <code data-x="event-messageerror">messageerror</code> at <var>destination</var>, using
<code>MessageEvent</code>, with the <code data-x="dom-MessageEvent-origin">origin</code>
attribute initialized to the <span data-x="Unicode serialization of an origin">Unicode
serialization</span> of <var>sourceSettings</var>'s <span
data-x="concept-settings-object-origin">origin</span>, and then abort these steps.</p>
attribute initialized to the <span data-x="serialization of an origin">serialization</span> of
<var>sourceSettings</var>'s <span data-x="concept-settings-object-origin">origin</span>, and
then abort these steps.</p>
</li>

<li><p><span data-x="concept-event-fire">Fire an event</span> named <code
data-x="event-message">message</code> at <var>destination</var>, using
<code>MessageEvent</code>, with the <code data-x="dom-MessageEvent-data">data</code> attribute
initialized to <var>data</var> and the <code data-x="dom-MessageEvent-origin">origin</code>
attribute initialized to the <span data-x="Unicode serialization of an origin">Unicode
serialization</span> of <var>sourceSettings</var>'s <span
attribute initialized to the <span data-x="serialization of an origin">serialization</span> of
<var>sourceSettings</var>'s <span
data-x="concept-settings-object-origin">origin</span>.</p></li>
</ol>

Expand Down Expand Up @@ -98166,14 +98134,11 @@ interface <dfn>WorkerLocation</dfn> {
data-x="concept-url-serializer">serialized</span>.</p>

<p>The <dfn><code data-x="dom-WorkerLocation-origin">origin</code></dfn> attribute's getter must
return the <span data-x="Unicode serialization of an origin">Unicode serialization</span> of the
associated <span data-x="concept-WorkerLocation-WorkerGlobalScope"><code>WorkerGlobalScope</code>
object</span>'s <span data-x="concept-WorkerGlobalScope-url">url</span>'s <span
return the <span data-x="serialization of an origin">serialization</span> of the associated <span
data-x="concept-WorkerLocation-WorkerGlobalScope"><code>WorkerGlobalScope</code> object</span>'s
<span data-x="concept-WorkerGlobalScope-url">url</span>'s <span
data-x="concept-url-origin">origin</span>.</p>

<p class="note no-backref">It returns the Unicode rather than the ASCII serialization for
compatibility with <code>MessageEvent</code>.</p>

<p>The <dfn><code data-x="dom-WorkerLocation-protocol">protocol</code></dfn> attribute's getter
must run return the associated <span
data-x="concept-WorkerLocation-WorkerGlobalScope"><code>WorkerGlobalScope</code> object</span>'s
Expand Down

0 comments on commit 59ebd9c

Please sign in to comment.