Skip to content

Commit

Permalink
Remove regionCode attribute (#823)
Browse files Browse the repository at this point in the history
* Remove PaymentAddress' regionCode attribute

* Add note about bringing back regionCode in the future
  • Loading branch information
marcoscaceres authored Jan 24, 2019
1 parent bedda00 commit 5906b72
Showing 1 changed file with 17 additions and 134 deletions.
151 changes: 17 additions & 134 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2175,7 +2175,6 @@ <h2>
readonly attribute DOMString postalCode;
readonly attribute DOMString recipient;
readonly attribute DOMString region;
readonly attribute DOMString regionCode;
readonly attribute DOMString sortingCode;
readonly attribute FrozenArray&lt;DOMString&gt; addressLine;
};
Expand All @@ -2184,6 +2183,20 @@ <h2>
The <a>PaymentAddress</a> interface represents a <a>physical
address</a>.
</p>
<aside class="note" title="What happened to regionCode?">
<p>
This specification once included a <code>regionCode</code>
attribute that provided developers with a [[?ISO3166-2]] country
subdivision code element representation of an address' region
(e.g., "CA" for California). Unfortunately, the attribute was
removed due to lack of implementations. The Web Payments Working
Group fully recognizes the importance of the
<code>regionCode</code> attribute and is <a href=
"https://github.com/w3c/payment-request/issues/663">committed
bringing the attribute back</a> in a future revision of this
specification.
</p>
</aside>
<section>
<h2>
Internal constructor
Expand Down Expand Up @@ -2222,83 +2235,6 @@ <h2>
</li>
</ol>
</li>
<li>If <var>details</var>["<a>regionCode</a>"] is present and not
the empty string:
<ol>
<li>Let <var>regionCode</var> be the result of <a>strip leading
and trailing ASCII whitespace</a> from
<var>details</var>["<a>regionCode</a>"] and then
<a data-cite="INFRA#ascii-uppercase">ASCII uppercasing</a>
the result.
</li>
<li>Let <var>putativeCountrySubdivisionCodeElement</var> be the
concatenation of <var>address</var>.<a>[[\country]]</a>, a
single U+002D (-) <a>code point</a>, and <var>regionCode</var>.
</li>
<li>
<p>
If <var>putativeCountrySubdivisionCodeElement</var> is not
a valid <a>country subdivision code element</a> as per
[[ISO3166-2]]'s section 5.2 "Structure of country
subdivision code elements" (non-normative details below),
throw a <a>RangeError</a> exception.
</p>
<div class="note" title=
"Structure of country subdivision code elements">
<p>
<strong>Do not implement from this note.</strong> The
structure of a <a>country subdivision code element</a> 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.
</p>
<p>
As [[ISO3166-2]] is not freely available to the general
public, the structure of a <a>country subdivision code
element</a> at the time of publication is as follows:
</p>
<ul>
<li>Two <a>code points</a> that match an [[ISO3166-1]]
alpha-2 country code.
</li>
<li>A single U+002D (-) <a>code point</a>.
</li>
<li>One, two, or three <a data-cite=
"INFRA#ascii-alphanumeric">ASCII alphanumeric</a> code
points, in any order.
</li>
</ul>
</div>
</li>
<li>Set <var>address</var>.<a>[[\regionCode]]</a> to
<var>regionCode</var>.
</li>
<li>If <var>details</var>["<a>region</a>"] is not present:
<ol>
<li>Let <var>region</var> be the corresponding <a>country
subdivision name</a> for <var>regionCode</var>. Where
[[ISO3166-2]] defines multiple <a>country subdivision
names</a> for a <var>regionCode</var>, it is RECOMMENDED
the user agent select one by matching on:
<ol>
<li>The <a data-cite="HTML#language">language</a> of
<a data-cite="HTML#the-body-element-2">the body
element</a>.
</li>
<li>The user's preferred languages.
</li>
<li>Any other criteria the user agent deems suitable.
</li>
</ol>
</li>
<li>Set <var>details</var>["<a>region</a>"] to
<var>region</var>.
</li>
</ol>
</li>
</ol>
</li>
<li>Let <var>cleanAddressLines</var> be an empty list.
</li>
<li>If <var>details</var>["<a>addressLine</a>"] is present, then
Expand Down Expand Up @@ -2404,17 +2340,6 @@ <h2>
internal slot.
</p>
</section>
<section>
<h2>
<dfn>regionCode</dfn> attribute
</h2>
<p data-link-for="">
Represents the <a>region</a> 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
<a>PaymentAddress</a>'s <a>[[\regionCode]]</a> internal slot.
</p>
</section>
<section>
<h2>
<dfn>city</dfn> attribute
Expand Down Expand Up @@ -2528,19 +2453,6 @@ <h2>
Victoria in Australia.
</td>
</tr>
<tr>
<td>
<dfn>[[\regionCode]]</dfn>
</td>
<td>
The empty string, or one to three code points that represent a
<a>region</a> as the code element of an [[ISO3166-2]] country
subdivision name (i.e., the characters after the hyphen in an
ISO3166-2 <a>country subdivision code element</a>, such as "CA"
for the state of California in the USA, or "11" for the Lisbon
district of Portugal).
</td>
</tr>
<tr>
<td>
<dfn>[[\city]]</dfn>
Expand Down Expand Up @@ -2609,7 +2521,6 @@ <h2>
DOMString country;
sequence&lt;DOMString&gt; addressLine;
DOMString region;
DOMString regionCode;
DOMString city;
DOMString dependentLocality;
DOMString postalCode;
Expand Down Expand Up @@ -2643,17 +2554,6 @@ <h2>
<dd>
A <a>region</a>.
</dd>
<dt>
<dfn>regionCode</dfn> member
</dt>
<dd>
The empty string, or one to three code points that represent a
<a>region</a> as the code element of an [[ISO3166-2]] country
subdivision name (i.e., the characters after the hyphen in an
ISO3166-2 <a>country subdivision code element</a>, such as "CA" for
the state of California in the USA, or "11" for the Lisbon district
of Portugal).
</dd>
<dt>
<dfn>city</dfn> member
</dt>
Expand Down Expand Up @@ -2716,7 +2616,6 @@ <h2>
DOMString postalCode;
DOMString recipient;
DOMString region;
DOMString regionCode;
DOMString sortingCode;
};
</pre>
Expand Down Expand Up @@ -2816,16 +2715,6 @@ <h2>
provided the <a>PaymentAddress</a>'s <a data-link-for=
"PaymentAddress">region</a> attribute's value.
</dd>
<dt>
<dfn>regionCode</dfn> member
</dt>
<dd>
Denotes that the region code representation of the <a>region</a>
has a validation error. In the user agent's UI, this member
corresponds to the input field that provided the
<a>PaymentAddress</a>'s <a data-link-for=
"PaymentAddress">regionCode</a> attribute's value.
</dd>
<dt>
<dfn>sortingCode</dfn> member
</dt>
Expand Down Expand Up @@ -2924,20 +2813,14 @@ <h2>
address for a particular country, it might not provide a field
for the user to input a <a>region</a>. In such cases, the user
agent returns an empty string for both <a>PaymentAddress</a>'s
<a data-link-for="PaymentAddress">region</a> and
<a data-link-for="PaymentAddress">regionCode</a> attributes - but
the address can still serve its intended purpose (e.g., be valid
for shipping or billing purposes).
<a data-link-for="PaymentAddress">region</a> attribute - but the
address can still serve its intended purpose (e.g., be valid for
shipping or billing purposes).
</p>
<ol>
<li>Set <var>details</var>["<a>region</a>"] to the user-provided
region, or to the empty string if none was provided.
</li>
<li>If <var>details</var>["<a>region</a>"] has a corresponding
<a>country subdivision code element</a>, set
<var>details</var>["<a>regionCode</a>"] to that <a>country
subdivision code element</a>.
</li>
</ol>
</li>
<li>If "sortingCode" is not in <var>redactList</var>, set
Expand Down

0 comments on commit 5906b72

Please sign in to comment.