Skip to content

Commit

Permalink
Use the API URL character encoding for XMLHttpRequest
Browse files Browse the repository at this point in the history
Unfortunately forcing UTF-8 is not web compatible.

This also cleans up some other steps in the open() method in the process.

Tests: https://hg.mozilla.org/releases/mozilla-beta/rev/fd6134823ff9.

Fixes #159.
  • Loading branch information
annevk committed Dec 4, 2017
1 parent 900f013 commit 6ee39d9
Showing 1 changed file with 22 additions and 31 deletions.
53 changes: 22 additions & 31 deletions xhr.bs
Expand Up @@ -446,33 +446,25 @@ and
methods, when invoked, must run these steps:

<ol>
<li><p>If <a>context object</a>'s
<a>relevant settings object</a> has a
<a>responsible document</a> and it is <em>not</em>
<a>fully active</a>,
<a>throw</a> an <code>InvalidStateError</code> exception.

<li><p>If <var>method</var> is not a
<a for=/>method</a>,
<a>throw</a> a
<code>SyntaxError</code> exception.

<li><p>If <var>method</var> is a <a>forbidden method</a>,
<a>throw</a> a
<code>SecurityError</code> exception.

<li><p><a for=method>Normalize</a>
<var>method</var>.

<li><p>Let <var>parsedURL</var> be the result of
<a lt="URL parser">parsing</a> <var>url</var> with
<a>context object</a>'s
<a>relevant settings object</a>'s
<a>API base URL</a>.
<li><p>Let <var>settingsObject</var> be <a>context object</a>'s <a>relevant settings object</a>.

<li><p>If <var>settingsObject</var> has a <a>responsible document</a> and it is <em>not</em>
<a>fully active</a>, then <a>throw</a> an "{{InvalidStateError!!exception}}" {{DOMException}}.

<li><p>If <var>method</var> is not a <a for=/>method</a>, then <a>throw</a> a
"{{SyntaxError!!exception}}" {{DOMException}}.

<li><p>If <var>parsedURL</var> is failure,
<a>throw</a> a
<code>SyntaxError</code> exception.
<li><p>If <var>method</var> is a <a>forbidden method</a>, then <a>throw</a> a
"{{SecurityError!!exception}}" {{DOMException}}.

<li><p><a for=method>Normalize</a> <var>method</var>.

<li><p>Let <var>parsedURL</var> be the result of <a lt="URL parser">parsing</a> <var>url</var> with
<var>settingsObject</var>'s <a for="environment settings object">API base URL</a> and
<var>settingsObject</var>'s <a for="environment settings object">API URL character encoding</a>.

<li><p>If <var>parsedURL</var> is failure, then <a>throw</a> a "{{SyntaxError!!exception}}"
{{DOMException}}.

<li>
<p>If the <var>async</var> argument is omitted, set <var>async</var> to true, and set
Expand All @@ -495,11 +487,10 @@ methods, when invoked, must run these steps:
<var>password</var>.
</ol>

<li><p>If <var>async</var> is false, <a>current global object</a> is a {{Window}}
object, and the {{XMLHttpRequest/timeout!!attribute}} attribute value is not zero
or the {{XMLHttpRequest/responseType}} attribute value is not the
empty string, then <a>throw</a> an
<code>InvalidAccessError</code> exception.
<li><p>If <var>async</var> is false, <a>current global object</a> is a {{Window}} object, and the
{{XMLHttpRequest/timeout!!attribute}} attribute value is not zero or the
{{XMLHttpRequest/responseType}} attribute value is not the empty string, then <a>throw</a> an
"{{InvalidAccessError!!exception}}" {{DOMException}}.

<li>
<p><a for=fetch lt=terminated>Terminate</a> the ongoing fetch operated by the
Expand Down

0 comments on commit 6ee39d9

Please sign in to comment.