@@ -2148,6 +2148,7 @@ <h2>
2148
2148
readonly attribute DOMString postalCode;
2149
2149
readonly attribute DOMString recipient;
2150
2150
readonly attribute DOMString region;
2151
+ readonly attribute DOMString regionCode;
2151
2152
readonly attribute DOMString sortingCode;
2152
2153
readonly attribute FrozenArray<DOMString> addressLine;
2153
2154
};
@@ -2184,7 +2185,8 @@ <h2>
2184
2185
< li > If < var > details</ var > was not passed, return
2185
2186
< var > address</ var > .
2186
2187
</ li >
2187
- < li > If < var > details</ var > ["< a > country</ a > "] is present:
2188
+ < li > If < var > details</ var > ["< a > country</ a > "] is present and not the
2189
+ empty string:
2188
2190
< ol >
2189
2191
< li > Set < var > country</ var > the result of < a > strip leading and
2190
2192
trailing ASCII whitespace</ a > from
@@ -2199,6 +2201,83 @@ <h2>
2199
2201
</ li >
2200
2202
</ ol >
2201
2203
</ li >
2204
+ < li > If < var > details</ var > ["< a > regionCode</ a > "] is present and not
2205
+ the empty string:
2206
+ < ol >
2207
+ < li > Let < var > regionCode</ var > be the result of < a > strip leading
2208
+ and trailing ASCII whitespace</ a > from
2209
+ < var > details</ var > ["< a > regionCode</ a > "] and then
2210
+ < a data-cite ="!INFRA#ascii-uppercase "> ASCII uppercasing</ a >
2211
+ the result.
2212
+ </ li >
2213
+ < li > Let < var > putativeCountrySubdivisionCodeElement</ var > be the
2214
+ concatenation of < var > address</ var > .< a > [[\country]]</ a > , a
2215
+ single U+002D (-) < a > code point</ a > , and < var > regionCode</ var > .
2216
+ </ li >
2217
+ < li >
2218
+ < p >
2219
+ If < var > putativeCountrySubdivisionCodeElement</ var > is not
2220
+ a valid < a > country subdivision code element</ a > as per
2221
+ [[!ISO3166-2]]'s section 5.2 "Structure of country
2222
+ subdivision code elements" (non-normative details below),
2223
+ throw a < a > RangeError</ a > exception.
2224
+ </ p >
2225
+ < div class ="note " title =
2226
+ "Structure of country subdivision code elements ">
2227
+ < p >
2228
+ < strong > Do not implement from this note.</ strong > The
2229
+ structure of a < a > country subdivision code element</ a > is
2230
+ formally defined in [[!ISO3166-2]] (section 5.2).
2231
+ Although the structure is not expected to change at the
2232
+ time of writing, implementers are expected to track
2233
+ updates to [[!ISO3166-2]] directly from ISO.
2234
+ </ p >
2235
+ < p >
2236
+ As [[!ISO3166-2]] is not freely available to the general
2237
+ public, the structure of a < a > country subdivision code
2238
+ element</ a > at the time of publication is as follows:
2239
+ </ p >
2240
+ < ul >
2241
+ < li > Two < a > code points</ a > that match an [[!ISO3166-1]]
2242
+ alpha-2 country code.
2243
+ </ li >
2244
+ < li > A single U+002D (-) < a > code point</ a > .
2245
+ </ li >
2246
+ < li > One, two, or three < a data-cite =
2247
+ "INFRA#ascii-alphanumeric "> ASCII alphanumeric</ a > code
2248
+ points, in any order.
2249
+ </ li >
2250
+ </ ul >
2251
+ </ div >
2252
+ </ li >
2253
+ < li > Set < var > address</ var > .< a > [[\regionCode]]</ a > to
2254
+ < var > regionCode</ var > .
2255
+ </ li >
2256
+ < li > If < var > details</ var > ["< a > region</ a > "] is not present:
2257
+ < ol >
2258
+ < li > Let < var > region</ var > be the corresponding < a > country
2259
+ subdivision name</ a > for < var > regionCode</ var > . Where
2260
+ [[!ISO3166-2]] defines multiple < a > country subdivision
2261
+ names</ a > for a < var > regionCode</ var > , it is RECOMMENDED
2262
+ the user agent select one by matching on:
2263
+ < ol >
2264
+ < li > The < a data-cite ="!HTML#language "> language</ a > of
2265
+ < a data-cite ="HTML#the-body-element-2 "> the body
2266
+ element</ a > .
2267
+ </ li >
2268
+ < li > The user's preferred languages.
2269
+ </ li >
2270
+ < li > Any other criteria the user agent deems suitable.
2271
+ </ li >
2272
+ </ ol >
2273
+ </ li >
2274
+ < li > Set < var > details</ var > ["< a > region</ a > "] to
2275
+ < var > region</ var > .
2276
+ </ li >
2277
+ </ ol >
2278
+ </ li >
2279
+ </ ol >
2280
+ </ li >
2202
2281
< li > If < var > details</ var > ["< a > languageCode</ a > "] is present:
2203
2282
< ol >
2204
2283
< li > If < a data-cite =
@@ -2316,6 +2395,17 @@ <h2>
2316
2395
internal slot.
2317
2396
</ p >
2318
2397
</ section >
2398
+ < section >
2399
+ < h2 >
2400
+ < dfn > regionCode</ dfn > attribute
2401
+ </ h2 >
2402
+ < p data-link-for ="">
2403
+ Represents the < a > region</ a > of the address as a code element of an
2404
+ [[!ISO3166-2]] country subdivision name (e.g., "CA" for California,
2405
+ USA). When getting, returns the value of the
2406
+ < a > PaymentAddress</ a > 's < a > [[\regionCode]]</ a > internal slot.
2407
+ </ p >
2408
+ </ section >
2319
2409
< section >
2320
2410
< h2 >
2321
2411
< dfn > city</ dfn > attribute
@@ -2434,9 +2524,22 @@ <h2>
2434
2524
< dfn > [[\region]]</ dfn >
2435
2525
</ td >
2436
2526
< td >
2437
- A < a > region</ a > as a country subdivision name or the empty
2438
- string, such as "Victoria", representing the state of Victoria
2439
- in Australia.
2527
+ A < a > region</ a > as a < a > country subdivision name</ a > or the
2528
+ empty string, such as "Victoria", representing the state of
2529
+ Victoria in Australia.
2530
+ </ td >
2531
+ </ tr >
2532
+ < tr >
2533
+ < td >
2534
+ < dfn > [[\regionCode]]</ dfn >
2535
+ </ td >
2536
+ < td >
2537
+ The empty string, or one to three code points that represent a
2538
+ < a > region</ a > as the code element of an [[!ISO3166-2]] country
2539
+ subdivision name (i.e., the characters after the hyphen in an
2540
+ ISO3166-2 < a > country subdivision code element</ a > , such as "CA"
2541
+ for the state of California in the USA, or "11" for the Lisbon
2542
+ district of Portugal).
2440
2543
</ td >
2441
2544
</ tr >
2442
2545
< tr >
@@ -2516,6 +2619,7 @@ <h2>
2516
2619
DOMString country;
2517
2620
sequence<DOMString> addressLine;
2518
2621
DOMString region;
2622
+ DOMString regionCode;
2519
2623
DOMString city;
2520
2624
DOMString dependentLocality;
2521
2625
DOMString postalCode;
@@ -2550,6 +2654,17 @@ <h2>
2550
2654
< dd >
2551
2655
A < a > region</ a > .
2552
2656
</ dd >
2657
+ < dt >
2658
+ < dfn > regionCode</ dfn > member
2659
+ </ dt >
2660
+ < dd >
2661
+ The empty string, or one to three code points that represent a
2662
+ < a > region</ a > as the code element of an [[!ISO3166-2]] country
2663
+ subdivision name (i.e., the characters after the hyphen in an
2664
+ ISO3166-2 < a > country subdivision code element</ a > , such as "CA" for
2665
+ the state of California in the USA, or "11" for the Lisbon district
2666
+ of Portugal).
2667
+ </ dd >
2553
2668
< dt >
2554
2669
< dfn > city</ dfn > member
2555
2670
</ dt >
@@ -2684,9 +2799,17 @@ <h2>
2684
2799
< var > details</ var > ["< a > recipient</ a > "] to the user-provided recipient
2685
2800
of the transaction, or to the empty string if none was provided.
2686
2801
</ li >
2687
- < li > If "region" is not in < var > redactList</ var > , set
2688
- < var > details</ var > ["< a > region</ a > "] to the user-provided region, or
2689
- to the empty string if none was provided.
2802
+ < li > If "region" is not in < var > redactList</ var > :
2803
+ < ol >
2804
+ < li > Set < var > details</ var > ["< a > region</ a > "] to the user-provided
2805
+ region, or to the empty string if none was provided.
2806
+ </ li >
2807
+ < li > If < var > details</ var > ["< a > region</ a > "] has a corresponding
2808
+ < a > country subdivision code element</ a > , set
2809
+ < var > details</ var > ["< a > regionCode</ a > "] to that < a > country
2810
+ subdivision code element</ a > .
2811
+ </ li >
2812
+ </ ol >
2690
2813
</ li >
2691
2814
< li > If "sortingCode" is not in < var > redactList</ var > , set
2692
2815
< var > details</ var > ["< a > sortingCode</ a > "] to the user-provided sorting
@@ -3923,6 +4046,14 @@ <h2>
3923
4046
This specification relies on several other underlying specifications.
3924
4047
</ p >
3925
4048
< dl data-sort ="">
4049
+ < dt >
4050
+ ISO 3366-2
4051
+ </ dt >
4052
+ < dd >
4053
+ < dfn data-lt ="country subdivision names "> Country subdivision
4054
+ name</ dfn > and < dfn > country subdivision code element</ dfn > are
4055
+ defined in [[!ISO3166-2]].
4056
+ </ dd >
3926
4057
< dt >
3927
4058
Infra
3928
4059
</ dt >
0 commit comments