Skip to content

Commit

Permalink
Clean up set the input algorithm now all URLs have a query
Browse files Browse the repository at this point in the history
  • Loading branch information
annevk committed Oct 16, 2014
1 parent f142cb3 commit 217cf06
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 42 deletions.
37 changes: 16 additions & 21 deletions url.html
Expand Up @@ -9,7 +9,7 @@

<hgroup>
<h1 class="allcaps">URL</h1>
<h2>Living Standard — Last Updated 14 October 2014</h2>
<h2>Living Standard — Last Updated 16 October 2014</h2>
</hgroup>

<dl>
Expand Down Expand Up @@ -2130,26 +2130,21 @@ <h2 id="api"><span class="secno">7 </span>API</h2>
<li><p>If <var title="">url</var> is not failure, set
<a href="#concept-urlutils-url" title="concept-URLUtils-url">url</a> to <var title="">url</var>.

<li>
<p>If <a href="#concept-urlutils-url" title="concept-URLUtils-url">url</a> is non-null and its
<a href="#relative-flag">relative flag</a> is set, run these substeps:
<li><p>Let <var title="">query</var> be <a href="#concept-urlutils-url" title="concept-URLUtils-url">url</a>'s
<a href="#concept-url-query" title="concept-URL-query">query</a> if <a href="#concept-urlutils-url" title="concept-URLUtils-url">url</a>
is non-null, and the empty string otherwise.

<ol>
<li><p>If <a href="#concept-urlutils-query-object" title="concept-URLUtils-query-object">query object</a> is null, set
<a href="#concept-urlutils-query-object" title="concept-URLUtils-query-object">query object</a> to a
<a href="#concept-urlsearchparams-new" title="concept-URLSearchParams-new">new <code>URLSearchParams</code> object</a> using
<a href="#concept-urlutils-url" title="concept-URLUtils-url">url</a>'s <a href="#concept-url-query" title="concept-URL-query">query</a>.

<li><p>Otherwise, set <a href="#concept-urlutils-query-object" title="concept-URLUtils-query-object">query object</a>'s
<a href="#concept-urlsearchparams-list" title="concept-URLSearchParams-list">list</a> to the result of
<a href="#concept-urlencoded-string-parser" title="concept-urlencoded-string-parser">parsing</a>
<a href="#concept-urlutils-url" title="concept-URLUtils-url">url</a>'s <a href="#concept-url-query" title="concept-URL-query">query</a>.
</ol>
<li><p>If <a href="#concept-urlutils-query-object" title="concept-URLUtils-query-object">query object</a> is null, set
<a href="#concept-urlutils-query-object" title="concept-URLUtils-query-object">query object</a> to a
<a href="#concept-urlsearchparams-new" title="concept-URLSearchParams-new">new <code>URLSearchParams</code> object</a>
using <var title="">query</var>, and then append the
<a class="external" data-anolis-spec="dom" href="https://dom.spec.whatwg.org/#context-object">context object</a> to
<a href="#concept-urlutils-query-object" title="concept-URLUtils-query-object">query object</a>'s list of
<a href="#concept-urlsearchparams-url-object" title="concept-URLSearchParams-url-object">url objects</a>.

<li><p>If <a href="#concept-urlutils-url" title="concept-URLUtils-url">url</a> is null and
<a href="#concept-urlutils-query-object" title="concept-URLUtils-query-object">query object</a> is non-null, empty
<a href="#concept-urlutils-query-object" title="concept-URLUtils-query-object">query object</a>'s
<a href="#concept-urlsearchparams-list" title="concept-URLSearchParams-list">list</a>.
<li><p>Otherwise, set <a href="#concept-urlutils-query-object" title="concept-URLUtils-query-object">query object</a>'s
<a href="#concept-urlsearchparams-list" title="concept-URLSearchParams-list">list</a> to the result of
<a href="#concept-urlencoded-string-parser" title="concept-urlencoded-string-parser">parsing</a> <var title="">query</var>.
</ol>

<p>To run the <dfn id="pre-update-steps">pre-update steps</dfn> for an object implementing
Expand Down Expand Up @@ -2559,11 +2554,11 @@ <h3 id="urlutils-and-urlutilsreadonly-members"><span class="secno">7.3 </span><a
<li><p>Let <var title="">object</var> be the given value.

