Merge WHATWG change: Define URL parsing using URL spec and define user/password arguments via the URL.
authorJungkee Song <jungkee.song@samsung.com>
Thu, 09 May 2013 19:13:20 +0900
changeset 111 bde4bd513986
parent 110 8ba78ffdc0db
child 112 57775139b1b5
Merge WHATWG change: Define URL parsing using URL spec and define user/password arguments via the URL.
Overview.html
Overview.src.html
data/xrefs/dom/xhr.json
data/xrefs/network/url.json
--- a/Overview.html	Sat Feb 16 10:30:48 2013 -0500
+++ b/Overview.html	Thu May 09 19:13:20 2013 +0900
@@ -42,13 +42,13 @@
   <div class="head">
 
 <!--begin-logo-->
-<p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72"></a></p>
+<p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="https://www.w3.org/Icons/w3c_home" width="72"></a></p>
 <!--end-logo-->
 
 
    <h1 class="head" id="xmlhttprequest-ls">XMLHttpRequest</h1>
 
-   <h2 class="no-num no-toc" id="w3c-doctype">Editor's Draft 3 December 2012</h2>
+   <h2 class="no-num no-toc" id="w3c-doctype">Editor's Draft 9 May 2013</h2>
 
    <dl>
     <dt>This Version:</dt>
@@ -99,7 +99,7 @@
 <p class="now3c copyright"><a rel=license href="http://creativecommons.org/publicdomain/zero/1.0/"><img src="http://i.creativecommons.org/p/zero/1.0/80x15.png" alt=CC0></a>
 To the extent possible under law, the editor has waived all copyright and
 related or neighboring rights to this work. In addition, as of
-3 December 2012, the editor has made this specification available
+9 May 2013, the editor has made this specification available
 under the
 <a rel=license
 href="http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0">Open Web Foundation Agreement Version 1.0</a>,
@@ -109,7 +109,7 @@
 
 <div class="w3conly">
 <!--begin-copyright-->
-<p class="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> &copy; 2012 <a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>&reg;</sup> (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="http://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.</p>
+<p class="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> &copy; 2013 <a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>&reg;</sup> (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="http://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href="http://www.keio.ac.jp/">Keio</a>, <a href="http://ev.buaa.edu.cn/">Beihang</a>), All Rights Reserved. W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.</p>
 <!--end-copyright--></div>
 
   </div>
@@ -141,7 +141,7 @@
    available in the WHATWG <a href="http://xhr.spec.whatwg.org/">XMLHttpRequest Living Standard</a>, under a license that permits reuse of the specification text.</p>
 
   <p>The W3C <a href="http://www.w3.org/2008/webapps/">Web Applications Working
-  Group</a> is the W3C working group responsible for this specification's progress along the W3C Recommendation track. This specification is the 3 December 2012 Editor's Draft.</p>
+  Group</a> is the W3C working group responsible for this specification's progress along the W3C Recommendation track. This specification is the 9 May 2013 Editor's Draft.</p>
   
   <p>Publication as an Editor's Draft does not imply endorsement by the W3C
   Membership. This is a draft document and may be updated, replaced or
@@ -380,6 +380,11 @@
    <code class="external"><a href="http://www.khronos.org/registry/typedarray/specs/latest/#ARRAYBUFFERVIEW">ArrayBufferView</a></code> objects.
    <a href="#refsTYPEDARRAY">[TYPEDARRAY]</a>
 
+   <dt>URL</dt>
+   <dd><p>A <span>conforming user agent</span> must
+   support the URL parsing algorithm of the URL
+   specification. <a href="#refsURL">[URL]</a></dd>
+
    <dt>Web IDL</dt>
    <dd><p>A <span>conforming user agent</span> must also
    be a conforming implementation of the IDL fragments in this
@@ -695,8 +700,6 @@
 
 <dfn id="request-method">request method</dfn>,
 <dfn id="request-url">request URL</dfn>,
-<dfn id="request-username">request username</dfn>,
-<dfn id="request-password">request password</dfn>,
 <dfn id="author-request-headers">author request headers</dfn>,
 <dfn id="request-entity-body">request entity body</dfn>,
 <dfn id="source-origin">source origin</dfn>,
@@ -725,18 +728,15 @@
    <var title="">password</var> = null]]])</code>
 
    <dd>
