diff --git a/url.bs b/url.bs index 7d6ed2dd..1f4af568 100644 --- a/url.bs +++ b/url.bs @@ -1742,81 +1742,70 @@ string input, optionally with a base URL base, opti
file state
-

Set url's scheme to "file", - and then, switching on c: +

    +
  1. Set url's scheme to "file". -

    -
    EOF code point -

    If base is non-null and base's - scheme is "file", set - url's host to - base's host, - url's path to - base's path, and - url's query to - base's query. +

  2. +

    If c is "/" or "\", then: -

    "/" -
    "\" -
    1. If c is "\", syntax violation.

    2. Set state to file slash state.

    -
    "?" -

    If base is non-null and base's - scheme is "file", set - url's host to - base's host, - url's path to - base's path, - url's query to the empty string, - and state to query state. +

  3. +

    Otherwise, if base is non-null and base's scheme is + "file", switch on c: + +

    +
    EOF code point +

    Set url's host to base's host, + url's path to base's path, and + url's query to base's query. + +

    "?" +

    Set url's host to base's host, + url's path to base's path, + url's query to the empty string, and state to + query state. + +

    "#" +

    Set url's host to base's host, + url's path to base's path, + url's query to base's query, + url's fragment to the empty string, and state to + fragment state. + +

    Otherwise +
    +
      +
    1. +

      If at least one of the following is true -

      "#" -

      If base is non-null and base's - scheme is "file", set - url's host to - base's host, - url's path to - base's path, - url's query to - base's query, - url's fragment to the empty string, - and state to fragment state. +

      -
      Otherwise -
      -
        -
      1. -

        If base is non-null, base's scheme - is "file", and at least one of the following is true - -

        - -

        then set url's host to - base's host, - url's path to - base's path, and then shorten - url's path. +

        then set url's host to base's host, + url's path to base's path, and then + shorten url's path. -

        This is a (platform-independent) Windows drive letter quirk. +

        This is a (platform-independent) Windows drive letter quirk. -

      2. Otherwise, if base is non-null and base's - scheme is "file", syntax violation. +

      3. Otherwise, syntax violation. -

      4. Set state to path state, and decrease pointer - by one. -

      -
    +
  4. Set state to path state, and decrease pointer by one. +

+ + +
  • Otherwise, set state to path state, and decrease pointer by + one. +

    file slash state