From 81bb1111676340514b5b1a247ec74ce312394f05 Mon Sep 17 00:00:00 2001 From: Ade Bateman Date: Thu, 26 May 2016 14:34:26 -0700 Subject: [PATCH] Fix bug in updateWith algorithm that resets shippingOption if you don't provide a new sequence --- specs/paymentrequest.html | 45 ++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/specs/paymentrequest.html b/specs/paymentrequest.html index 0b624bf2..d0f85ebb 100644 --- a/specs/paymentrequest.html +++ b/specs/paymentrequest.html @@ -1058,7 +1058,7 @@

PaymentRequestUpdateEvent

If the web page wishes to update the payment request then it should call updateWith and provide a promise that will resolve with a PaymentDetails dictionary containing changed values that the user agent SHOULD present to the user.

-

The PaymentRequestUpdateEvent constructor MUST set the internal slot [[\waitForUpdate]] +

The PaymentRequestUpdateEvent constructor MUST set the internal slot [[\waitForUpdate]] to false.

The updateWith method MUST act as follows:

    @@ -1110,25 +1110,30 @@

    PaymentRequestUpdateEvent

    this value to the displayItems field of target@[[\details]].
  1. - If details contains a shippingOptions sequence, then - copy this value to the shippingOptions field of target@[[\details]]. -
  2. -
  3. Let newOption be null.
  4. -
  5. - If details contains a shippingOptions sequence with a - length of 1, then set newOption to the id of the only - ShippingOption in the sequence. -
  6. -
  7. - If details contains a shippingOptions sequence with a - length greater than 1, and if any ShippingOption in the sequence - has the selected field set to true, then set - newOption to the id of the last ShippingOption - in the sequence with selected set to true. -
  8. -
  9. - Set the value of shippingOption on target to - newOption. + If details contains a shippingOptions sequence, then: +
      +
    1. + Copy the shippingOptions sequence from details to the + shippingOptions field of target@[[\details]]. +
    2. +
    3. Let newOption be null.
    4. +
    5. + If details contains a shippingOptions sequence with a + length of 1, then set newOption to the id of the only + ShippingOption in the sequence. +
    6. +
    7. + If details contains a shippingOptions sequence with a + length greater than 1, and if any ShippingOption in the sequence + has the selected field set to true, then set + newOption to the id of the last ShippingOption + in the sequence with selected set to true. +
    8. +
    9. + Set the value of shippingOption on target to + newOption. +
    10. +