From 4af559db9c0f97a8e287cee772a21d38ca018c4a Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Thu, 9 Mar 2017 17:16:16 +0100 Subject: [PATCH] Clarify IPv6 serializer Fixes #266. --- url.bs | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/url.bs b/url.bs index 7f67e937..f548a93a 100644 --- a/url.bs +++ b/url.bs @@ -8,7 +8,7 @@ No Editor: true Abstract: The URL Standard defines URLs, domains, IP addresses, the application/x-www-form-urlencoded format, and their API. Logo: https://resources.whatwg.org/logo-url.svg Boilerplate: omit feedback-header, omit conformance -!Participate: GitHub whatwg/url (new issue, open issues, legacy open bugs) +!Participate: GitHub whatwg/url (new issue, open issues) !Participate: IRC: #whatwg on Freenode !Commits: https://github.com/whatwg/url/commits !Commits: [SNAPSHOT-LINK] @@ -813,20 +813,28 @@ The IPv4 serializer takes an 16-bit pieces that are 0 longer than one, set compress pointer to null. +
  • Let ignore0 be false. +

  • For each piece in address's pieces, run these substeps:

      -
    1. If compress pointer points to - piece, append "::" to - output if piece is - address's first piece and append - ":" otherwise, and then run these substeps again with all - subsequent pieces in - address's pieces - that are 0 skipped or go the next step in the overall set of steps if - that leaves no pieces. +

    2. If ignore0 is true and piece is 0, then continue. + +

    3. Otherwise, if ignore0 is true, set ignore0 to false. + +

    4. +

      If compress pointer points to piece, then: + +

        +
      1. Let separator be "::" if piece is + address's first piece, and ":" otherwise. + +

      2. Append separator to output. + +

      3. Set ignore0 to true and continue. +

    5. Append piece, represented as the shortest possible lowercase hexadecimal number, to output.