Re: [w3c/payment-request] Construct and set attrs on PaymentAddress (#607)

domenic requested changes on this pull request.



> +              <li>Let <var>address</var> be a new instance of
+              <a>PaymentAddress</a>.
+              </li>
+              <li>Set the <a>addressLine</a> attribute of <var>address</var> to
+              the result of splitting the end user's address line into a
+              <a data-cite="!WEBIDL#dfn-frozen-array-type">frozen array</a>. If
+              none was provided, set it to the empty <a data-cite=
+              "!WEBIDL#dfn-frozen-array-type">frozen array</a>.
+                <aside class="note">
+                  How to split an address line is locale dependent and beyond
+                  the scope of this specification.
+                </aside>
+              </li>
+              <li>Set the <a>country</a> attribute of <var>address</var> to the
+              end user's country as an upper case [[!ISO3166]] alpha-2 code or
+              to the empty string if none was provided.

Nit: comma after "code" reads nicer.

> @@ -2829,10 +2829,66 @@
           <li>
             <a>Queue a task</a> on the <a>user interaction task source</a> to
             run the following steps:
-            <ol>
+            <ol data-link-for="PaymentAddress">
+              <li>Let <var>address</var> be a new instance of
+              <a>PaymentAddress</a>.
+              </li>
+              <li>Set the <a>addressLine</a> attribute of <var>address</var> to

You cannot set attributes that are readonly. There need to be internal slots for all of these, and then the attributes need to have normative text that their getters return the value of the internal slot.

This only slipped by until now because this whole thing was underspecified. Thanks for catching it :)

> +              </li>
+              <li>Set the <a>country</a> attribute of <var>address</var> to the
+              end user's country as an upper case [[!ISO3166]] alpha-2 code or
+              to the empty string if none was provided.
+              </li>
+              <li>If <var>request</var>.<a>[[\options]]</a>.<a data-lt=
+              "PaymentOptions.requestPayerPhone">requestPayerPhone</a> is
+              false, set the <a>phone</a> attribute of <var>address</var> to
+              the empty string. Otherwise, set the <a>phone</a> attribute of
+              <var>address</var> to a user provided phone number, optionally
+              formatted to adhere to [[!E.164]], or to the empty string if none
+              was provided.
+              </li>
+              <li>Set the <a>languageCode</a> attribute of <var>address</var>
+              to a <a data-cite="!BCP47#section-4.5">canonicalized language
+              tag</a>, or to the empty sting if none was provided.

"sting" -> "string"

Do we really expect a language to be "provided"? We might want to expand on this somehow.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/payment-request/pull/607#pullrequestreview-60753655

Received on Tuesday, 5 September 2017 22:04:51 UTC