<li><p>Remove the <a class="external" data-anolis-spec="dom" href="https://dom.spec.whatwg.org/#context-object">context object</a> from
<a href="#concept-urlutils-query-object" title="concept-URLUtils-query-object">query object</a>'s associated list of
<a href="#concept-urlutils-query-object" title="concept-URLUtils-query-object">query object</a>'s list of
<a href="#concept-urlsearchparams-url-object" title="concept-URLSearchParams-url-object">url objects</a>.

<li><p>Append the <a class="external" data-anolis-spec="dom" href="https://dom.spec.whatwg.org/#context-object">context object</a> to
<var title="">object</var>'s associated list of
<var title="">object</var>'s list of
<a href="#concept-urlsearchparams-url-object" title="concept-URLSearchParams-url-object">url objects</a>.

<li><p>Set <a href="#concept-urlutils-query-object" title="concept-URLUtils-query-object">query object</a> to
Expand Down
37 changes: 16 additions & 21 deletions url.src.html
Expand Up @@ -2097,26 +2097,21 @@ <h2>API</h2>
<li><p>If <var title>url</var> is not failure, set
<span title=concept-URLUtils-url>url</span> to <var title>url</var>.

<li>
<p>If <span title=concept-URLUtils-url>url</span> is non-null and its
<span>relative flag</span> is set, run these substeps:

<ol>
<li><p>If <span title=concept-URLUtils-query-object>query object</span> is null, set
<span title=concept-URLUtils-query-object>query object</span> to a
<span title=concept-URLSearchParams-new>new <code>URLSearchParams</code> object</span> using
<span title=concept-URLUtils-url>url</span>'s <span title=concept-URL-query>query</span>.

<li><p>Otherwise, set <span title=concept-URLUtils-query-object>query object</span>'s
<span title=concept-URLSearchParams-list>list</span> to the result of
<span title=concept-urlencoded-string-parser>parsing</span>
<span title=concept-URLUtils-url>url</span>'s <span title=concept-URL-query>query</span>.
</ol>
<li><p>Let <var title>query</var> be <span title=concept-URLUtils-url>url</span>'s
<span title=concept-URL-query>query</span> if <span title=concept-URLUtils-url>url</span>
is non-null, and the empty string otherwise.

<li><p>If <span title=concept-URLUtils-query-object>query object</span> is null, set
<span title=concept-URLUtils-query-object>query object</span> to a
<span title=concept-URLSearchParams-new>new <code>URLSearchParams</code> object</span>
using <var title>query</var>, and then append the
<span data-anolis-spec=dom>context object</span> to
<span title=concept-URLUtils-query-object>query object</span>'s list of
<span title=concept-URLSearchParams-url-object>url objects</span>.

<li><p>If <span title=concept-URLUtils-url>url</span> is null and
<span title=concept-URLUtils-query-object>query object</span> is non-null, empty
<span title=concept-URLUtils-query-object>query object</span>'s
<span title=concept-URLSearchParams-list>list</span>.
<li><p>Otherwise, set <span title=concept-URLUtils-query-object>query object</span>'s
<span title=concept-URLSearchParams-list>list</span> to the result of
<span title=concept-urlencoded-string-parser>parsing</span> <var title>query</var>.
</ol>

<p>To run the <dfn>pre-update steps</dfn> for an object implementing
Expand Down Expand Up @@ -2526,11 +2521,11 @@ <h3><code>URLUtils</code> and <code>URLUtilsReadOnly</code> members</h3>
<li><p>Let <var title>object</var> be the given value.

<li><p>Remove the <span data-anolis-spec=dom>context object</span> from
<span title=concept-URLUtils-query-object>query object</span>'s associated list of
<span title=concept-URLUtils-query-object>query object</span>'s list of
<span title=concept-URLSearchParams-url-object>url objects</span>.

<li><p>Append the <span data-anolis-spec=dom>context object</span> to
<var title>object</var>'s associated list of
<var title>object</var>'s list of
<span title=concept-URLSearchParams-url-object>url objects</span>.

<li><p>Set <span title=concept-URLUtils-query-object>query object</span> to
Expand Down

1 comment on commit 217cf06

@annevk
Copy link
Member Author

@annevk annevk commented on 217cf06 Oct 16, 2014

Choose a reason for hiding this comment

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

Please sign in to comment.