From 25bf943296d0a87298760fbd30848d1f9ea4f253 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Mon, 20 Nov 2017 20:02:55 +1100 Subject: [PATCH 01/12] Add regionCode attribute to PaymentAddress --- index.html | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 56 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 2db39c85..e4263954 100644 --- a/index.html +++ b/index.html @@ -2148,6 +2148,7 @@

readonly attribute DOMString postalCode; readonly attribute DOMString recipient; readonly attribute DOMString region; + readonly attribute DOMString regionCode; readonly attribute DOMString sortingCode; readonly attribute FrozenArray<DOMString> addressLine; }; @@ -2199,6 +2200,22 @@

+
  • If details["regionCode"] is present and not + the empty string: +
      +
    1. Let regionCode be the result of strip leading + and trailing ASCII whitespace and ASCII uppercasing + details["regionCode"]. +
    2. +
    3. If regionCode is not a valid [[!ISO3166-2]] + subdivision code, throw a RangeError exception. +
    4. +
    5. Set address.[[\regionCode]] to + regionCode. +
    6. +
    +
  • If details["languageCode"] is present:
    1. If internal slot.

      +
      +

      + regionCode attribute +

      +

      + Represents the region of the address as an [[!ISO3166-2]] + code. When getting, returns the value of the + PaymentAddress's [[\regionCode]] internal slot. +

      +

      city attribute @@ -2439,6 +2466,17 @@

      in Australia. + + + [[\regionCode]] + + + A region represented as a [[!ISO3166-2]] subdivision + code or the empty string, stored in its canonical uppercase + form. For example, "PT-11" represents the Lisbon + district of Portugal. + + [[\city]] @@ -2516,6 +2554,7 @@

      DOMString country; sequence<DOMString> addressLine; DOMString region; + DOMString regionCode; DOMString city; DOMString dependentLocality; DOMString postalCode; @@ -2550,6 +2589,13 @@

      A region.
      +
      + regionCode member +
      +
      + An region, represented as an [[!ISO3166-2]] subdivision + code. +
      city member
      @@ -2684,9 +2730,16 @@

      details["recipient"] to the user-provided recipient of the transaction, or to the empty string if none was provided.

    2. -
    3. If "region" is not in redactList, set - details["region"] to the user-provided region, or - to the empty string if none was provided. +
    4. If "region" is not in redactList: +
        +
      1. Set details["region"] to the user-provided + region, or to the empty string if none was provided. +
      2. +
      3. If details["region"] has as a corresponding + [[!ISO3166-2]] subdivision code, set + details["regionCode"] to that subdivision code. +
      4. +
    5. If "sortingCode" is not in redactList, set details["sortingCode"] to the user-provided sorting From 66a123775e1a485cce1a5d88647bdbfe32cb2dcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Mon, 19 Mar 2018 13:16:24 +1100 Subject: [PATCH 02/12] wip: iso stuff --- index.html | 55 +++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 44 insertions(+), 11 deletions(-) diff --git a/index.html b/index.html index e4263954..5275071e 100644 --- a/index.html +++ b/index.html @@ -2208,8 +2208,40 @@

      "!INFRA#ascii-uppercase">ASCII uppercasing details["regionCode"].

    6. -
    7. If regionCode is not a valid [[!ISO3166-2]] - subdivision code, throw a RangeError exception. +
    8. +

      + If regionCode is not a valid subdivision code as + per [[!ISO3166-2]]'s section 5.2 Structure of country + subdivision code elements (details below), throw a + RangeError exception. +

      +
      +

      + The structure of country subdivision code elements is + formally defined in [[!ISO3166-2]] (section 5.2). + Although the structure is not expected to change at the + time of writing, implementers are expected to track + updates to [[!ISO3166-2]] directly from ISO. +

      +

      + As [[!ISO3166-2]] is not freely available to the general + public, the structure of a country subdivision code + elements at the time of publication is as follow: +

      +
        +
      • Two code points that match an [[!ISO3166-1]] + alpha-2 country code. +
      • +
      • A single U+002D (-) code point. +
      • +
      • One, two, or three ASCII alphanumeric code + points, in any order. This is referred to as the + subdivision name. +
      • +
      +
    9. Set address.[[\regionCode]] to regionCode. @@ -2339,8 +2371,9 @@

      Represents the region of the address as an [[!ISO3166-2]] - code. When getting, returns the value of the - PaymentAddress's [[\regionCode]] internal slot. + country subdivision code element. When getting, returns the value + of the PaymentAddress's [[\regionCode]] internal + slot.

      @@ -2471,10 +2504,10 @@

      [[\regionCode]] - A region represented as a [[!ISO3166-2]] subdivision - code or the empty string, stored in its canonical uppercase - form. For example, "PT-11" represents the Lisbon - district of Portugal. + A region represented as a [[!ISO3166-2]] country + subdivision code element or the empty string, stored in its + canonical uppercase form. For example, "PT-11" + represents the Lisbon district of Portugal. @@ -2593,8 +2626,8 @@

      regionCode member
      - An region, represented as an [[!ISO3166-2]] subdivision - code. + An region, represented as an [[!ISO3166-2]] country + subdivision code element.
      city member @@ -2736,7 +2769,7 @@

      region, or to the empty string if none was provided.

    10. If details["region"] has as a corresponding - [[!ISO3166-2]] subdivision code, set + [[!ISO3166-2]] country subdivision code element, set details["regionCode"] to that subdivision code.
    From 8f030ca627d1680e44dfa29c35efb7d75f9237ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Thu, 22 Mar 2018 16:11:24 +1100 Subject: [PATCH 03/12] xrefs, cleanup, feedback --- index.html | 80 +++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 55 insertions(+), 25 deletions(-) diff --git a/index.html b/index.html index 5275071e..279435a5 100644 --- a/index.html +++ b/index.html @@ -2204,21 +2204,24 @@

    the empty string:
    1. Let regionCode be the result of strip leading - and trailing ASCII whitespace and ASCII uppercasing - details["regionCode"]. + and trailing ASCII whitespace from + details["regionCode"] and then + ASCII uppercasing + the result.
    2. - If regionCode is not a valid subdivision code as - per [[!ISO3166-2]]'s section 5.2 Structure of country - subdivision code elements (details below), throw a + If regionCode is not a valid country + subdivision code element as per [[!ISO3166-2]]'s + section 5.2 "Structure of country subdivision code + elements" (non-normative details below), throw a RangeError exception.

      - The structure of country subdivision code elements is + Do not implement from this note. The + structure of a country subdivision code element is formally defined in [[!ISO3166-2]] (section 5.2). Although the structure is not expected to change at the time of writing, implementers are expected to track @@ -2226,8 +2229,8 @@

      As [[!ISO3166-2]] is not freely available to the general - public, the structure of a country subdivision code - elements at the time of publication is as follow: + public, the structure of a country subdivision code + element at the time of publication is as follows:

      • Two code points that match an [[!ISO3166-1]] @@ -2236,9 +2239,8 @@

      • A single U+002D (-) code point.
      • One, two, or three ASCII alphanumeric code - points, in any order. This is referred to as the - subdivision name. + "INFRA#ascii-alphanumeric">ASCII alphanumeric code + points, in any order.

      @@ -2246,6 +2248,25 @@

    3. Set address.[[\regionCode]] to regionCode.
    4. +
    5. Let region be the corresponding [[!ISO3166-2]] + country subdivision name for regionCode. + Where [[!ISO3166-2]] defines multiple country subdivision + names for a regionCode, it is RECOMMENDED the + user agent select one by matching on: +
        +
      1. The language of + the body + element. +
      2. +
      3. The user's preferred languages. +
      4. +
      5. Any other criteria the user agent deems suitable. +
      6. +
      +
    6. +
    7. Set address.[[\region]] to + region. +

  • If details["languageCode"] is present: @@ -2371,9 +2392,9 @@

    Represents the region of the address as an [[!ISO3166-2]] - country subdivision code element. When getting, returns the value - of the PaymentAddress's [[\regionCode]] internal - slot. + country subdivision code element. When getting, returns the + value of the PaymentAddress's [[\regionCode]] + internal slot.

    @@ -2494,9 +2515,9 @@

    [[\region]] - A region as a country subdivision name or the empty - string, such as "Victoria", representing the state of Victoria - in Australia. + A region as a country subdivision name or the + empty string, such as "Victoria", representing the state of + Victoria in Australia. @@ -2504,9 +2525,9 @@

    [[\regionCode]] - A region represented as a [[!ISO3166-2]] country - subdivision code element or the empty string, stored in its - canonical uppercase form. For example, "PT-11" + A region represented as a [[!ISO3166-2]] country + subdivision code element stored in its canonical uppercase + form, or the empty string. For example, "PT-11" represents the Lisbon district of Portugal. @@ -2626,8 +2647,8 @@

    regionCode member
    - An region, represented as an [[!ISO3166-2]] country - subdivision code element. + An region, represented as a country subdivision code + element.
    city member @@ -2769,8 +2790,9 @@

    region, or to the empty string if none was provided.

  • If details["region"] has as a corresponding - [[!ISO3166-2]] country subdivision code element, set - details["regionCode"] to that subdivision code. + country subdivision code element, set + details["regionCode"] to that country + subdivision code element.
  • @@ -4009,6 +4031,14 @@

    This specification relies on several other underlying specifications.

    +
    + ISO 3366-2 +
    +
    + Country subdivision + name and country subdivision code element are + defined in [[!ISO3166-2]]. +
    Infra
    From 8199e35bba58fc570600ca0747a61af3eeeaeddd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Thu, 22 Mar 2018 16:18:05 +1100 Subject: [PATCH 04/12] nit: redudant reference --- index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 279435a5..1380e841 100644 --- a/index.html +++ b/index.html @@ -2248,9 +2248,9 @@

  • Set address.[[\regionCode]] to regionCode.
  • -
  • Let region be the corresponding [[!ISO3166-2]] - country subdivision name for regionCode. - Where [[!ISO3166-2]] defines multiple country subdivision +
  • Let region be the corresponding country + subdivision name for regionCode. Where + [[!ISO3166-2]] defines multiple country subdivision names for a regionCode, it is RECOMMENDED the user agent select one by matching on:
      From 58e0d95e118eea7c4daaf1bb23121e297cc84495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Thu, 10 May 2018 17:57:17 +1000 Subject: [PATCH 05/12] fix typo --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 1380e841..634d33f0 100644 --- a/index.html +++ b/index.html @@ -2789,7 +2789,7 @@

    1. Set details["region"] to the user-provided region, or to the empty string if none was provided.
    2. -
    3. If details["region"] has as a corresponding +
    4. If details["region"] has a corresponding country subdivision code element, set details["regionCode"] to that country subdivision code element. From 2febe4246f2d4ae9b18a95ace151d96dedc3a833 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Fri, 11 May 2018 16:43:28 +1000 Subject: [PATCH 06/12] Return just the subdivision part --- index.html | 69 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 42 insertions(+), 27 deletions(-) diff --git a/index.html b/index.html index 634d33f0..3e3e37a2 100644 --- a/index.html +++ b/index.html @@ -2185,7 +2185,8 @@

    5. If details was not passed, return address.
    6. -
    7. If details["country"] is present: +
    8. If details["country"] is present and not the + empty string:
      1. Set country the result of strip leading and trailing ASCII whitespace from @@ -2203,12 +2204,16 @@

      2. If details["regionCode"] is present and not the empty string:
          -
        1. Let regionCode be the result of strip leading +
        2. Let regionPart be the result of strip leading and trailing ASCII whitespace from details["regionCode"] and then ASCII uppercasing the result.
        3. +
        4. Let regionCode be the concatenation of + address.[[\country]], a single U+002D (-) + code point, regionPart. +
        5. If regionCode is not a valid country @@ -2246,27 +2251,31 @@

        6. Set address.[[\regionCode]] to - regionCode. + regionPart.
        7. -
        8. Let region be the corresponding country - subdivision name for regionCode. Where - [[!ISO3166-2]] defines multiple country subdivision - names for a regionCode, it is RECOMMENDED the - user agent select one by matching on: +
        9. If details["region"] is not present:
            -
          1. The language of - the body - element. -
          2. -
          3. The user's preferred languages. +
          4. Let region be the corresponding country + subdivision name for regionCode. Where + [[!ISO3166-2]] defines multiple country subdivision + names for a regionCode, it is RECOMMENDED + the user agent select one by matching on: +
              +
            1. The language of + the body + element. +
            2. +
            3. The user's preferred languages. +
            4. +
            5. Any other criteria the user agent deems suitable. +
            6. +
          5. -
          6. Any other criteria the user agent deems suitable. +
          7. + details["region"] to region.
        10. -
        11. Set address.[[\region]] to - region. -
      3. If details["languageCode"] is present: @@ -2391,10 +2400,10 @@

        regionCode attribute

        - Represents the region of the address as an [[!ISO3166-2]] - country subdivision code element. When getting, returns the - value of the PaymentAddress's [[\regionCode]] - internal slot. + Represents the region of the address, but as the code + element of an [[!ISO3166-2]] country subdivision name (e.g., "CA" + for California, USA). When getting, returns the value of the + PaymentAddress's [[\regionCode]] internal slot.

        @@ -2525,10 +2534,12 @@

        [[\regionCode]] - A region represented as a [[!ISO3166-2]] country - subdivision code element stored in its canonical uppercase - form, or the empty string. For example, "PT-11" - represents the Lisbon district of Portugal. + Either the empty string, or one to three code points that + represent a region as the code element of an + [[!ISO3166-2]] country subdivision name (i.e., the characters + after the hyphen in an ISO3166-2 country subdivision code + element, such as "CA" for the state of California in the + USA, or "11" for the Lisbon district of Portugal). @@ -2647,8 +2658,12 @@

        regionCode member
        - An region, represented as a country subdivision code - element. + Either the empty string, or one to three code points that represent + a region as the code element of an [[!ISO3166-2]] country + subdivision name (i.e., the characters after the hyphen in an + ISO3166-2 country subdivision code element, such as "CA" for + the state of California in the USA, or "11" for the Lisbon district + of Portugal)
        city member From cdd18dc0ed74786c8e17a05943454d1f97c413a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Fri, 11 May 2018 17:10:23 +1000 Subject: [PATCH 07/12] fixup --- index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 3e3e37a2..53b18677 100644 --- a/index.html +++ b/index.html @@ -2400,9 +2400,9 @@

        regionCode attribute

        - Represents the region of the address, but as the code - element of an [[!ISO3166-2]] country subdivision name (e.g., "CA" - for California, USA). When getting, returns the value of the + Represents the region of the address as a code element of an + [[!ISO3166-2]] country subdivision name (e.g., "CA" for California, + USA). When getting, returns the value of the PaymentAddress's [[\regionCode]] internal slot.

        From 5f23fac5cc22a332f65a495d06878d1ef2870cf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Fri, 11 May 2018 17:16:55 +1000 Subject: [PATCH 08/12] Fixup --- index.html | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/index.html b/index.html index 53b18677..9adf0ab1 100644 --- a/index.html +++ b/index.html @@ -2271,8 +2271,8 @@

    9. -
    10. - details["region"] to region. +
    11. Set details["region"] to + region.
  • @@ -2534,12 +2534,12 @@

    [[\regionCode]] - Either the empty string, or one to three code points that - represent a region as the code element of an - [[!ISO3166-2]] country subdivision name (i.e., the characters - after the hyphen in an ISO3166-2 country subdivision code - element, such as "CA" for the state of California in the - USA, or "11" for the Lisbon district of Portugal). + The empty string, or one to three code points that represent a + region as the code element of an [[!ISO3166-2]] country + subdivision name (i.e., the characters after the hyphen in an + ISO3166-2 country subdivision code element, such as "CA" + for the state of California in the USA, or "11" for the Lisbon + district of Portugal). @@ -2658,8 +2658,8 @@

    regionCode member
    - Either the empty string, or one to three code points that represent - a region as the code element of an [[!ISO3166-2]] country + The empty string, or one to three code points that represent a + region as the code element of an [[!ISO3166-2]] country subdivision name (i.e., the characters after the hyphen in an ISO3166-2 country subdivision code element, such as "CA" for the state of California in the USA, or "11" for the Lisbon district From d1aca5d66fc9f5a6a4c19ff767da818ab16a33f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Wed, 16 May 2018 15:16:40 +1000 Subject: [PATCH 09/12] Rename regionCode var to countrySubdivisionCodeElement --- index.html | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/index.html b/index.html index 9adf0ab1..7f0765e3 100644 --- a/index.html +++ b/index.html @@ -2204,23 +2204,23 @@

  • If details["regionCode"] is present and not the empty string:
      -
    1. Let regionPart be the result of strip leading +
    2. Let regionCode be the result of strip leading and trailing ASCII whitespace from details["regionCode"] and then ASCII uppercasing the result.
    3. -
    4. Let regionCode be the concatenation of - address.[[\country]], a single U+002D (-) - code point, regionPart. +
    5. Let countrySubdivisionCodeElement be the + concatenation of address.[[\country]], a + single U+002D (-) code point, regionCode.
    6. - If regionCode is not a valid country - subdivision code element as per [[!ISO3166-2]]'s - section 5.2 "Structure of country subdivision code - elements" (non-normative details below), throw a - RangeError exception. + If countrySubdivisionCodeElement is not a valid + country subdivision code element as per + [[!ISO3166-2]]'s section 5.2 "Structure of country + subdivision code elements" (non-normative details below), + throw a RangeError exception.

      @@ -2251,7 +2251,7 @@

    7. Set address.[[\regionCode]] to - regionPart. + regionCode.
    8. If details["region"] is not present:
        From 1695891f7f5c6733a68d94d509e6f8c7d0421269 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Wed, 16 May 2018 15:17:16 +1000 Subject: [PATCH 10/12] missing and --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 7f0765e3..a89c0ada 100644 --- a/index.html +++ b/index.html @@ -2212,7 +2212,7 @@

      1. Let countrySubdivisionCodeElement be the concatenation of address.[[\country]], a - single U+002D (-) code point, regionCode. + single U+002D (-) code point, and regionCode.
      2. From d2b59ee4ec6524e6017309d98214e1b67bf96301 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Wed, 16 May 2018 15:19:29 +1000 Subject: [PATCH 11/12] use putativeCountrySubdivisionCodeElement instead --- index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index a89c0ada..d2fe3bb8 100644 --- a/index.html +++ b/index.html @@ -2210,14 +2210,14 @@

        ASCII uppercasing the result.

      3. -
      4. Let countrySubdivisionCodeElement be the +
      5. Let putativeCountrySubdivisionCodeElement be the concatenation of address.[[\country]], a single U+002D (-) code point, and regionCode.
      6. - If countrySubdivisionCodeElement is not a valid - country subdivision code element as per + If putativeCountrySubdivisionCodeElement is not + a valid country subdivision code element as per [[!ISO3166-2]]'s section 5.2 "Structure of country subdivision code elements" (non-normative details below), throw a RangeError exception. From 699d3290f5080400ded7fd27d7b5ebc539238f6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Wed, 16 May 2018 15:42:36 +1000 Subject: [PATCH 12/12] typo --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index d2fe3bb8..795e4fb4 100644 --- a/index.html +++ b/index.html @@ -2663,7 +2663,7 @@

        subdivision name (i.e., the characters after the hyphen in an ISO3166-2 country subdivision code element, such as "CA" for the state of California in the USA, or "11" for the Lisbon district - of Portugal) + of Portugal).

  • city member