Skip to content

Commit 373dbed

Browse files
authored
Percent encode fragments too
Now all components of a URL can be represented using ASCII strings or integers. Tests: web-platform-tests/wpt#4298. Fixes #150.
1 parent 620fa90 commit 373dbed

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

url.bs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -824,11 +824,9 @@ hierarchical form. It is initially the empty list.
824824
null or an <a>ASCII string</a> holding data. It is initially null.
825825

826826
<p>A <a for=/>URL</a>'s <dfn export for=url id=concept-url-fragment>fragment</dfn> is
827-
either null or a string holding data that can be used for further processing on the
827+
either null or an <a>ASCII string</a> holding data that can be used for further processing on the
828828
resource the <a for=/>URL</a>'s other components identify. It is initially null.
829829

830-
<p class="note no-backref">This is not an <a>ASCII string</a> on purpose.
831-
832830
<p id=non-relative-flag>A <a for=/>URL</a> also has an associated
833831
<dfn export for=url>cannot-be-a-base-URL flag</dfn>. It is initially unset.
834832

@@ -1067,8 +1065,7 @@ U+F0000 to U+FFFFD,
10671065
U+100000 to U+10FFFD.
10681066

10691067
<p class=note>Code points higher than U+007F will be converted to
1070-
<a lt="percent-encoded byte">percent-encoded bytes</a> by the <a>URL parser</a>, except for code
1071-
points appearing in <a lt="URL-fragment string">fragments</a>.
1068+
<a lt="percent-encoded byte">percent-encoded bytes</a> by the <a>URL parser</a>.
10721069

10731070
<p class=note>In HTML, when the document encoding is a legacy encoding, code points in the
10741071
<a>URL-query string</a> that are higher than U+007F will be converted to
@@ -1948,14 +1945,8 @@ string <var>input</var>, optionally with a <a>base URL</a> <var>base</var>, opti
19481945
<li><p>If <a>c</a> is "<code>%</code>" and <a>remaining</a> does
19491946
not start with two <a>ASCII hex digits</a>, <a>syntax violation</a>.
19501947

1951-
<li>
1952-
<p>Append <a>c</a> to <var>url</var>'s <a for=url>fragment</a>.
1953-
1954-
<p class="note no-backref">Unfortunately not using
1955-
<a lt="percent encode">percent-encoding</a> is intentional as implementations with
1956-
majority market share exhibit this behavior.
1957-
<!-- Chrome does percent-encoding if the scheme is not a special scheme,
1958-
hopefully that can be aligned since flip-flopping is not great. -->
1948+
<li><p><a>UTF-8 percent encode</a> <a>c</a> using the <a>simple encode set</a> and append the
1949+
result to <var>url</var>'s <a for=url>fragment</a>.
19591950
</ol>
19601951
</dl>
19611952
</dl>

0 commit comments

Comments
 (0)