-    <p>Sets the <a href="#request-method">request method</a>, <a href="#request-url">request URL</a>,
-    <a href="#synchronous-flag">synchronous flag</a>, <a href="#request-username">request username</a>, and
-    <a href="#request-password">request password</a>.</p>
+    <p>Sets the <a href="#request-method">request method</a>, <a href="#request-url">request URL</a>, and
+    <a href="#synchronous-flag">synchronous flag</a>.</p>
 
     <p>Throws a "<code class="external"><a href="http://dev.w3.org/2006/webapi/DOM4Core/#syntaxerror">SyntaxError</a></code>" exception if
     one of the following is true:</p>
 
     <ul>
      <li><var title="">method</var> is not a valid HTTP method.</li>
-     <li><var title="">url</var> cannot be resolved.</li>
-     <li><var title="">url</var> contains the <code>"user:password"</code>
-     format in the <code class="external"><a href="http://tools.ietf.org/html/rfc2616/#section-3.2.1">userinfo</a></code> production.
+     <li><var title="">url</var> cannot be parsed.</li>
     </ul>
 
     <p>Throws a "<code class="external"><a href="http://dev.w3.org/2006/webapi/DOM4Core/#securityerror">SecurityError</a></code>" exception
@@ -836,43 +836,15 @@
     <a href="#refsHTTPVERBSEC">[HTTPVERBSEC]</a>
    </li>
 
-   <li><p>Let <var title="">url</var> be a
-   <a class="external" href="http://dev.w3.org/html5/spec/urls.html#url">URL</a> with character encoding UTF-8.
-
-   <li><p><a class="external" href="http://dev.w3.org/html5/spec/urls.html#resolve-a-url" title="Resolve a URL">Resolve</a>
-   <var title="">url</var> relative to <var title="">base</var>. If the algorithm
-   returns an error,
+   <li><p>Let <var title="">parsed URL</var> be the result of
+   <a class="external" href="http://url.spec.whatwg.org/#concept-url-parser" title="concept-url-parser">parsing</a>
+   <var title="">url</var> with <var title="">base</var>.
+
+   <li><p>If <var title="">parsed URL</var> is failure,
    <a class="external" href="http://dev.w3.org/2006/webapi/DOM4Core/#concept-throw" title="concept-throw">throw</a> a
    "<code class="external"><a href="http://dev.w3.org/2006/webapi/DOM4Core/#syntaxerror">SyntaxError</a></code>" exception and terminate
    these steps.
 
-   <!-- Presto and Gecko override the encoding. WebKit does not. Trident
-   does not support non-ASCII URLs. This matters for the <query> component,
-   see HTML. -->
-
-   <li><p>Drop
-   <code class="external" title="url-fragment"><a href="http://dev.w3.org/html5/spec/urls.html#url-fragment">&lt;fragment&gt;</a></code> from
-   <var title="">url</var>.</li>
-
-   <li><p>If the <code>"user:password"</code> format in the
-   <code class="external"><a href="http://tools.ietf.org/html/rfc2616/#section-3.2.1">userinfo</a></code> production is not supported
-   for the relevant
-   <code class="external" title="url-scheme"><a href="http://dev.w3.org/html5/spec/urls.html#url-scheme">&lt;scheme&gt;</a></code> and
-   <var title="">url</var> contains this format,
-   <a class="external" href="http://dev.w3.org/2006/webapi/DOM4Core/#concept-throw" title="concept-throw">throw</a> a
-   "<code class="external"><a href="http://dev.w3.org/2006/webapi/DOM4Core/#syntaxerror">SyntaxError</a></code>" and terminate these
-   steps.
-
-   <!-- XXX need to throw here for "user:password" or just "user" for
-            cross-origin unless we solve this in another way -->
-
-   <li><p>If <var title="">url</var> contains the <code>"user:password"</code>
-   format let <var>temp user</var> be the user part and
-   <var>temp password</var> be the password part.</li>
-
-   <li><p>If <var title="">url</var> just contains the <code>"user"</code>
-   format let <var>temp user</var> be the user part.</li>
-
    <li><p>If <var>async</var> is false, the
    <a class="external" href="http://dev.w3.org/html5/spec/infrastructure.html#javascript-global-environment">JavaScript global environment</a> is a
    <a class="external" href="http://dev.w3.org/html5/spec/webappapis.html#document-environment">document environment</a>, and either the
@@ -887,12 +859,24 @@
    "<code class="external"><a href="http://dev.w3.org/2006/webapi/DOM4Core/#invalidaccesserror">InvalidAccessError</a></code>" exception and
    terminate these steps.
 
