From 66032fd180659610f67e1f6ec34a27da0b83eff9 Mon Sep 17 00:00:00 2001 From: Marcos Caceres Date: Thu, 23 Feb 2017 14:04:42 +1100 Subject: [PATCH] editorial: dfn payment request states as strings (closes #376) --- index.html | 89 ++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 60 insertions(+), 29 deletions(-) diff --git a/index.html b/index.html index 92701fb6..e3f52700 100644 --- a/index.html +++ b/index.html @@ -544,7 +544,7 @@

  • Set request.[[\options]] to options.
  • -
  • Set request.[[\state]] to created. +
  • Set request.[[\state]] to "created".
  • Set request.[[\updating]] to false.
  • @@ -609,11 +609,11 @@

    which the method is called.
  • If the value of request.[[\state]] is not - created then throw an "InvalidStateError" - DOMException. + "created" then throw an "InvalidStateError" + DOMException.
  • Set the value of request.[[\state]] to - interactive. + "interactive".
  • Let acceptPromise be a new Promise.
  • @@ -691,7 +691,7 @@

    which the method is called.
  • If the value of request.[[\state]] is not - interactive then throw an "InvalidStateError" + "interactive" then throw an "InvalidStateError" DOMException.
  • Let promise be a new Promise. @@ -711,7 +711,7 @@

    DOMException and abort these steps.

  • Set the value of the internal slot - request.[[\state]] to closed. + request.[[\state]] to "closed".
  • Reject the promise request.[[\acceptPromise]] with an @@ -745,7 +745,7 @@

  • Let request be the PaymentRequest object on which the method was called.
  • -
  • If request.[[\state]] is not created, +
  • If request.[[\state]] is not "created", then return a promise rejected with an "InvalidStateError" DOMException.
  • @@ -879,8 +879,47 @@

    [[\state]] - The current state of the payment request. +

    + The current state of the payment request, which + transitions from: +

    +
    +
    + "created" +
    +
    + The payment request is constructed and has not been presented + to the user. +
    +
    + "interactive" +
    +
    + The payment request is being presented to the user. +
    +
    + "closed" +
    +
    + The payment request completed. +
    +
    +

    + The state transitions are illustrated in the figure below: +

    +
    + +
    + The constructor sets the initial state to + "created". The show() method changes the + state to "interactive". From there, the + abort() method or any other error can send the + state to "closed"; similarly, the user + accepts the payment request algorithm will change the + state to "closed". +
    +
    @@ -904,14 +943,6 @@

    -
    -

    - The internal slot [[\state]] transitions between its various - potential values as follows: -

    - -
    throw an "InvalidStateError" DOMException.

  • If target.[[\state]] is not - interactive, then throw an "InvalidStateError" - DOMException. + "interactive", then throw an + "InvalidStateError" DOMException.
  • If target.[[\updating]] is true, then throw an "InvalidStateError" DOMException. @@ -1902,7 +1933,7 @@

  • Abort the current user interaction and close down any remaining user interface.
  • -
  • Set target.[[\state]] to closed. +
  • Set target.[[\state]] to "closed".
  • Reject the promise target.[[\acceptPromise]] with an @@ -2152,8 +2183,8 @@

    When the internal slot [[\state]] of a PaymentRequest - object is set to interactive, the user agent will trigger - the following algorithms based on user interaction. + object is set to "interactive", the user agent will + trigger the following algorithms based on user interaction.

    @@ -2233,9 +2264,9 @@

    may take place at a time. This should never occur.

  • If the request.[[\state]] is not set to - interactive, then terminate this algorithm and take no further - action. The user agent user interface should ensure that this - never occurs. + "interactive", then terminate this algorithm and take no + further action. The user agent user interface should ensure + that this never occurs.
  • Let event be a new PaymentRequestUpdateEvent.
  • @@ -2264,9 +2295,9 @@

    agent user interface should ensure that this never occurs.

  • If request.[[\state]] is not - interactive, then terminate this algorithm and take no further - action. The user agent user interface should ensure that this - never occurs. + "interactive", then terminate this algorithm and take no + further action. The user agent user interface should ensure + that this never occurs.
  • If the requestShipping value of @@ -2332,7 +2363,7 @@

  • Set response.[[\completeCalled]] to false.
  • -
  • Set request.[[\state]] to closed. +
  • Set request.[[\state]] to "closed".
  • Resolve the pending promise request.[[\acceptPromise]] with