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 @@

  1. - Check and canonicalize total + Check and canonicalize total amount details.total.amount. Rethrow any exceptions.
  2. @@ -680,13 +680,11 @@

  3. If the shippingOptions member of details is present, then:
      -
    1. Let seenIDs be an empty list. +
    2. Let seenIDs be an empty set.
    3. -
    4. Set options to +
    5. For each option in details.shippingOptions. -
    6. -
    7. For each option in options: + "PaymentDetailsBase">shippingOptions:
      1. @@ -703,10 +701,6 @@

      2. Otherwise, append option.id to seenIDs.
      3. -

      -
    8. -
    9. For each option in options: -
      1. If option.selected is true, then set selectedShippingOption to option.id. @@ -743,7 +737,7 @@

        1. - Check and canonicalize total + Check and canonicalize total amount modifier.total.amount. Rethrow any exceptions. @@ -989,9 +983,6 @@

          1. Set request.[[\updating]] to true.
          2. -
          3. Disable the user interface user interface that will allow the - user to interact with the handlers -
          4. Run the update a PaymentRequest's details algorithm with detailsPromise and request. @@ -1548,14 +1539,9 @@

            steps:

              -
            1. Let isValidCurrency be the result of calling - IsWellFormedCurrencyCode - abstract operation with amount.currency as the - argument. -
            2. -
            3. If isValidCurrency is false, then throw a - RangeError exception and terminate this algorithm, optionally +
            4. If the result of IsWellFormedCurrencyCode(amount.currency) + is false, then throw a RangeError exception, optionally informing the developer that the currency is invalid.
            5. 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. -
            1. 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. +
            2. 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:

            1. Let event be this PaymentRequestUpdateEvent @@ -3333,8 +3320,10 @@

              throw an "InvalidStateError" DOMException.

            2. Let request be the value of event's - target - attribute. + target. +
            3. +
            4. Assert: request is an instance of + PaymentRequest.
            5. If request.[[\state]] is not "interactive", then throw an @@ -3350,13 +3339,6 @@

            6. Set request.[[\updating]] to true.
            7. -
            8. 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. -
            9. 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.

                +
              1. + 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. +
              2. Upon rejection of detailsPromise:
                1. - Abort the update with an "AbortError" - DOMException. + Abort the update with request and an + "AbortError" DOMException.
              3. @@ -3722,7 +3710,8 @@

              4. 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.
              5. Let serializedModifierData be an empty list.
              6. @@ -3737,11 +3726,11 @@

                member of details is present, then:
                1. - 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.

            10. @@ -3764,37 +3753,32 @@

              "PaymentOptions.requestShipping">requestShipping is true, then:
                -
              1. Set shippingOptions to - details.shippingOptions. -
              2. -
              3. Let seenIDs be an empty list. +
              4. Let seenIDs be an empty set.
              5. For each option in - shippingOptions: + details.shippingOptions:
                1. Check and canonicalize amount option.amount. If an exception is thrown, then abort the update - with that exception. + with request and that exception.
                2. - 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.
                3. -
                4. Otherwise, append option.Append option.id to seenIDs.
                5. -
                -
              6. -
              7. For each option in - shippingOptions: -
                  +
                1. Append option to + shippingOptions. +
                2. 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.

                3. If the total member of modifier is present, then:
                  1. - 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.
                4. @@ -3851,7 +3836,8 @@

                  item.amount. If an exception is thrown, then abort the - update with that exception. + update with request and that + exception.

              8. @@ -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.
              9. Add serializedData to serializedModifierData. @@ -3948,35 +3934,45 @@

              -
            11. In either case, run the following steps, after either the upon - rejection or upon fulfillment steps have concluded: -
                -
              1. Set request.[[\updating]] to false. -
              2. -
              3. 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. -
              4. -
              -
            12. -

            -

            - If any of the above steps say to abort the update with an - exception exception, then: -

            -
              -
            1. Abort the current user interaction and close down any remaining - user interface. -
            2. -
            3. Set request.[[\state]] to "closed". -
            4. -
            5. Reject the promise request.[[\acceptPromise]] - with exception. +
            6. Set request.[[\updating]] to false.
            7. -
            8. Abort the algorithm. +
            9. Update the user interface based on any changed values in + request. Re-enable user interface elements disabled prior + to running this algorithm.
            +
            +

            + Abort the update +

            +

            + To abort the update with a PaymentRequest + request and exception exception: +

            +
              +
            1. Abort the current user interaction and close down any remaining + user interface. +
            2. +
            3. + Queue a task on the user interaction task source to + perform the following steps: +
                +
              1. Set request.[[\state]] to + "closed". +
              2. +
              3. Reject the promise + request.[[\acceptPromise]] with + exception. +
              4. +
              5. Set request.[[\updating]] to false. +
              6. +
              +
            4. +
            5. Abort the algorithm. +
            6. +
            +

            Aborting the update is performed