Skip to content

Commit

Permalink
Inline URLUtilsReadOnly since the URLUtils abstraction is not working…
Browse files Browse the repository at this point in the history
… out

See whatwg/url#62 for details.
  • Loading branch information
annevk committed Sep 23, 2015
1 parent cf833be commit 0125db0
Showing 1 changed file with 116 additions and 11 deletions.
127 changes: 116 additions & 11 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 serializer">host serialiser</dfn>
<li>The <dfn data-noexport="" data-x="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 @@ -96313,22 +96315,125 @@ 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 represents the <code>WorkerGlobalScope</code> object's
<span data-x="concept-WorkerGlobalScope-url">url</span>.
<span data-x="concept-WorkerGlobalScope-url">url</span>.</p>

<p>The <dfn><code data-x="dom-WorkerLocation-href">href</code></dfn> attribute's getter must
return the <code>WorkerGlobalScope</code> object'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
<code>WorkerGlobalScope</code> object'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 <code>WorkerGlobalScope</code> object'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 <code>WorkerGlobalScope</code> object'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
serializer">serialised</span>.</p></li>

<li><p>Return <var>url</var>'s <span data-x="concept-url-host">host</span>, <span data-x="host
serializer">serialised</span>, followed by "<code data-x="">:</code>" and <var>url</var>'s <span
data-x="concept-url-port">port</span>, <span data-x="serialize 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 <code>WorkerGlobalScope</code> object'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 serializer">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>

<p>The <code>WorkerLocation</code> interface supports the <code>URLUtilsReadOnly</code>
interface. <ref spec=URL></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="serialize 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>

<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>
<ol>
<li><p>Let <var>url</var> be the <code>WorkerGlobalScope</code> object'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>

<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 element's <code>URLUtilsReadOnly</code> interface's <span
data-x="concept-uu-get-the-base">get the base</span> algorithm must return null.</p>
<ol>
<li><p>Let <var>query</var> be the <code>WorkerGlobalScope</code> object'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>

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

<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 <code>WorkerGlobalScope</code> object'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

0 comments on commit 0125db0

Please sign in to comment.