From 8c8c719e60183c1c79c6b8d07e0d685adde28ec3 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Thu, 29 Dec 2016 11:57:15 +0100 Subject: [PATCH 1/2] Editorial: use the Infra Standard for URL's path Also stop saying "terminate these steps" and simply return. Fixes #235. --- url.bs | 99 ++++++++++++++++++++++++++++------------------------------ 1 file changed, 48 insertions(+), 51 deletions(-) diff --git a/url.bs b/url.bs index c0498f1b..12156b45 100644 --- a/url.bs +++ b/url.bs @@ -864,9 +864,9 @@ It is initially the empty string.

A URL's port is either null or a 16-bit unsigned integer that identifies a networking port. It is initially null. -

A URL's path is a list of zero or more -ASCII strings holding data, usually identifying a location in hierarchical form. It is -initially the empty list. +

A URL's path is a list of zero +or more ASCII strings holding data, usually identifying a location in hierarchical form. It +is initially empty.

A special URL always has a non-empty path. @@ -1204,12 +1204,13 @@ different document encoding. Using the UTF-8 encoding everywhere solves t

  • If url's scheme is not "blob", return url. -

  • If the first string in url's path is not in the - blob URL store, return url. [[!FILEAPI]] +

  • If url's path is empty or url's + path[0] is not in the blob URL store, then return url. + [[!FILEAPI]]

  • Set url's object to a StructuredClone of the - entry in the blob URL store corresponding to the first string in url's - path. [[!HTML]] + entry in the blob URL store corresponding to url's path[0]. + [[!HTML]]

  • Return url. @@ -1357,18 +1358,18 @@ string input, optionally with a base URL base, opti

    If state override is given, run these subsubsteps:

      -
    1. If url's scheme is a - special scheme and buffer is not, terminate this algorithm. +

    2. If url's scheme is a special scheme and + buffer is not, then return. -

    3. If url's scheme is not a - special scheme and buffer is, terminate this algorithm. +

    4. If url's scheme is not a special scheme and + buffer is, then return.

  • Set url's scheme to buffer.

  • Set buffer to the empty string. -

  • If state override is given, terminate this algorithm. +

  • If state override is given, then return.

  • If url's scheme is "file", run these @@ -1396,9 +1397,9 @@ string input, optionally with a base URL base, opti state to path or authority state, and increase pointer by one. -

  • Otherwise, set url's cannot-be-a-base-URL flag, append an - empty string to url's path, and set state to - cannot-be-a-base-URL path state. +

  • Otherwise, set url's cannot-be-a-base-URL flag, + append an empty string to url's path, and set + state to cannot-be-a-base-URL path state.

  • Otherwise, if state override is not given, set @@ -1527,8 +1528,8 @@ string input, optionally with a base URL base, opti url's port to base's port, url's path to - base's path, and then remove - url's path's last entry, if any. + base's path, and then remove + url's path's last item, if any.

  • Set state to path state, and decrease pointer by one. @@ -1664,8 +1665,7 @@ string input, optionally with a base URL base, opti host, buffer to the empty string, and state to port state. -

  • If state override is hostname state, - terminate this algorithm. +

  • If state override is hostname state, then return.

  • @@ -1698,8 +1698,7 @@ string input, optionally with a base URL base, opti host, buffer to the empty string, and state to path start state. -
  • If state override is given, terminate this - algorithm. +

  • If state override is given, then return.

  • @@ -1752,7 +1751,7 @@ string input, optionally with a base URL base, opti
  • Set buffer to the empty string. -

  • If state override is given, terminate this algorithm. +

  • If state override is given, then return.

  • Set state to path start state, and decrease pointer by one. @@ -1845,11 +1844,10 @@ string input, optionally with a base URL base, opti

    1. -

      If base is non-null, base's - scheme is "file", and base's - path first string is a normalized Windows drive letter, - append base's path first string to - url's path. +

      If base is non-null, base's scheme is + "file", and base's path[0] is a + normalized Windows drive letter, append base's + path[0] to url's path.

      This is a (platform-independent) Windows drive letter quirk. Both url's and base's host are null under @@ -1962,13 +1960,13 @@ string input, optionally with a base URL base, opti syntax violation.

    2. If buffer is a double-dot path segment, shorten - url's path, and then if neither c is - "/", nor url is special and c is - "\", append the empty string to url's path. + url's path, and then if neither c is "/", nor + url is special and c is "\", append + the empty string to url's path. -

    3. Otherwise, if buffer is a single-dot path segment and if - neither c is "/", nor url is special and - c is "\", append the empty string to url's +

    4. Otherwise, if buffer is a single-dot path segment and if neither + c is "/", nor url is special and c is + "\", append the empty string to url's path.

    5. @@ -1977,10 +1975,9 @@ string input, optionally with a base URL base, opti
      1. -

        If url's scheme is - "file", url's path - is empty, and buffer is a Windows drive letter, run these - subsubsubsteps: +

        If url's scheme is "file", url's + path is empty, and buffer is a + Windows drive letter, then:

        1. If url's host is non-null, @@ -1992,7 +1989,7 @@ string input, optionally with a base URL base, opti

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

        2. Append buffer to url's path. +

        3. Append buffer to url's path.

      2. Set buffer to the empty string. @@ -2044,8 +2041,8 @@ string input, optionally with a base URL base, opti

      3. If c is "%" and remaining does not start with two ASCII hex digits, syntax violation. -

      4. If c is not EOF code point, UTF-8 percent encode c - using the simple encode set, and append the result to the first string in +

      5. If c is not EOF code point, UTF-8 percent encode c using + the simple encode set, and append the result to the first string in url's path.

    @@ -2195,8 +2192,8 @@ then runs these steps: url's scheme is "file", append "//" to output. -
  • If url's cannot-be-a-base-URL flag is set, append the first string - in url's path to output. +

  • If url's cannot-be-a-base-URL flag is set, append url's + path[0] to output.

  • Otherwise, then for each string in url's path, append "/" followed by the string to output. @@ -2246,8 +2243,8 @@ background information. [[!HTML]]

    "blob"
    -

    Let url be the result of parsing the first - string in URL's path. +

    Let url be the result of parsing URL's + path[0].

    Return a new opaque origin, if url is failure, and url's origin otherwise. @@ -2688,7 +2685,7 @@ compatibility with HTML's MessageEvent feature. [[!HTML]]

    1. If context object's url's cannot-be-a-base-URL flag is - set, terminate these steps. + set, then return.

    2. Basic URL parse the given value with context object's url as url and host state as state override. @@ -2714,7 +2711,7 @@ the setter to always "reset" both.

      1. If context object's url's cannot-be-a-base-URL flag is - set, terminate these steps. + set, then return.

      2. Basic URL parse the given value with context object's url as url and hostname state as state override. @@ -2763,7 +2760,7 @@ run these steps:

        1. If context object's url's cannot-be-a-base-URL flag is - set, terminate these steps. + set, then return.

        2. Empty context object's url's path. @@ -2789,7 +2786,7 @@ steps:

        3. If the given value is the empty string, set url's query to null, empty context object's query object's list, - and terminate these steps. + and then return.

        4. Let input be the given value with a single leading "?" removed, if any. @@ -2822,10 +2819,10 @@ steps:

          1. If context object's url's scheme is - "javascript", terminate these steps. + "javascript", then return. -

          2. If the given value is the empty string, set context object's url's - fragment to null and terminate these steps. +

          3. If the given value is the empty string, then set context object's + url's fragment to null and return.

          4. Let input be the given value with a single leading "#" removed, if any. From 4372a190b0691ba714def3d6295528a0aaf9d361 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Thu, 9 Feb 2017 16:05:19 +0100 Subject: [PATCH 2/2] link list --- url.bs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/url.bs b/url.bs index 12156b45..419b2348 100644 --- a/url.bs +++ b/url.bs @@ -864,9 +864,9 @@ It is initially the empty string.

            A URL's port is either null or a 16-bit unsigned integer that identifies a networking port. It is initially null. -

            A URL's path is a list of zero -or more ASCII strings holding data, usually identifying a location in hierarchical form. It -is initially empty. +

            A URL's path is a list of +zero or more ASCII strings holding data, usually identifying a location in hierarchical form. +It is initially empty.

            A special URL always has a non-empty path.