Skip to content
Permalink
Browse files
Do not use percent decode on strings
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 ce8404fa5d8c2c91725c5262fd69d0d45c227ec8
Showing with 7 additions and 12 deletions.
  1. +7 −12 source
19 source
@@ -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>

@@ -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>
@@ -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>
@@ -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>;

0 comments on commit ce8404f

Please sign in to comment.