diff --git a/url.bs b/url.bs index 44bfb8c4..2f475eb9 100644 --- a/url.bs +++ b/url.bs @@ -756,14 +756,14 @@ not equivalent and typically treated as distinct.

An IP address is an IPv4 address or an IPv6 address. -

An IPv4 address is a 32-bit unsigned integer that identifies a -network address. +

An IPv4 address is a 32-bit unsigned integer that +identifies a network address. [[RFC791]] -

An IPv6 address is a 128-bit unsigned integer that identifies a -network address. For the purposes of this standard it is represented as a list of eight -16-bit unsigned integers, also known as -IPv6 pieces. +

An IPv6 address is a 128-bit unsigned integer that +identifies a network address. This integer is composed of a list of 8 +16-bit unsigned integers, also known as an IPv6 address's +pieces. [[RFC4291]]

Support for <zone_id> is @@ -1217,7 +1217,8 @@ these steps. They return failure or a tuple of a number and a boole actually doing that with the editors of this document first.

    -
  1. Let address be a new IPv6 address whose IPv6 pieces are all 0. +

  2. Let address be a new IPv6 address whose pieces + are all 0.

  3. Let pieceIndex be 0. @@ -1444,20 +1445,14 @@ actually doing that with the editors of this document first.

    1. Let output be the empty string. -

    2. -

      Let compress be an index to the first IPv6 piece in the first longest - sequences of address's IPv6 pieces that are 0. - -

      In 0:f:0:0:f:f:0:0 it would point to - the second 0. - -

    3. If there is no sequence of address's IPv6 pieces that are 0 that is - longer than 1, then set compress to null. +

    4. Let compress be the result of + finding the IPv6 address compressed piece index given address.

    5. Let ignore0 be false.

    6. -

      For each pieceIndex in the range 0 to 7, inclusive: +

      For each pieceIndex of address's + pieces's indices:

      1. If ignore0 is true and address[pieceIndex] is 0, then @@ -1469,8 +1464,8 @@ actually doing that with the editors of this document first.

        If compress is pieceIndex, then:

          -
        1. Let separator be "::" if pieceIndex is 0, and - U+003A (:) otherwise. +

        2. Let separator be "::" if pieceIndex is 0; otherwise + U+003A (:).

        3. Append separator to output. @@ -1491,6 +1486,57 @@ A Recommendation for IPv6 Address Text Representation. [[RFC5952]] +

          +

          To find the IPv6 address compressed piece index given an IPv6 address +address: + +

            +
          1. Let longestIndex be null. + +

          2. Let longestSize be 1. + +

          3. Let foundIndex be null. + +

          4. Let foundSize be 0. + +

          5. +

            For each pieceIndex of address's + pieces's indices: + +

              +
            1. +

              If address's pieces[pieceIndex] is not 0: + +

                +
              1. If foundSize is greater than longestSize, then set + longestIndex to foundIndex and longestSize to + foundSize. + +

              2. Set foundIndex to null. + +
              3. Set foundSize to 0. +
              + +
            2. +

              Otherwise: + +

                +
              1. If foundIndex is null, then set foundIndex to + pieceIndex. + +

              2. Increment foundSize by 1. +

              +
            + +
          6. If foundSize is greater than longestSize, then return + foundIndex. + +

          7. Return longestIndex. +

          + +

          In 0:f:0:0:f:f:0:0 it would point to the second 0. +

          +

          Host equivalence

          @@ -1713,8 +1759,8 @@ 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 port is either null or a +16-bit unsigned integer that identifies a networking port. It is initially null.

          A URL's path @@ -1974,8 +2020,8 @@ followed by a path-absolute-URL string.

          A scheme-relative-URL string must be @@ -2577,7 +2623,7 @@ and then runs these steps: by buffer in radix-10 using ASCII digits for digits with values 0 through 9. -

        4. If port is greater than 216 − 1, +

        5. If port is not a 16-bit unsigned integer, port-out-of-range validation error, return failure.

        6. Set url's port to null, if port is