From 67a24bac35944f3565f73fbd59a989d849bcdec7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcos=20C=C3=A1ceres?=
Date: Tue, 29 May 2018 18:17:26 +1000
Subject: [PATCH] editorial: small non-normative bug fixes
---
index.html | 186 ++++++++++++++++++++++++++---------------------------
1 file changed, 91 insertions(+), 95 deletions(-)
diff --git a/index.html b/index.html
index 04bf1e19..59ad5476 100644
--- a/index.html
+++ b/index.html
@@ -650,7 +650,7 @@
-
- Check and canonicalize total
+ Check and canonicalize total amount
details.total.amount. Rethrow any exceptions.
@@ -680,13 +680,11 @@
- If the shippingOptions member of details is
present, then:
- - Let seenIDs be an empty list.
+
- Let seenIDs be an empty set.
- - Set options to
+
- For each option in
details.shippingOptions.
-
- - For each option in options:
+ "PaymentDetailsBase">shippingOptions:
-
@@ -703,10 +701,6 @@
- Otherwise, append option.id to
seenIDs.
-
-
- - For each option in options:
-
- If option.selected is true, then
set selectedShippingOption to
option.id.
@@ -743,7 +737,7 @@
- - Let isValidCurrency be the result of calling
- IsWellFormedCurrencyCode
- abstract operation with amount.currency as the
- argument.
-
- - If isValidCurrency is false, then throw a
- RangeError exception and terminate this algorithm, optionally
+
- If the result of IsWellFormedCurrencyCode(amount.currency)
+ is false, then throw a RangeError exception, optionally
informing the developer that the currency is invalid.
- If amount.value is not a valid decimal
@@ -1568,8 +1554,8 @@
- To check and canonicalize total given a
- PaymentCurrencyAmount total, run the following
+ To check and canonicalize total amount given a
+ PaymentCurrencyAmount amount, run the following
steps:
@@ -1577,9 +1563,9 @@
Check and canonicalize amount amount. Rethrow any
exceptions.
-
- If the first code point of value is U+002D (-),
- then throw a TypeError optionally informing the developer that
- a total can't be a negative number.
+
- If the first code point of amount.value
+ is U+002D (-), then throw a TypeError optionally informing the
+ developer that a total's value can't be a negative number.
- The updateWith(detailsPromise) method MUST act as follows:
+ The updateWith(detailsPromise)
+ method MUST act as follows:
- Let event be this PaymentRequestUpdateEvent
@@ -3333,8 +3320,10 @@
throw an "InvalidStateError" DOMException.
- Let request be the value of event's
-
target
- attribute.
+ target.
+
+ - Assert: request is an instance of
+ PaymentRequest.
- If request.[[\state]] is not
"interactive", then throw an
@@ -3350,13 +3339,6 @@
- Set request.[[\updating]] to true.
- - The user agent SHOULD disable the user interface that
- allows the user to accept the payment request. This is to ensure
- that the payment is not accepted until developers have made changes
- required by the change. Developers MUST settle the
- detailsPromise to indicate that the payment request is
- valid again.
-
- Run the update a
PaymentRequest
's details
algorithm with detailsPromise and
request.
@@ -3706,12 +3688,18 @@
timeout is a fatal error for the payment request.
+ -
+ In parallel, disable the user interface that allows the user
+ to accept the payment request. This is to ensure that the payment
+ is not accepted until the user interface is updated with any new
+ details.
+
-
Upon rejection of detailsPromise:
-
- Abort the update with an "AbortError"
- DOMException.
+ Abort the update with request and an
+ "AbortError" DOMException.
@@ -3722,7 +3710,8 @@
- Let details be the result of converting value to a
PaymentDetailsUpdate dictionary. If this throws an
- exception, abort the update with the thrown exception.
+ exception, abort the update with request and
+ with the thrown exception.
- Let serializedModifierData be an empty list.
@@ -3737,11 +3726,11 @@
member of details is present, then:
-
- Check and canonicalize total
+ Check and canonicalize total amount
details.total.amount. If an exception is
- thrown, then abort the update with that
- exception.
+ thrown, then abort the update with
+ request and that exception.
@@ -3753,8 +3742,8 @@
Check and canonicalize amount
item.amount. If an exception is
- thrown, then abort the update with that
- exception.
+ thrown, then abort the update with
+ request and that exception.
@@ -3764,37 +3753,32 @@
"PaymentOptions.requestShipping">requestShipping is true,
then:
- - Set shippingOptions to
- details.shippingOptions.
-
- - Let seenIDs be an empty list.
+
- Let seenIDs be an empty set.
- For each option in
- shippingOptions:
+ details.shippingOptions:
-
Check and canonicalize amount
option.amount. If an
exception is thrown, then abort the update
- with that exception.
+ with request and that exception.
-
- If seenIDs contains
- option.id, then abort the
- update with a TypeError.
+ If seenIDs[option.id] exists, then
+ abort the update with request and a
+ TypeError.
- - Otherwise, append option.Append option.id to
seenIDs.
-
-
- - For each option in
- shippingOptions:
-
+ - Append option to
+ shippingOptions.
+
- If option.selected is
true, then set selectedShippingOption to
@@ -3825,19 +3809,20 @@
modifier.supportedMethods.
If it returns false, then abort the update
- with a RangeError exception. Optional,
- inform the developer that the payment method
- identifier is invalid.
+ with request and a RangeError
+ exception. Optionally, inform the developer that
+ the payment method identifier is invalid.
- If the total member of modifier
is present, then:
-
- Check and canonicalize total
+ Check and canonicalize total amount
modifier.total.amount. If an
exception is thrown, then abort the
- update with that exception.
+ update with request and that
+ exception.
@@ -3851,7 +3836,8 @@
item.amount. If an
exception is thrown, then abort the
- update with that exception.
+ update with request and that
+ exception.
@@ -3863,8 +3849,8 @@
modifier.data into a
string. If JSON-serializing throws an
- exception, then abort the update with that
- exception.
+ exception, then abort the update with
+ request and that exception.
Add serializedData to
serializedModifierData.
@@ -3948,35 +3934,45 @@
- In either case, run the following steps, after either the upon
- rejection or upon fulfillment steps have concluded:
-
- - Set request.[[\updating]] to false.
-
- - The user agent SHOULD update the user interface based
- on any changed values in request. If appropriate, the
- user agent SHOULD re-enable user interface elements that might
- have been disabled prior to running this algorithm.
-
-
-
-
-
- If any of the above steps say to abort the update with an
- exception exception, then:
-
-
- - Abort the current user interaction and close down any remaining
- user interface.
-
- - Set request.[[\state]] to "closed".
-
- - Reject the promise request.[[\acceptPromise]]
- with exception.
+
- Set request.[[\updating]] to false.
- - Abort the algorithm.
+
- Update the user interface based on any changed values in
+ request. Re-enable user interface elements disabled prior
+ to running this algorithm.
+