@@ -180,7 +180,7 @@ valid input. User agents, especially conformance checkers, are encouraged to rep
180
180
<td> <dfn>IPv6-unclosed</dfn>
181
181
<td>
182
182
<p> An <a for=/>IPv6 address</a> is missing the closing U+005D (]).
183
- <p class=example id=example-ipv6-unclosed"<code> https://[::1</code> "
183
+ <p class=example id=example-ipv6-unclosed> "<code> https://[::1</code> "
184
184
<td class=yes> Yes
185
185
<!-- IPv6 parser -->
186
186
<tr>
@@ -3321,6 +3321,8 @@ are encouraged to use an API suitable to their needs, which might not be this on
3321
3321
interface URL {
3322
3322
constructor(USVString url, optional USVString base);
3323
3323
3324
+ static boolean canParse(USVString url, optional USVString base);
3325
+
3324
3326
stringifier attribute USVString href;
3325
3327
readonly attribute USVString origin;
3326
3328
attribute USVString protocol;
@@ -3361,27 +3363,35 @@ interface URL {
3361
3363
<a for=URL>URL</a> 's <a for=url>path</a> .
3362
3364
</ol>
3363
3365
3364
- <hr>
3365
-
3366
- <p id=constructors> The
3367
- <dfn constructor for=URL lt="URL(url, base)"><code>new URL(<var>url</var>, <var>base</var>)</code></dfn>
3368
- constructor steps are:
3366
+ <p> The <dfn>API URL parser</dfn> takes a <a>scalar value string</a> <var> url</var> and an optional
3367
+ null-or-<a>scalar value string</a> <var> base</var> (default null), and then runs these steps:
3369
3368
3370
3369
<ol>
3371
3370
<li><p> Let <var> parsedBase</var> be null.
3372
3371
3373
3372
<li>
3374
- <p> If <var> base</var> is given, then :
3373
+ <p> If <var> base</var> is non-null :
3375
3374
3376
3375
<ol>
3377
- <li><p> Let <var> parsedBase</var> be the result of running the <a>basic URL parser</a> on
3376
+ <li><p> Set <var> parsedBase</var> to the result of running the <a>basic URL parser</a> on
3378
3377
<var> base</var> .
3379
3378
3380
- <li><p> If <var> parsedBase</var> is failure, then <a>throw</a> a {{TypeError}} .
3379
+ <li><p> If <var> parsedBase</var> is failure, then return failure .
3381
3380
</ol>
3382
3381
3383
- <li><p> Let <var> parsedURL</var> be the result of running the <a>basic URL parser</a> on
3384
- <var> url</var> with <var> parsedBase</var> .
3382
+ <li><p> Return the result of running the <a>basic URL parser</a> on <var> url</var> with
3383
+ <var> parsedBase</var> .
3384
+ </ol>
3385
+
3386
+ <hr>
3387
+
3388
+ <p id=constructors> The
3389
+ <dfn constructor for=URL lt="URL(url, base)"><code>new URL(<var>url</var>, <var>base</var>)</code></dfn>
3390
+ constructor steps are:
3391
+
3392
+ <ol>
3393
+ <li><p> Let <var> parsedURL</var> be the result of running the <a>API URL parser</a> on
3394
+ <var> url</var> with <var> base</var> , if given.
3385
3395
3386
3396
<li><p> If <var> parsedURL</var> is failure, then <a>throw</a> a {{TypeError}} .
3387
3397
@@ -3432,6 +3442,20 @@ var url = new URL("🏳️🌈", new URL("https://pride.example/hello-world")
3432
3442
url.pathname // "/%F0%9F%8F%B3%EF%B8%8F%E2%80%8D%F0%9F%8C%88"</code></pre>
3433
3443
</div>
3434
3444
3445
+ <hr>
3446
+
3447
+ <p> The static <dfn method for=URL><code>canParse(<var>url</var>, <var>base</var>)</code></dfn>
3448
+ method steps are:
3449
+
3450
+ <ol>
3451
+ <li><p> Let <var> parsedURL</var> be the result of running the <a>API URL parser</a> on
3452
+ <var> url</var> with <var> base</var> , if given.
3453
+
3454
+ <li><p> If <var> parsedURL</var> is failure, then return false.
3455
+
3456
+ <li><p> Return true.
3457
+ </ol>
3458
+
3435
3459
<hr id=urlutils-members>
3436
3460
3437
3461
<p> The <dfn attribute for=URL><code>href</code></dfn> getter steps and the
@@ -3950,6 +3974,7 @@ Gavin Carothers,
3950
3974
Geoff Richards,
3951
3975
Glenn Maynard,
3952
3976
Gordon P. Hemsley,
3977
+ hemanth,<!-- GitHub -->
3953
3978
Henri Sivonen,
3954
3979
Ian Hickson,
3955
3980
Ilya Grigorik,
0 commit comments