- From: Michael[tm] Smith <notifications@github.com>
- Date: Wed, 10 Aug 2016 23:40:13 -0700
- To: w3c/browser-payment-api <browser-payment-api@noreply.github.com>
- Message-ID: <w3c/browser-payment-api/issues/235@github.com>
The [PaymentCurrencyAmount section of the spec](https://w3c.github.io/browser-payment-api/#paymentcurrencyamount) states MUST requirements for the `value` field of `PaymentCurrencyAmount` instances, but the spec doesn’t explicitly define what the requirements are if a `value` field in an `PaymentCurrencyAmount` instance is found to not be valid. Specifically the spec doesn’t state, e.g., that a conforming UA must throw if a `value` field in an `PaymentCurrencyAmount` instance is found to not be valid. >From the current language of the spec, it’s not even clear if the “must“ requirements stated for the `value` field are requirements that UAs must (somehow) enforce or whether they are simply requirements that authors must follow (that is, document-conformance requirements). Another case where the spec similarly states MUST requirements but does not explicitly state what if anything must happen for cases of non-conformance with those requirements is in [the spec text regarding the uniqueness of the `id` field in a `PaymentShippingOption` instance](https://w3c.github.io/browser-payment-api/#paymentshippingoption-dictionary) Maybe the fix for those cases is, just always state the specific requirements in a “the _foo_ constructor must act as follows“ list, in the way that, e.g., [the UA requirements for the `total` field are stated](https://w3c.github.io/browser-payment-api/#paymentrequest-constructor): > If the first character of `details.total.amount.value` is U+002D HYPHEN-MINUS, then throw a _TypeError_ <hr> The context for this issue is that I’m working on evaluating the [tests currently in the `paymentrequest-constructor` branch of the web-platform-tests repo](https://github.com/w3c/web-platform-tests/blob/paymentrequest-constructor/payment-request/paymentrequest-constructor.html), which can at the moment be run in a browser from [w3c-test.org/submissions/3441](https://w3c-test.org/submissions/3441/payment-request/paymentrequest-constructor.html) (and which are basically just copies from Chromium [third_party/WebKit/LayoutTests/payments/payment-request-interface.html](https://chromium.googlesource.com/chromium/src/+/master/third_party/WebKit/LayoutTests/payments/payment-request-interface.html).) For those tests: 1. The tests check to make sure the UA throws if the `currency` field is not valid. (Those tests seem to me to clearly be incorrect tests, since [for `currency` the spec unambiguously states, “any string is considered valid”](https://w3c.github.io/browser-payment-api/#dfn-currency).) 2. The tests check to make sure the UA throws if the `value` field does not conform to [the MUST requirements the spec states for the `value` field](https://w3c.github.io/browser-payment-api/#dfn-value). However, for (2) above, because the spec never explicitly states the UA must throw if the `value` field doesn’t conform to the specified requirements (in fact it doesn’t clearly state anything that must happen), it’s not clear to me that a UA must throw (as the test expectations are checking for). -- 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/browser-payment-api/issues/235
Received on Thursday, 11 August 2016 06:40:45 UTC