diff --git a/url.bs b/url.bs index fb371120..3442b610 100644 --- a/url.bs +++ b/url.bs @@ -180,7 +180,7 @@ valid input. User agents, especially conformance checkers, are encouraged to rep IPv6-unclosed

An IPv6 address is missing the closing U+005D (]). -

https://[::1" +

"https://[::1" Yes @@ -3321,6 +3321,8 @@ are encouraged to use an API suitable to their needs, which might not be this on interface URL { constructor(USVString url, optional USVString base); + static boolean canParse(USVString url, optional USVString base); + stringifier attribute USVString href; readonly attribute USVString origin; attribute USVString protocol; @@ -3361,27 +3363,35 @@ interface URL { URL's path. -


- -

The -new URL(url, base) -constructor steps are: +

The API URL parser takes a scalar value string url and an optional +null-or-scalar value string base (default null), and then runs these steps:

  1. Let parsedBase be null.

  2. -

    If base is given, then: +

    If base is non-null:

      -
    1. Let parsedBase be the result of running the basic URL parser on +

    2. Set parsedBase to the result of running the basic URL parser on base. -

    3. If parsedBase is failure, then throw a {{TypeError}}. +

    4. If parsedBase is failure, then return failure.

    -
  3. Let parsedURL be the result of running the basic URL parser on - url with parsedBase. +

  4. Return the result of running the basic URL parser on url with + parsedBase. +

+ +
+ +

The +new URL(url, base) +constructor steps are: + +

    +
  1. Let parsedURL be the result of running the API URL parser on + url with base, if given.

  2. If parsedURL is failure, then throw a {{TypeError}}. @@ -3432,6 +3442,20 @@ var url = new URL("🏳️‍🌈", new URL("https://pride.example/hello-world") url.pathname // "/%F0%9F%8F%B3%EF%B8%8F%E2%80%8D%F0%9F%8C%88" +


    + +

    The static canParse(url, base) +method steps are: + +

      +
    1. Let parsedURL be the result of running the API URL parser on + url with base, if given. + +

    2. If parsedURL is failure, then return false. + +

    3. Return true. +

    +

    The href getter steps and the @@ -3950,6 +3974,7 @@ Gavin Carothers, Geoff Richards, Glenn Maynard, Gordon P. Hemsley, +hemanth, Henri Sivonen, Ian Hickson, Ilya Grigorik,