Skip to content

Commit

Permalink
URL's href attribute needs to reset URLSearchParams too
Browse files Browse the repository at this point in the history
Fixes #117.
  • Loading branch information
annevk committed Oct 19, 2016
1 parent c94f6f2 commit f856310
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
14 changes: 11 additions & 3 deletions url.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2488,6 +2488,14 @@ url.href // "https://url.spec.whatwg.org/%F0%9F%8D%A3%F0%9F%8D%BA"</pre>
<li><p>If <var>parsedURL</var> is failure, <a>throw</a> a <code>TypeError</code> exception.

<li><p>Set <a>context object</a>'s <a for=URL>url</a> to <var>parsedURL</var>.

<li><p>Empty <a>context object</a>'s <a for=URL>query object</a>'s <a for=URLSearchParams>list</a>.

<li><p>Let <var>query</var> be <a>context object</a>'s <a for=URL>url</a>'s <a for=url>query</a>.

<li><p>If <var>query</var> is non-null, then set <a>context object</a>'s
<a for=URL>query object</a>'s <a for=URLSearchParams>list</a> to the result of
<a lt='urlencoded string parser'>parsing</a> <var>query</var>.
</ol>

<p>The <dfn attribute for=URL><code>origin</code></dfn> attribute's getter must return the
Expand Down Expand Up @@ -2649,7 +2657,7 @@ steps:
<li><p>Let <var>url</var> be <a>context object</a>'s <a for=URL>url</a>.

<li><p>If the given value is the empty string, set <var>url</var>'s <a for=url>query</a> to null,
empty <var>url</var>'s <a for=URL>query object</a>'s <a for=URLSearchParams>list</a>,
empty <a>context object</a>'s <a for=URL>query object</a>'s <a for=URLSearchParams>list</a>,
and terminate these steps.

<li><p>Let <var>input</var> be the given value with a single leading "<code>?</code>" removed, if
Expand All @@ -2660,8 +2668,8 @@ steps:
<li><p><a lt='basic URL parser'>Basic URL parse</a> <var>input</var> with <var>url</var> as
<var>url</var> and <a>query state</a> as <var>state override</var>.

<li><p>Set <var>url</var>'s <a for=URL>query object</a>'s <a for=URLSearchParams>list</a> to the
result of <a lt='urlencoded string parser'>parsing</a> <var>input</var>.
<li><p>Set <a>context object</a>'s <a for=URL>query object</a>'s <a for=URLSearchParams>list</a> to
the result of <a lt='urlencoded string parser'>parsing</a> <var>input</var>.
</ol>

<p>The <dfn attribute for=URL><code>searchParams</code></dfn> attribute's getter must return
Expand Down
12 changes: 9 additions & 3 deletions url.html
Original file line number Diff line number Diff line change
Expand Up @@ -1839,6 +1839,12 @@ <h3 class="heading settled" data-level="6.2" id="urlutils-members"><span class="
<p>If <var>parsedURL</var> is failure, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code>TypeError</code> exception. </p>
<li>
<p>Set <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-url-url">url</a> to <var>parsedURL</var>. </p>
<li>
<p>Empty <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-url-query-object">query object</a>’s <a data-link-type="dfn" href="#concept-urlsearchparams-list">list</a>. </p>
<li>
<p>Let <var>query</var> be <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-url-url">url</a>’s <a data-link-type="dfn" href="#concept-url-query">query</a>. </p>
<li>
<p>If <var>query</var> is non-null, then set <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-url-query-object">query object</a>’s <a data-link-type="dfn" href="#concept-urlsearchparams-list">list</a> to the result of <a data-link-type="dfn" href="#concept-urlencoded-string-parser">parsing</a> <var>query</var>. </p>
</ol>
<p>The <dfn class="idl-code" data-dfn-for="URL" data-dfn-type="attribute" data-export="" id="dom-url-origin"><code>origin</code><a class="self-link" href="#dom-url-origin"></a></dfn> attribute’s getter must return the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#unicode-serialisation-of-an-origin">Unicode serialization</a> of <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-url-url">url</a>’s <a data-link-type="dfn" href="#concept-url-origin">origin</a>. <a data-link-type="biblio" href="#biblio-html">[HTML]</a> </p>
<p class="note no-backref" role="note">It returns the Unicode rather than the ASCII serialization for
Expand Down Expand Up @@ -1959,7 +1965,7 @@ <h3 class="heading settled" data-level="6.2" id="urlutils-members"><span class="
<p>Let <var>url</var> be <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-url-url">url</a>. </p>
<li>
<p>If the given value is the empty string, set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-query">query</a> to null,
empty <var>url</var>’s <a data-link-type="dfn" href="#concept-url-query-object">query object</a>’s <a data-link-type="dfn" href="#concept-urlsearchparams-list">list</a>,
empty <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-url-query-object">query object</a>’s <a data-link-type="dfn" href="#concept-urlsearchparams-list">list</a>,
and terminate these steps. </p>
<li>
<p>Let <var>input</var> be the given value with a single leading "<code>?</code>" removed, if
Expand All @@ -1969,8 +1975,8 @@ <h3 class="heading settled" data-level="6.2" id="urlutils-members"><span class="
<li>
<p><a data-link-type="dfn" href="#concept-basic-url-parser">Basic URL parse</a> <var>input</var> with <var>url</var> as <var>url</var> and <a data-link-type="dfn" href="#query-state">query state</a> as <var>state override</var>. </p>
<li>
<p>Set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-query-object">query object</a>’s <a data-link-type="dfn" href="#concept-urlsearchparams-list">list</a> to the
result of <a data-link-type="dfn" href="#concept-urlencoded-string-parser">parsing</a> <var>input</var>. </p>
<p>Set <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-url-query-object">query object</a>’s <a data-link-type="dfn" href="#concept-urlsearchparams-list">list</a> to
the result of <a data-link-type="dfn" href="#concept-urlencoded-string-parser">parsing</a> <var>input</var>. </p>
</ol>
<p>The <dfn class="idl-code" data-dfn-for="URL" data-dfn-type="attribute" data-export="" id="dom-url-searchparams"><code>searchParams</code><a class="self-link" href="#dom-url-searchparams"></a></dfn> attribute’s getter must return <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-url-query-object">query object</a>. </p>
<p>The <dfn class="idl-code" data-dfn-for="URL" data-dfn-type="attribute" data-export="" id="dom-url-hash"><code>hash</code><a class="self-link" href="#dom-url-hash"></a></dfn> attribute’s
Expand Down

0 comments on commit f856310

Please sign in to comment.