Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
151 changes: 136 additions & 15 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -2695,6 +2695,8 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
<li>The <dfn data-noexport="" data-x="concept-url-fragment">fragment</dfn> component of a <span>parsed URL</span>
<li><dfn data-noexport="" data-x="concept-url-parse-error">Parse errors</dfn> from the <span>URL parser</span>
<li>The <dfn data-noexport="" data-x="concept-url-serialiser">URL serialiser</dfn>
<li>The <dfn data-noexport="" data-x="host serialiser" data-x-href="https://url.spec.whatwg.org/#concept-host-serializer">host serialiser</dfn>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, the en-GB-x-hixie vs. en-US is screwing us here. Are you sure you want (some of) the data-x's to use z, matching URL, whereas the human text uses s?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

|'m not. I guess once we use data-x-href more consistently the internal data-x value is really irrelevant. We could also move back to US and perhaps no longer declare -hixie since he's no longer the sole editor.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, maybe a good long term plan. In the meantime maybe just stay consistent? Not a blocker for this PR though IMO.

<li>The <dfn data-noexport="" data-x="serialise an integer" data-x-href="https://url.spec.whatwg.org/#serialize-an-integer">serialise an integer</dfn>
<li><dfn data-noexport="">Default encode set</dfn>
<li><dfn data-noexport="">Percent encode</dfn>
<li><dfn data-noexport="">UTF-8 percent encode</dfn>
Expand Down Expand Up @@ -95256,9 +95258,13 @@ interface <dfn>WorkerGlobalScope</dfn> : <span>EventTarget</span> {
<code>WorkerGlobalScope</code> object itself.</p>

<p>The <dfn><code data-x="dom-WorkerGlobalScope-location">location</code></dfn> attribute must
return the <code>WorkerLocation</code> object created for the <code>WorkerGlobalScope</code>
object when the worker was created. It represents the <code>WorkerGlobalScope</code> object's
<span data-x="concept-WorkerGlobalScope-url">url</span>.</p>
return the <code>WorkerLocation</code> object whose associated <span
data-x="concept-WorkerLocation-WorkerGlobalScope"><code>WorkerGlobalScope</code> object</span> is
the <code>WorkerGlobalScope</code> object.</p>

<p class="note">While the <code>WorkerLocation</code> object is created after the
<code>WorkerGlobalScope</code> object, this is not problematic as it cannot be observed from
script.</p>

<hr>

Expand Down Expand Up @@ -95572,6 +95578,9 @@ interface <dfn>WorkerGlobalScope</dfn> : <span>EventTarget</span> {
environment</span>. (In either case, by definition, it is a <span>worker
environment</span>.)</p></li>

<li><p>Create a new <code>WorkerLocation</code> object and associate it with <var>worker global
scope</var>.</p>

<li><!-- SCRIPT EXEC -->

<p>Let <var>script</var> be a new <span data-x="concept-script">script</span>.</p>
Expand Down Expand Up @@ -96393,22 +96402,134 @@ interface <dfn>WorkerNavigator</dfn> {};
<h4>Worker locations</h4>

<pre class="idl">[Exposed=Worker]
interface <dfn>WorkerLocation</dfn> { };
<span>WorkerLocation</span> implements <span>URLUtilsReadOnly</span>;</pre>
interface <dfn>WorkerLocation</dfn> {
stringifier readonly attribute USVString <span data-x="dom-WorkerLocation-href">href</span>;
readonly attribute USVString <span data-x="dom-WorkerLocation-origin">origin</span>;
readonly attribute USVString <span data-x="dom-WorkerLocation-protocol">protocol</span>;
readonly attribute USVString <span data-x="dom-WorkerLocation-host">host</span>;
readonly attribute USVString <span data-x="dom-WorkerLocation-hostname">hostname</span>;
readonly attribute USVString <span data-x="dom-WorkerLocation-port">port</span>;
readonly attribute USVString <span data-x="dom-WorkerLocation-pathname">pathname</span>;
readonly attribute USVString <span data-x="dom-WorkerLocation-search">search</span>;
readonly attribute USVString <span data-x="dom-WorkerLocation-hash">hash</span>;
};</pre>

<p>A <code>WorkerLocation</code> object has an associated <dfn
data-x="concept-WorkerLocation-WorkerGlobalScope"><code>WorkerGlobalScope</code> object</dfn> (a
<code>WorkerGlobalScope</code> object).

<p>The <dfn><code data-x="dom-WorkerLocation-href">href</code></dfn> attribute's getter must
return the associated <span
data-x="concept-WorkerLocation-WorkerGlobalScope"><code>WorkerGlobalScope</code> object</span>'s
<span data-x="concept-WorkerGlobalScope-url">url</span>, <span
data-x="concept-url-serialiser">serialised</span>.</p>

<p>The <dfn><code data-x="dom-WorkerLocation-origin">origin</code></dfn> attribute's getter must
return the <span data-x="Unicode serialisation 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 <a
data-x="concept-url-origin">origin</a>.</p>

<p class="note no-backref">It returns the Unicode rather than the ASCII serialisation 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
<span data-x="concept-WorkerGlobalScope-url">url</span>'s <span
data-x="concept-url-scheme">scheme</span>, followed by "<code data-x="">:</code>".</p>

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

<ol>
<li><p>Let <var>url</var> be the associated <span
data-x="concept-WorkerLocation-WorkerGlobalScope"><code>WorkerGlobalScope</code> object</span>'s
<span data-x="concept-WorkerGlobalScope-url">url</span>.</p></li>

<li><p>If <var>url</var>'s <span data-x="concept-url-host">host</span> is null, return the empty
string.</p></li>

<li><p>If <var>url</var>'s <span data-x="concept-url-port">port</span> is null, return
<var>url</var>'s <span data-x="concept-url-host">host</span>, <span data-x="host
serialiser">serialised</span>.</p></li>

<li><p>Return <var>url</var>'s <span data-x="concept-url-host">host</span>, <span data-x="host
serialiser">serialised</span>, followed by "<code data-x="">:</code>" and <var>url</var>'s <span
data-x="concept-url-port">port</span>, <span data-x="serialise an
integer">serialised</span>.</p></li>
</ol>

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

<ol>
<li><p>Let <var>host</var> be 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-host">host</span>.</p></li>

<li><p>If <var>host</var> is null, return the empty string.</p></li>

<li><p>Return <var>host</var> <span data-x="host serialiser">serialised</span>.</p></li>
</ol>

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

<ol>
<li><p>Let <var>port</var> be the <code>WorkerGlobalScope</code> object's <span
data-x="concept-WorkerGlobalScope-url">url</span>'s <span
data-x="concept-url-port">port</span>.</p></li>

<li><p>If <var>port</var> is null, return the empty string.</p></li>

<li><p>Return <var>port</var>, <span data-x="serialise an integer">serialised</span>.</p></li>
</ol>

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

<ol>
<li><p>Let <var>url</var> be the associated <span
data-x="concept-WorkerLocation-WorkerGlobalScope"><code>WorkerGlobalScope</code> object</span>'s
<span data-x="concept-WorkerGlobalScope-url">url</span>.</p></li>

<li><p>If <var>url</var>'s <span>non-relative flag</span> is set, return the first string in
<var>url</var>'s <span data-x="concept-url-path">path</span>.</p></li>

<p>A <code>WorkerLocation</code> object represents the <code>WorkerGlobalScope</code> object's
<span data-x="concept-WorkerGlobalScope-url">url</span>.
<li><p>Return "<code data-x="">/</code>", followed by the strings in <var>url</var>'s <span
data-x="concept-url-path">path</span> (including empty strings), separated from each other by
"<code data-x="">/</code>".</p></li>
</ol>

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

<p>The <code>WorkerLocation</code> interface supports the <code>URLUtilsReadOnly</code>
interface. <ref spec=URL></p>
<ol>
<li><p>Let <var>query</var> be 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-query">query</span>.</p></li>

<li><p>If <var>query</var> is either null or the empty string, return the empty string.</p></li>

<p>When the object is created, the user agent must invoke the element's
<code>URLUtilsReadOnly</code> interface's <span data-x="concept-uu-set-the-input">set the
input</span> algorithm with the <span>absolute URL</span> that the <code>WorkerLocation</code>
object represents as the given value.</p>
<li><p>Return "<code data-x="">?</code>", followed by <var>query</var>.</p></li>
</ol>

<p>The element's <code>URLUtilsReadOnly</code> interface's <span
data-x="concept-uu-get-the-base">get the base</span> algorithm must return null.</p>
<p>The <dfn><code data-x="dom-WorkerLocation-hash">hash</code></dfn> attribute's getter must run
these steps:</p>

<ol>
<li><p>Let <var>fragment</var> be 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-fragment">fragment</span>.</p></li>

<li><p>If <var>fragment</var> is either null or the empty string, return the empty string.</p></li>

<li><p>Return "<code data-x="">#</code>", followed by <var>fragment</var>.</p></li>
</ol>


<!--REMOVE-TOPIC:Workers-->
Expand Down