-   <li><p>If the <var title="">user</var> argument is not null, set
-   <var>temp user</var> to <var>user</var>.
-
-   <li><p>If the <var title="">password</var> argument is not null, set
-   <var>temp password</var> to <var>password</var>.
-   
+   <li>
+    <p>If <var title="">parsed URL</var>'s
+    <a class="external" href="http://url.spec.whatwg.org/#relative-flag">relative flag</a> is set, run these
+    substeps:
+
+    <ol>
+     <li><p>If the <var title="">user</var> argument is not null, set
+     <var title="">parsed URL</var>'s
+     <a class="external" href="http://url.spec.whatwg.org/#concept-url-username" title="concept-url-username">username</a>
+     to <var>user</var>.
+
+     <li><p>If the <var title="">password</var> argument is not null, set
+     <var title="">parsed URL</var>'s
+     <a class="external" href="http://url.spec.whatwg.org/#concept-url-password" title="concept-url-password">password</a>
+     to
+     <var>password</var>.
+    </ol>
+
    <li><p><a href="#terminate-abort()" title="terminate abort()">Terminate the <code>abort()</code> algorithm</a>.</li>
 
    <li><p><a href="#terminate-send()" title="terminate send()">Terminate the <code>send()</code> algorithm</a>.</li>
@@ -914,15 +898,11 @@
 
      <li><p>Set <a href="#request-method">request method</a> to <var>method</var>.
 
-     <li><p>Set <a href="#request-url">request URL</a> to <var title="">url</var>.
+     <li><p>Set <a href="#request-url">request URL</a> to <var title="">parsed URL</var>.
 
      <li><p>If <var>async</var> is false, set the
      <a href="#synchronous-flag">synchronous flag</a>.
 
-     <li><p>Set <a href="#request-username">request username</a> to <var>temp user</var>.
-
-     <li><p>Set <a href="#request-password">request password</a> to <var>temp password</var>.
-
      <li><p>Set <a href="#author-request-headers">author request headers</a> to the empty list.
 
      <li><p>Unset the <a href="#send-flag"><code>send()</code> flag</a>.
@@ -1426,10 +1406,9 @@
       <i title="">override referer source</i>, with the
       <i title="">synchronous flag</i> set if the
       <a href="#synchronous-flag">synchronous flag</a> is set, using HTTP method
-      <a href="#request-method">request method</a>, user <a href="#request-username">request username</a> (if
-      non-null) and password <a href="#request-password">request password</a> (if non-null),
-      taking into account the <a href="#request-entity-body">request entity body</a>, list of
-      <a href="#author-request-headers">author request headers</a> and the rules listed at the end of
+      <a href="#request-method">request method</a>, taking into account the
+      <a href="#request-entity-body">request entity body</a>, list of
+      <a href="#author-request-headers">author request headers</a>, and the rules listed at the end of
       this section.</p>
 
       <dl class="switch">
@@ -1561,9 +1540,12 @@
   <a href="#source-origin">source origin</a> and the
   <a href="#request-url">request URL</a> are <a class="external" href="http://dev.w3.org/html5/spec/browsers.html#same-origin">same origin</a>,
   <code title="http-authorization">Authorization</code> is not in the list
-  of <a href="#author-request-headers">author request headers</a>, <a href="#request-username">request username</a> is
-  null, and <a href="#request-password">request password</a> is null, user agents
-  should prompt the end user for their username and
+  of <a href="#author-request-headers">author request headers</a>,
+  <a href="#request-url">request URL</a>'s
+  <a class="external" href="http://url.spec.whatwg.org/#concept-url-username" title="concept-url-username">username</a> is
+  the empty string and <a href="#request-url">request URL</a>'s
+  <a class="external" href="http://url.spec.whatwg.org/#concept-url-password" title="concept-url-password">password</a> is
+  null, user agents should prompt the end user for their username and
   password.</p>
 
   <p>Otherwise, if authentication fails, user agents
@@ -2909,6 +2891,9 @@
 <dt id="refsTYPEDARRAY">[TYPEDARRAY]
 <dd><cite><a href="http://www.khronos.org/registry/typedarray/specs/latest/">Typed Array</a></cite>, David Herman and Kenneth Russell. Khronos.
 
+<dt id="refsURL">[URL]
+<dd><cite><a href="http://url.spec.whatwg.org/">URL Standard</a></cite>, Anne van Kesteren. WHATWG.
+
 <dt id="refsWEBIDL">[WEBIDL]
 <dd><cite><a href="http://www.w3.org/TR/WebIDL/">Web IDL</a></cite>, Cameron McCormack. W3C.
 
--- a/Overview.src.html	Sat Feb 16 10:30:48 2013 -0500
+++ b/Overview.src.html	Thu May 09 19:13:20 2013 +0900
@@ -389,6 +389,11 @@
    <code data-anolis-spec=typedarray>ArrayBufferView</code> objects.
    <span data-anolis-ref>TYPEDARRAY</span>
 
