Skip to content

Commit

Permalink
Do not use percent decode on strings
Browse files Browse the repository at this point in the history
Also stop using "UTF-8 decode without BOM or fail" and instead use "UTF-8 decode without BOM" for fragment identifiers.

Tests: web-platform-tests/wpt#8723.
  • Loading branch information
annevk committed May 23, 2018
1 parent 07ab508 commit ce8404f
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -2565,11 +2565,6 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
decode without BOM</dfn> algorithm which is identical to <span>UTF-8 decode</span> except that
it does not strip one leading UTF-8 Byte Order Mark (BOM)</li>

<li>The <dfn
data-x-href="https://encoding.spec.whatwg.org/#utf-8-decode-without-bom-or-fail">UTF-8 decode
without BOM or fail</dfn> algorithm which is identical to <span>UTF-8 decode without BOM</span>
except that it returns failure upon encountering an error</li>

<li>The <dfn data-x-href="https://encoding.spec.whatwg.org/#encode">encode</dfn> algorithm
which takes a character stream and an encoding and returns a byte stream</li>

Expand Down Expand Up @@ -2674,7 +2669,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
<li><dfn data-x="serialize an integer" data-x-href="https://url.spec.whatwg.org/#serialize-an-integer">serialize an integer</dfn></li>
<li><dfn data-x-href="https://url.spec.whatwg.org/#default-encode-set">Default encode set</dfn></li>
<li><dfn data-x-href="https://url.spec.whatwg.org/#utf-8-percent-encode">UTF-8 percent encode</dfn></li>
<li><dfn data-x-href="https://url.spec.whatwg.org/#percent-decode">Percent decode</dfn></li>
<li><dfn data-x-href="https://url.spec.whatwg.org/#string-percent-decode">String percent decode</dfn></li>
<li><dfn data-x-href="https://url.spec.whatwg.org/#set-the-username">set the username</dfn></li>
<li><dfn data-x-href="https://url.spec.whatwg.org/#set-the-password">set the password</dfn></li>
<li>The <dfn data-x-href="https://url.spec.whatwg.org/#concept-urlencoded"><code>application/x-www-form-urlencoded</code></dfn> format</li>
Expand Down Expand Up @@ -81845,8 +81840,8 @@ interface <dfn>Location</dfn> { // but see also <a href="#the-location-interface
<li><p>Remove the leading "<code data-x="">javascript:</code>" string from
<var>urlString</var>.</p></li>

<li><p>Let <var>script source</var> be the result of applying the <span>percent decode</span>
algorithm to <var>urlString</var>.</p></li>
<li><p>Let <var>script source</var> be the result of <span data-x="string percent
decode">string percent decoding</span> <var>urlString</var>.</p></li>

<li><p>Replace <var>script source</var> with the result of applying the <span>UTF-8
decode</span> algorithm to <var>script source</var>.</p></li>
Expand Down Expand Up @@ -82899,11 +82894,11 @@ interface <dfn>Location</dfn> { // but see also <a href="#the-location-interface
non-null, than the return value is <span>the indicated part of the document</span>;
return.</p></li>

<li><p>Let <var>fragmentBytes</var> be the result of <span data-x="percent
decode">percent-decoding</span> <var>fragment</var>.</p></li>
<li><p>Let <var>fragmentBytes</var> be the result of <span data-x="string percent decode">string
percent decoding</span> <var>fragment</var>.</p></li>

<li><p>Let <var>decodedFragment</var> be the result of running <span>UTF-8 decode without BOM or
fail</span> on <var>fragmentBytes</var>.</p></li>
<li><p>Let <var>decodedFragment</var> be the result of running <span>UTF-8 decode without
BOM</span> on <var>fragmentBytes</var>.</p></li>

<li><p>If <span>find a potential indicated element</span> with <var>decodedFragment</var> returns
non-null, than the return value is <span>the indicated part of the document</span>;
Expand Down

0 comments on commit ce8404f

Please sign in to comment.