[Payment Request] Fix validation order of PaymentCurrencyAmount. #15873
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The "check and canonicalize amount" algorithm in the spec requires that
the |currency| field is validated before the |amount| field.
https://w3c.github.io/payment-request/#validity-checkers
Without this patch, Chrome incorrectly throws TypeError instead of
RangeError when both the currency and amount are invalid.
With the patch, Chrome passes the currency validation tests in
https://w3c-test.org/payment-request/PaymentRequestUpdateEvent/updateWith-method-abort-update-manual.https.html
Also fixed a typo in WPT test name.
Bug: 942656
Change-Id: I76b249bc1970740e0c3c9e2309bf2b9ce912450a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1526434
Commit-Queue: Rouslan Solomakhin <rouslan@chromium.org>
Reviewed-by: Rouslan Solomakhin <rouslan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#641586}