+   <dt>URL</dt>
+   <dd><p>A <span>conforming user agent</span> must
+   support the URL parsing algorithm of the URL
+   specification. <span data-anolis-ref>URL</span></p></dd>
+
    <dt>Web IDL</dt>
    <dd><p>A <span>conforming user agent</span> must also
    be a conforming implementation of the IDL fragments in this
@@ -704,8 +709,6 @@
 
 <dfn>request method</dfn>,
 <dfn>request URL</dfn>,
-<dfn>request username</dfn>,
-<dfn>request password</dfn>,
 <dfn id="author-request-headers">author request headers</dfn>,
 <dfn>request entity body</dfn>,
 <dfn>source origin</dfn>,
@@ -734,18 +737,15 @@
    <var title>password</var> = null]]])</code>
 
    <dd>
-    <p>Sets the <span>request method</span>, <span>request URL</span>,
-    <span>synchronous flag</span>, <span>request username</span>, and
-    <span>request password</span>.</p>
+    <p>Sets the <span>request method</span>, <span>request URL</span>, and
+    <span>synchronous flag</span>.</p>
 
     <p>Throws a "<code data-anolis-spec=dom>SyntaxError</code>" exception if
     one of the following is true:</p>
 
     <ul>
      <li><var title>method</var> is not a valid HTTP method.</li>
-     <li><var title>url</var> cannot be resolved.</li>
-     <li><var title>url</var> contains the <code>"user:password"</code>
-     format in the <code data-anolis-spec=uri>userinfo</code> production.
+     <li><var title>url</var> cannot be parsed.</li>
     </ul>
 
     <p>Throws a "<code data-anolis-spec=dom>SecurityError</code>" exception
@@ -845,43 +845,15 @@
     <span data-anolis-ref>HTTPVERBSEC</span>
    </li>
 
-   <li><p>Let <var title>url</var> be a
-   <span data-anolis-spec=html>URL</span> with character encoding UTF-8.
-
-   <li><p><span title="Resolve a URL" data-anolis-spec=html>Resolve</span>
-   <var title>url</var> relative to <var title>base</var>. If the algorithm
-   returns an error,
+   <li><p>Let <var title>parsed URL</var> be the result of
+   <span data-anolis-spec=url title=concept-url-parser>parsing</span>
+   <var title>url</var> with <var title>base</var>.
+
+   <li><p>If <var title>parsed URL</var> is failure,
    <span data-anolis-spec=dom title=concept-throw>throw</span> a
    "<code data-anolis-spec=dom>SyntaxError</code>" exception and terminate
    these steps.
 
-   <!-- Presto and Gecko override the encoding. WebKit does not. Trident
-   does not support non-ASCII URLs. This matters for the <query> component,
-   see HTML. -->
-
-   <li><p>Drop
-   <code data-anolis-spec=html title=url-fragment>&lt;fragment></code> from
-   <var title>url</var>.</p></li>
-
-   <li><p>If the <code>"user:password"</code> format in the
-   <code data-anolis-spec=uri>userinfo</code> production is not supported
-   for the relevant
-   <code data-anolis-spec=html title=url-scheme>&lt;scheme></code> and
-   <var title>url</var> contains this format,
-   <span data-anolis-spec=dom title=concept-throw>throw</span> a
-   "<code data-anolis-spec=dom>SyntaxError</code>" and terminate these
-   steps.
-
-   <!-- XXX need to throw here for "user:password" or just "user" for
-            cross-origin unless we solve this in another way -->
-
-   <li><p>If <var title>url</var> contains the <code>"user:password"</code>
-   format let <var>temp user</var> be the user part and
-   <var>temp password</var> be the password part.</p></li>
-
-   <li><p>If <var title>url</var> just contains the <code>"user"</code>
-   format let <var>temp user</var> be the user part.</p></li>
-
    <li><p>If <var>async</var> is false, the
    <span data-anolis-spec=html>JavaScript global environment</span> is a
    <span data-anolis-spec=html>document environment</span>, and either the
@@ -896,12 +868,24 @@
    "<code data-anolis-spec=dom>InvalidAccessError</code>" exception and
    terminate these steps.
 
