@@ -2920,17 +2920,26 @@ and then runs these steps:
2920
2920
to the empty string and <var> state</var> to <a>fragment state</a> .
2921
2921
2922
2922
<li>
2923
- <p> Otherwise:
2923
+ <p> Otherwise, if <a>c</a> is U+0020 SPACE:
2924
+
2925
+ <ol>
2926
+ <li><p> If <a>remaining</a> starts with U+003F (?) or U+003F (#), then append
2927
+ "<code> %20</code> " to <var> url</var> 's <a for=url>path</a> .
2928
+
2929
+ <li><p> Otherwise, append U+0020 SPACE to <var> url</var> 's <a for=url>path</a> .
2930
+ </ol>
2931
+
2932
+ <li>
2933
+ <p> Otherwise, if <a>c</a> is not the <a>EOF code point</a> :
2924
2934
2925
2935
<ol>
2926
- <li><p> If <a>c</a> is not the <a>EOF code point</a> , not a <a>URL code point </a> , and not
2927
- U+0025 (%), <a>invalid-URL-unit</a> <a>validation error</a> .
2936
+ <li><p> If <a>c</a> is not a <a>URL code point</a> and not U+0025 (%), <a>invalid- URL-unit </a>
2937
+ <a>validation error</a> .
2928
2938
2929
2939
<li><p> If <a>c</a> is U+0025 (%) and <a>remaining</a> does not start with two
2930
2940
<a>ASCII hex digits</a> , <a>invalid-URL-unit</a> <a>validation error</a> .
2931
2941
2932
- <li><p> If <a>c</a> is not the <a>EOF code point</a> ,
2933
- <a for="code point">UTF-8 percent-encode</a> <a>c</a> using the
2942
+ <li><p> <a for="code point">UTF-8 percent-encode</a> <a>c</a> using the
2934
2943
<a>C0 control percent-encode set</a> and append the result to <var> url</var> 's
2935
2944
<a for=url>path</a> .
2936
2945
</ol>
@@ -3437,23 +3446,6 @@ interface URL {
3437
3446
object.
3438
3447
</ul>
3439
3448
3440
- <div algorithm>
3441
- <p> To <dfn>potentially strip trailing spaces from an opaque path</dfn> given a {{URL}} object
3442
- <var> url</var> :
3443
-
3444
- <ol>
3445
- <li><p> If <var> url</var> 's <a for=URL>URL</a> does not have an <a for=url>opaque path</a> , then
3446
- return.
3447
-
3448
- <li><p> If <var> url</var> 's <a for=URL>URL</a>' s <a for=url>fragment</a> is non-null, then return.
3449
-
3450
- <li><p> If <var> url</var> 's <a for=URL>URL</a>' s <a for=url>query</a> is non-null, then return.
3451
-
3452
- <li><p> Remove all trailing U+0020 SPACE <a for=/>code points</a> from <var> url</var> 's
3453
- <a for=URL>URL</a> 's <a for=url>path</a> .
3454
- </ol>
3455
- </div>
3456
-
3457
3449
<div algorithm>
3458
3450
<p> The <dfn>API URL parser</dfn> takes a <a>scalar value string</a> <var> url</var> and an optional
3459
3451
null-or-<a>scalar value string</a> <var> base</var> (default null), and then runs these steps:
@@ -3781,19 +3773,9 @@ one might have assumed the setter to always "reset" both.
3781
3773
<ol>
3782
3774
<li><p> Let <var> url</var> be <a>this</a> 's <a for=URL>URL</a> .
3783
3775
3784
- <li>
3785
- <p> If the given value is the empty string:
3786
-
3787
- <ol>
3788
- <li><p> Set <var> url</var> 's <a for=url>query</a> to null.
3789
-
3790
- <li><p> <a for=list>Empty</a> <a>this</a> 's <a for=URL>query object</a>' s
3791
- <a for=URLSearchParams>list</a> .
3792
-
3793
- <li><p> <a>Potentially strip trailing spaces from an opaque path</a> with <a>this</a> .
3794
-
3795
- <li><p> Return.
3796
- </ol>
3776
+ <li><p> If the given value is the empty string, then set <var> url</var> 's <a for=url>query</a> to
3777
+ null, <a for=list>empty</a> <a>this</a> 's <a for=URL>query object</a>' s
3778
+ <a for=URLSearchParams>list</a> , and return.
3797
3779
3798
3780
<li><p> Let <var> input</var> be the given value with a single leading U+003F (?) removed, if any.
3799
3781
@@ -3806,11 +3788,6 @@ one might have assumed the setter to always "reset" both.
3806
3788
<li><p> Set <a>this</a> 's <a for=URL>query object</a>' s <a for=URLSearchParams>list</a> to the
3807
3789
result of <a lt="urlencoded string parser">parsing</a> <var> input</var> .
3808
3790
</ol>
3809
-
3810
- <p class=note> The {{URL/search}} setter has the potential to remove trailing U+0020 SPACE
3811
- <a for=/>code points</a> from <a>this</a> 's <a for=URL>URL</a>' s <a for=url>path</a> . It does this
3812
- so that running the <a>URL parser</a> on the output of running the <a>URL serializer</a> on
3813
- <a>this</a> 's <a for=URL>URL</a> does not yield a <a for=/>URL</a> that is not <a for=url>equal</a> .
3814
3791
</div>
3815
3792
3816
3793
<div algorithm>
@@ -3833,16 +3810,8 @@ so that running the <a>URL parser</a> on the output of running the <a>URL serial
3833
3810
<p> The <code> <a attribute for=URL>hash</a> </code> setter steps are:
3834
3811
3835
3812
<ol>
3836
- <li>
3837
- <p> If the given value is the empty string:
3838
-
3839
- <ol>
3840
- <li><p> Set <a>this</a> 's <a for=URL>URL</a>' s <a for=url>fragment</a> to null.
3841
-
3842
- <li><p> <a>Potentially strip trailing spaces from an opaque path</a> with <a>this</a> .
3843
-
3844
- <li><p> Return.
3845
- </ol>
3813
+ <li><p> If the given value is the empty string, then set <a>this</a> 's <a for=URL>URL</a>' s
3814
+ <a for=url>fragment</a> to null and return.
3846
3815
3847
3816
<li><p> Let <var> input</var> be the given value with a single leading U+0023 (#) removed, if any.
3848
3817
@@ -3852,9 +3821,6 @@ so that running the <a>URL parser</a> on the output of running the <a>URL serial
3852
3821
<a for=URL>URL</a> as <a for="basic URL parser"><i>url</i></a> and <a>fragment state</a> as
3853
3822
<a for="basic URL parser"><i>state override</i></a> .
3854
3823
</ol>
3855
-
3856
- <p class=note> The {{URL/hash}} setter has the potential to change <a>this</a> 's <a for=URL>URL</a>' s
3857
- <a for=url>path</a> in a manner equivalent to the {{URL/search}} setter.
3858
3824
</div>
3859
3825
3860
3826
@@ -3925,10 +3891,6 @@ console.log(url.searchParams.get('b')); // "~"</code></pre>
3925
3891
a {{URL}} object, initially null.
3926
3892
</ul>
3927
3893
3928
- <p class=note> A {{URLSearchParams}} object with a non-null <a for=URLSearchParams>URL object</a> has
3929
- the potential to change that object's <a for=url>path</a> in a manner equivalent to the {{URL}}
3930
- object's {{URL/search}} and {{URL/hash}} setters.
3931
-
3932
3894
<div algorithm>
3933
3895
<p> To <dfn for=URLSearchParams oldids=concept-urlsearchparams-new>initialize</dfn> a
3934
3896
{{URLSearchParams}} object <var> query</var> with <var> init</var> :
@@ -3977,10 +3939,6 @@ object <var>query</var>:
3977
3939
3978
3940
<li><p> Set <var> query</var> 's <a for=URLSearchParams>URL object</a>' s <a for=URL>URL</a> 's
3979
3941
<a for=url>query</a> to <var> serializedQuery</var> .
3980
-
3981
- <li><p> If <var> serializedQuery</var> is null, then
3982
- <a>potentially strip trailing spaces from an opaque path</a> with <var> query</var> 's
3983
- <a for=URLSearchParams>URL object</a> .
3984
3942
</ol>
3985
3943
</div>
3986
3944
0 commit comments