diff --git a/url.bs b/url.bs index b15d8a18..9b6c53e0 100644 --- a/url.bs +++ b/url.bs @@ -413,7 +413,8 @@ point URLs from A can come from untrusted sources.

A parse-serialize roundtrip gives the - following results, depending on the isNotSpecial argument to the host parser: + following results, depending on the isNotSpecial argument to the + host parser: @@ -731,9 +732,10 @@ to be distinguished.

Host parsing

+

The host parser takes a scalar value string input with an optional boolean isNotSpecial -(default false), and then runs these steps: +(default false), and then runs these steps. They return failure or a host.

  1. @@ -771,11 +773,13 @@ to be distinguished.
  2. Return asciiDomain.

+

+

The ends in a number checker takes an ASCII string input and then -runs these steps: +runs these steps. They return a boolean.

  1. Let parts be the result of strictly splitting input on @@ -807,18 +811,16 @@ runs these steps:

  2. Return false.

+
+

The IPv4 parser takes an ASCII string input -and then runs these steps: +and then runs these steps. They return failure or an IPv4 address. -

    -
  1. -

    Let validationError be false. - -

    This uses validationError to track validation errors to avoid - reporting them before we are confident we want to parse input as an IPv4 address as the - host parser almost always invokes the IPv4 parser. +

    The IPv4 parser is not to be invoked directly. Instead check that the +return value of the host parser is an IPv4 address. +

    1. Let parts be the result of strictly splitting input on U+002E (.). @@ -826,7 +828,7 @@ and then runs these steps:

      If the last item in parts is the empty string, then:

        -
      1. Set validationError to true. +

      2. Validation error.

      3. If parts's size is greater than 1, then remove the last item from parts. @@ -848,18 +850,11 @@ and then runs these steps:

      4. If result is failure, validation error, return failure. -

      5. If result[1] is true, then set validationError to true. +

      6. If result[1] is true, validation error.

      7. Append result[0] to numbers.

      -
    2. -

      If validationError is true, validation error. - -

      At this point each part was parsed into a number and input will be - treated as an IPv4 address (or failure). And therefore error reporting resumes. -

    3. -
    4. If any item in numbers is greater than 255, validation error.

    5. If any but the last item in numbers is greater than 255, then @@ -887,7 +882,9 @@ and then runs these steps:

    6. Return ipv4.

    +
+

The IPv4 number parser takes an ASCII string input and then runs these steps: @@ -938,11 +935,16 @@ these steps:

  • Return (output, validationError). +


  • +

    The IPv6 parser takes a scalar value string -input and then runs these steps: +input and then runs these steps. They return failure or an IPv6 address. + +

    The IPv6 parser could in theory be invoked directly, but please discuss +actually doing that with the editors of this document first.

    1. Let address be a new IPv6 address whose IPv6 pieces are all 0. @@ -1088,11 +1090,14 @@ these steps:

    2. Return address.

    +

    +

    The opaque-host parser takes a -scalar value string input, and then runs these steps: +scalar value string input, and then runs these steps. They return failure or an +opaque host.

    1. If input contains a forbidden host code point, @@ -1107,6 +1112,7 @@ these steps:

    2. Return the result of running UTF-8 percent-encode on input using the C0 control percent-encode set.

    +

    Host serializing