-   <li><p>If the <var title>user</var> argument is not null, set
-   <var>temp user</var> to <var>user</var>.
-
-   <li><p>If the <var title>password</var> argument is not null, set
-   <var>temp password</var> to <var>password</var>.
-   
+   <li>
+    <p>If <var title>parsed URL</var>'s
+    <span data-anolis-spec=url>relative flag</span> is set, run these
+    substeps:
+
+    <ol>
+     <li><p>If the <var title>user</var> argument is not null, set
+     <var title>parsed URL</var>'s
+     <span data-anolis-spec=url title=concept-url-username>username</span>
+     to <var>user</var>.
+
+     <li><p>If the <var title>password</var> argument is not null, set
+     <var title>parsed URL</var>'s
+     <span data-anolis-spec=url title=concept-url-password>password</span>
+     to
+     <var>password</var>.
+    </ol>
+
    <li><p><span title="terminate abort()">Terminate the <code>abort()</code> algorithm</span>.</p></li>
 
    <li><p><span title="terminate send()">Terminate the <code>send()</code> algorithm</span>.</p></li>
@@ -923,15 +907,11 @@
 
      <li><p>Set <span>request method</span> to <var>method</var>.
 
-     <li><p>Set <span>request URL</span> to <var title>url</var>.
+     <li><p>Set <span>request URL</span> to <var title>parsed URL</var>.
 
      <li><p>If <var>async</var> is false, set the
      <span>synchronous flag</span>.
 
-     <li><p>Set <span>request username</span> to <var>temp user</var>.
-
-     <li><p>Set <span>request password</span> to <var>temp password</var>.
-
      <li><p>Set <span>author request headers</span> to the empty list.
 
      <li><p>Unset the <span><code>send()</code> flag</span>.
@@ -1435,10 +1415,9 @@
       <i title>override referer source</i>, with the
       <i title>synchronous flag</i> set if the
       <span>synchronous flag</span> is set, using HTTP method
-      <span>request method</span>, user <span>request username</span> (if
-      non-null) and password <span>request password</span> (if non-null),
-      taking into account the <span>request entity body</span>, list of
-      <span>author request headers</span> and the rules listed at the end of
+      <span>request method</span>, taking into account the
+      <span>request entity body</span>, list of
+      <span>author request headers</span>, and the rules listed at the end of
       this section.</p>
 
       <dl class=switch>
@@ -1570,9 +1549,12 @@
   <span>source origin</span> and the
   <span>request URL</span> are <span data-anolis-spec=html>same origin</span>,
   <code title="http-authorization">Authorization</code> is not in the list
-  of <span>author request headers</span>, <span>request username</span> is
-  null, and <span>request password</span> is null, user agents
-  should prompt the end user for their username and
+  of <span>author request headers</span>,
+  <span>request URL</span>'s
+  <span data-anolis-spec=url title=concept-url-username>username</span> is
+  the empty string and <span>request URL</span>'s
+  <span data-anolis-spec=url title=concept-url-password>password</span> is
+  null, user agents should prompt the end user for their username and
   password.</p>
 
   <p>Otherwise, if authentication fails, user agents
--- a/data/xrefs/dom/xhr.json	Sat Feb 16 10:30:48 2013 -0500
+++ b/data/xrefs/dom/xhr.json	Thu May 09 19:13:20 2013 +0900
@@ -64,9 +64,7 @@
     "request entity body": "request-entity-body",
     "request error": "request-error",
     "request method": "request-method",
-    "request password": "request-password",
     "request url": "request-url",
-    "request username": "request-username",
     "response charset": "response-charset",
     "response entity body": "response-entity-body",
     "response mime type": "response-mime-type",
--- a/data/xrefs/network/url.json	Sat Feb 16 10:30:48 2013 -0500
+++ b/data/xrefs/network/url.json	Thu May 09 19:13:20 2013 +0900
@@ -8,12 +8,15 @@
     "concept-url-input": "concept-url-input",
     "concept-url-interpret": "concept-url-interpret",
     "concept-url-parse": "concept-url-parse",
+    "concept-url-parser": "concept-url-parser",
+    "concept-url-password": "concept-url-password",
     "concept-url-path": "concept-url-path",
     "concept-url-port": "concept-url-port",
     "concept-url-query": "concept-url-query",
     "concept-url-query-encoding": "concept-url-query-encoding",
     "concept-url-scheme": "concept-url-scheme",
     "concept-url-userinfo": "concept-url-userinfo",
+    "concept-url-username": "concept-url-username",
     "dom-url": "dom-url",
     "dom-url-hash": "dom-url-hash",
     "dom-url-host": "dom-url-host",
@@ -32,6 +35,7 @@
     "invalidate": "invalidate",
     "percent escaped": "percent-escaped",
     "query percent escaped": "query-percent-escaped",
+    "relative flag": "relative-flag",
     "url": "url",
     "urlutils": "urlutils"
   },