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 28, 2016
1 parent f20ad7e commit 9f27a36
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
14 changes: 11 additions & 3 deletions url.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2513,6 +2513,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 @@ -2674,7 +2682,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 @@ -2685,8 +2693,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
24 changes: 15 additions & 9 deletions url.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<p data-fill-with="logo"><a class="logo" href="https://whatwg.org/"> <img alt="WHATWG" height="100" src="https://resources.whatwg.org/logo-url.svg"> </a> </p>
<hgroup>
<h1 class="p-name no-ref allcaps" id="title">URL</h1>
<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Living Standard — Last Updated <time class="dt-updated" datetime="2016-10-24">24 October 2016</time></span></h2>
<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Living Standard — Last Updated <time class="dt-updated" datetime="2016-10-28">28 October 2016</time></span></h2>
</hgroup>
<div data-fill-with="spec-metadata">
<dl>
Expand Down Expand Up @@ -1856,6 +1856,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 @@ -1976,7 +1982,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 @@ -1986,8 +1992,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 Expand Up @@ -2449,32 +2455,32 @@ <h3 class="no-num no-ref heading settled" id="normative"><span class="content">N
<dt id="biblio-encoding">[ENCODING]
<dd>Anne van Kesteren. <a href="https://encoding.spec.whatwg.org/">Encoding Standard</a>. Living Standard. URL: <a href="https://encoding.spec.whatwg.org/">https://encoding.spec.whatwg.org/</a>
<dt id="biblio-fileapi">[FILEAPI]
<dd>Arun Ranganathan; Jonas Sicking. <a href="https://w3c.github.io/FileAPI/">File API</a>. 21 April 2015. WD. URL: <a href="https://w3c.github.io/FileAPI/">https://w3c.github.io/FileAPI/</a>
<dd>Arun Ranganathan; Jonas Sicking. <a href="https://w3c.github.io/FileAPI/">File API</a>. URL: <a href="https://w3c.github.io/FileAPI/">https://w3c.github.io/FileAPI/</a>
<dt id="biblio-html">[HTML]
<dd>Ian Hickson. <a href="https://html.spec.whatwg.org/multipage/">HTML Standard</a>. Living Standard. URL: <a href="https://html.spec.whatwg.org/multipage/">https://html.spec.whatwg.org/multipage/</a>
<dt id="biblio-iana-uri-schemes">[IANA-URI-SCHEMES]
<dd><a href="http://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml">Uniform Resource Identifier (URI) Schemes</a>. URL: <a href="http://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml">http://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml</a>
<dt id="biblio-idna">[IDNA]
<dd>Mark Davis; Michel Suignard. <a href="http://www.unicode.org/reports/tr46/">Unicode IDNA Compatibility Processing</a>. URL: <a href="http://www.unicode.org/reports/tr46/">http://www.unicode.org/reports/tr46/</a>
<dt id="biblio-media-source">[MEDIA-SOURCE]
<dd>Matthew Wolenetz; et al. <a href="https://w3c.github.io/media-source/">Media Source Extensions™</a>. 4 October 2016. PR. URL: <a href="https://w3c.github.io/media-source/">https://w3c.github.io/media-source/</a>
<dd>Matthew Wolenetz; et al. <a href="https://w3c.github.io/media-source/">Media Source Extensions™</a>. URL: <a href="https://w3c.github.io/media-source/">https://w3c.github.io/media-source/</a>
<dt id="biblio-mediacapture-streams">[MEDIACAPTURE-STREAMS]
<dd>Daniel Burnett; et al. <a href="https://w3c.github.io/mediacapture-main/">Media Capture and Streams</a>. 19 May 2016. CR. URL: <a href="https://w3c.github.io/mediacapture-main/">https://w3c.github.io/mediacapture-main/</a>
<dd>Daniel Burnett; et al. <a href="https://w3c.github.io/mediacapture-main/">Media Capture and Streams</a>. URL: <a href="https://w3c.github.io/mediacapture-main/">https://w3c.github.io/mediacapture-main/</a>
<dt id="biblio-rfc2119">[RFC2119]
<dd>S. Bradner. <a href="https://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href="https://tools.ietf.org/html/rfc2119">https://tools.ietf.org/html/rfc2119</a>
<dt id="biblio-rfc4291">[RFC4291]
<dd>R. Hinden; S. Deering. <a href="https://tools.ietf.org/html/rfc4291">IP Version 6 Addressing Architecture</a>. February 2006. Draft Standard. URL: <a href="https://tools.ietf.org/html/rfc4291">https://tools.ietf.org/html/rfc4291</a>
<dt id="biblio-uts36">[UTS36]
<dd>Mark Davis; Michel Suignard. <a href="http://unicode.org/reports/tr36/">Unicode Security Considerations</a>. URL: <a href="http://unicode.org/reports/tr36/">http://unicode.org/reports/tr36/</a>
<dt id="biblio-webidl">[WEBIDL]
<dd>Cameron McCormack; Boris Zbarsky. <a href="https://heycam.github.io/webidl/">WebIDL Level 1</a>. 15 September 2016. PR. URL: <a href="https://heycam.github.io/webidl/">https://heycam.github.io/webidl/</a>
<dd>Cameron McCormack; Boris Zbarsky; Tobie Langel. <a href="https://heycam.github.io/webidl/">Web IDL</a>. URL: <a href="https://heycam.github.io/webidl/">https://heycam.github.io/webidl/</a>
</dl>
<h3 class="no-num no-ref heading settled" id="informative"><span class="content">Informative References</span><a class="self-link" href="#informative"></a></h3>
<dl>
<dt id="biblio-fetch">[FETCH]
<dd>Anne van Kesteren. <a href="https://fetch.spec.whatwg.org/">Fetch Standard</a>. Living Standard. URL: <a href="https://fetch.spec.whatwg.org/">https://fetch.spec.whatwg.org/</a>
<dt id="biblio-referrer-policy">[REFERRER-POLICY]
<dd>Jochen Eisinger; Mike West. <a href="https://w3c.github.io/webappsec-referrer-policy/">Referrer Policy</a>. 16 October 2016. WD. URL: <a href="https://w3c.github.io/webappsec-referrer-policy/">https://w3c.github.io/webappsec-referrer-policy/</a>
<dd>Jochen Eisinger; Mike West. <a href="https://w3c.github.io/webappsec-referrer-policy/">Referrer Policy</a>. URL: <a href="https://w3c.github.io/webappsec-referrer-policy/">https://w3c.github.io/webappsec-referrer-policy/</a>
<dt id="biblio-rfc1034">[RFC1034]
<dd>P.V. Mockapetris. <a href="https://tools.ietf.org/html/rfc1034">Domain names - concepts and facilities</a>. November 1987. Internet Standard. URL: <a href="https://tools.ietf.org/html/rfc1034">https://tools.ietf.org/html/rfc1034</a>
<dt id="biblio-rfc3986">[RFC3986]
Expand Down

0 comments on commit 9f27a36

Please sign in to comment.