Skip to content

Commit 00a0976

Browse files
editorial: small non-normative bug fixes (w3c#719)
1 parent 80638c5 commit 00a0976

File tree

1 file changed

+91
-95
lines changed

1 file changed

+91
-95
lines changed

index.html

Lines changed: 91 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ <h2>
650650
<ol>
651651
<li data-tests=
652652
"payment-request-ctor-currency-code-checks.https.html">
653-
<a>Check and canonicalize total</a>
653+
<a>Check and canonicalize total amount</a>
654654
<var>details</var>.<a>total</a>.<a data-lt=
655655
"PaymentItem.amount">amount</a>. Rethrow any exceptions.
656656
</li>
@@ -680,13 +680,11 @@ <h2>
680680
<li>If the <a>shippingOptions</a> member of <var>details</var> is
681681
present, then:
682682
<ol data-link-for="PaymentShippingOption">
683-
<li>Let <var>seenIDs</var> be an empty list.
683+
<li>Let <var>seenIDs</var> be an empty set.
684684
</li>
685-
<li>Set <var>options</var> to
685+
<li>For each <var>option</var> in
686686
<var>details</var>.<a data-link-for=
687-
"PaymentDetailsBase">shippingOptions</a>.
688-
</li>
689-
<li>For each <var>option</var> in <var>options</var>:
687+
"PaymentDetailsBase">shippingOptions</a>:
690688
<ol>
691689
<li data-tests=
692690
"payment-request-ctor-currency-code-checks.https.html">
@@ -703,10 +701,6 @@ <h2>
703701
<li>Otherwise, append <var>option</var>.<a>id</a> to
704702
<var>seenIDs</var>.
705703
</li>
706-
</ol>
707-
</li>
708-
<li>For each <var>option</var> in <var>options</var>:
709-
<ol>
710704
<li>If <var>option</var>.<a>selected</a> is true, then
711705
set <var>selectedShippingOption</var> to
712706
<var>option</var>.<a>id</a>.
@@ -743,7 +737,7 @@ <h2>
743737
<ol>
744738
<li data-tests=
745739
"payment-request-ctor-currency-code-checks.https.html">
746-
<a>Check and canonicalize total</a>
740+
<a>Check and canonicalize total amount</a>
747741
<var>modifier</var>.<a data-lt=
748742
"PaymentDetailsModifier.total">total</a>.<a data-lt="PaymentItem.amount">amount</a>.
749743
Rethrow any exceptions.
@@ -989,9 +983,6 @@ <h2>
989983
<ol>
990984
<li>Set <var>request</var>.<a>[[\updating]]</a> to true.
991985
</li>
992-
<li>Disable the user interface user interface that will allow the
993-
user to interact with the <var>handlers</var>
994-
</li>
995986
<li>Run the <a>update a <code>PaymentRequest</code>'s details
996987
algorithm</a> with <var>detailsPromise</var> and
997988
<var>request</var>.
@@ -1548,14 +1539,9 @@ <h3>
15481539
steps:
15491540
</p>
15501541
<ol data-link-for="PaymentCurrencyAmount">
1551-
<li>Let <var>isValidCurrency</var> be the result of calling
1552-
<a data-cite=
1553-
"!ecma-402#sec-iswellformedcurrencycode">IsWellFormedCurrencyCode</a>
1554-
abstract operation with <var>amount</var>.<a>currency</a> as the
1555-
argument.
1556-
</li>
1557-
<li>If <var>isValidCurrency</var> is false, then throw a
1558-
<a>RangeError</a> exception and terminate this algorithm, optionally
1542+
<li>If the result of <a data-cite=
1543+
"!ecma-402#sec-iswellformedcurrencycode">IsWellFormedCurrencyCode</a>(<var>amount</var>.<a>currency</a>)
1544+
is false, then throw a <a>RangeError</a> exception, optionally
15591545
informing the developer that the currency is invalid.
15601546
</li>
15611547
<li>If <var>amount</var>.<a>value</a> is not a <a>valid decimal
@@ -1568,18 +1554,18 @@ <h3>
15681554
</li>
15691555
</ol>
15701556
<p>
1571-
To <dfn>check and canonicalize total</dfn> given a
1572-
<a>PaymentCurrencyAmount</a> <var>total</var>, run the following
1557+
To <dfn>check and canonicalize total amount</dfn> given a
1558+
<a>PaymentCurrencyAmount</a> <var>amount</var>, run the following
15731559
steps:
15741560
</p>
15751561
<ol data-link-for="PaymentCurrencyAmount">
15761562
<li>
15771563
<a>Check and canonicalize amount</a> <var>amount</var>. Rethrow any
15781564
exceptions.
15791565
</li>
1580-
<li>If the first <a>code point</a> of <var>value</var> is U+002D (-),
1581-
then throw a <a>TypeError</a> optionally informing the developer that
1582-
a total can't be a negative number.
1566+
<li>If the first <a>code point</a> of <var>amount</var>.<a>value</a>
1567+
is U+002D (-), then throw a <a>TypeError</a> optionally informing the
1568+
developer that a total's value can't be a negative number.
15831569
</li>
15841570
</ol>
15851571
<aside class="note" title="No alteration of values">
@@ -3319,7 +3305,8 @@ <h2>
33193305
</aside>
33203306
<p data-tests=
33213307
"payment-request-update-event-updatewith-method.https.html, PaymentRequestUpdateEvent/updateWith-incremental-update-manual.https.html">
3322-
The <a>updateWith(detailsPromise)</a> method MUST act as follows:
3308+
The <a><code>updateWith(<var>detailsPromise</var>)</code></a>
3309+
method MUST act as follows:
33233310
</p>
33243311
<ol class="algorithm">
33253312
<li>Let <var>event</var> be this <a>PaymentRequestUpdateEvent</a>
@@ -3333,8 +3320,10 @@ <h2>
33333320
throw</a> an "<a>InvalidStateError</a>" <a>DOMException</a>.
33343321
</li>
33353322
<li>Let <var>request</var> be the value of <var>event</var>'s
3336-
<code><a data-cite="DOM#dom-event-target">target</a></code>
3337-
attribute.
3323+
<a data-cite="DOM#event-target">target</a>.
3324+
</li>
3325+
<li>Assert: <var>request</var> is an instance of
3326+
<a>PaymentRequest</a>.
33383327
</li>
33393328
<li>If <var>request</var>.<a>[[\state]]</a> is not
33403329
"<a>interactive</a>", then <a>throw</a> an
@@ -3350,13 +3339,6 @@ <h2>
33503339
</li>
33513340
<li>Set <var>request</var>.<a>[[\updating]]</a> to true.
33523341
</li>
3353-
<li>The <a>user agent</a> SHOULD disable the user interface that
3354-
allows the user to accept the payment request. This is to ensure
3355-
that the payment is not accepted until developers have made changes
3356-
required by the change. Developers MUST settle the
3357-
<var>detailsPromise</var> to indicate that the payment request is
3358-
valid again.
3359-
</li>
33603342
<li>Run the <a>update a <code>PaymentRequest</code>'s details
33613343
algorithm</a> with <var>detailsPromise</var> and
33623344
<var>request</var>.
@@ -3706,12 +3688,18 @@ <h2>
37063688
timeout is a fatal error for the payment request.
37073689
</p>
37083690
<ol class="algorithm">
3691+
<li>
3692+
<a>In parallel</a>, disable the user interface that allows the user
3693+
to accept the payment request. This is to ensure that the payment
3694+
is not accepted until the user interface is updated with any new
3695+
details.
3696+
</li>
37093697
<li>
37103698
<a>Upon rejection</a> of <var>detailsPromise</var>:
37113699
<ol>
37123700
<li>
3713-
<a>Abort the update</a> with an "<a>AbortError</a>"
3714-
<a>DOMException</a>.
3701+
<a>Abort the update</a> with <var>request</var> and an
3702+
"<a>AbortError</a>" <a>DOMException</a>.
37153703
</li>
37163704
</ol>
37173705
</li>
@@ -3722,7 +3710,8 @@ <h2>
37223710
<li>Let <var>details</var> be the result of <a data-cite=
37233711
"!WEBIDL#es-dictionary">converting</a> <var>value</var> to a <a>
37243712
PaymentDetailsUpdate</a> dictionary. If this <a>throws</a> an
3725-
exception, <a>abort the update</a> with the thrown exception.
3713+
exception, <a>abort the update</a> with <var>request</var> and
3714+
with the thrown exception.
37263715
</li>
37273716
<li>Let <var>serializedModifierData</var> be an empty list.
37283717
</li>
@@ -3737,11 +3726,11 @@ <h2>
37373726
member of <var>details</var> is present, then:
37383727
<ol>
37393728
<li>
3740-
<a>Check and canonicalize total</a>
3729+
<a>Check and canonicalize total amount</a>
37413730
<var>details</var>.<a>total</a>.<a data-lt=
37423731
"PaymentItem.amount">amount</a>. If an exception is
3743-
thrown, then <a>abort the update</a> with that
3744-
exception.
3732+
thrown, then <a>abort the update</a> with
3733+
<var>request</var> and that exception.
37453734
</li>
37463735
</ol>
37473736
</li>
@@ -3753,8 +3742,8 @@ <h2>
37533742
<a>Check and canonicalize amount</a>
37543743
<var>item</var>.<a data-lt=
37553744
"PaymentItem.amount">amount</a>. If an exception is
3756-
thrown, then <a>abort the update</a> with that
3757-
exception.
3745+
thrown, then <a>abort the update</a> with
3746+
<var>request</var> and that exception.
37583747
</li>
37593748
</ol>
37603749
</li>
@@ -3764,37 +3753,32 @@ <h2>
37643753
"PaymentOptions.requestShipping">requestShipping</a> is true,
37653754
then:
37663755
<ol>
3767-
<li>Set <var>shippingOptions</var> to
3768-
<var>details</var>.<a>shippingOptions</a>.
3769-
</li>
3770-
<li>Let <var>seenIDs</var> be an empty list.
3756+
<li>Let <var>seenIDs</var> be an empty set.
37713757
</li>
37723758
<li>For each <var>option</var> in
3773-
<var>shippingOptions</var>:
3759+
<var>details</var>.<a>shippingOptions</a>:
37743760
<ol>
37753761
<li>
37763762
<a>Check and canonicalize amount</a>
37773763
<var>option</var>.<a data-lt=
37783764
"PaymentShippingOption.amount">amount</a>. If an
37793765
exception is thrown, then <a>abort the update</a>
3780-
with that exception.
3766+
with <var>request</var> and that exception.
37813767
</li>
37823768
<li data-tests=
37833769
"PaymentRequestUpdateEvent/updateWith-duplicate-shipping-options-manual.https.html">
3784-
If <var>seenIDs</var> contains
3785-
<var>option</var>.<a data-lt=
3786-
"PaymentShippingOption.id">id</a>, then <a>abort the
3787-
update</a> with a <a>TypeError</a>.
3770+
If <var>seenIDs</var>[<var>option</var>.<a data-lt=
3771+
"PaymentShippingOption.id">id</a>] exists, then
3772+
<a>abort the update</a> with <var>request</var> and a
3773+
<a>TypeError</a>.
37883774
</li>
3789-
<li>Otherwise, append <var>option</var>.<a data-lt=
3775+
<li>Append <var>option</var>.<a data-lt=
37903776
"PaymentShippingOption.id">id</a> to
37913777
<var>seenIDs</var>.
37923778
</li>
3793-
</ol>
3794-
</li>
3795-
<li>For each <var>option</var> in
3796-
<var>shippingOptions</var>:
3797-
<ol>
3779+
<li>Append <var>option</var> to
3780+
<var>shippingOptions</var>.
3781+
</li>
37983782
<li>If <var>option</var>.<a data-lt=
37993783
"PaymentShippingOption.selected">selected</a> is
38003784
true, then set <var>selectedShippingOption</var> to
@@ -3825,19 +3809,20 @@ <h2>
38253809
<var>modifier</var>.<a data-lt=
38263810
"PaymentDetailsModifier.supportedMethods">supportedMethods</a>.
38273811
If it returns false, then <a>abort the update</a>
3828-
with a <a>RangeError</a> exception. Optional,
3829-
inform the developer that the payment method
3830-
identifier is invalid.
3812+
with <var>request</var> and a <a>RangeError</a>
3813+
exception. Optionally, inform the developer that
3814+
the payment method identifier is invalid.
38313815
</li>
38323816
<li>If the <a>total</a> member of <var>modifier</var>
38333817
is present, then:
38343818
<ol>
38353819
<li>
3836-
<a>Check and canonicalize total</a>
3820+
<a>Check and canonicalize total amount</a>
38373821
<var>modifier</var>.<a>total</a>.<a data-lt=
38383822
"PaymentItem.amount">amount</a>. If an
38393823
exception is thrown, then <a>abort the
3840-
update</a> with that exception.
3824+
update</a> with <var>request</var> and that
3825+
exception.
38413826
</li>
38423827
</ol>
38433828
</li>
@@ -3851,7 +3836,8 @@ <h2>
38513836
<var>item</var>.<a data-lt=
38523837
"PaymentItem.amount">amount</a>. If an
38533838
exception is thrown, then <a>abort the
3854-
update</a> with that exception.
3839+
update</a> with <var>request</var> and that
3840+
exception.
38553841
</li>
38563842
</ol>
38573843
</li>
@@ -3863,8 +3849,8 @@ <h2>
38633849
<var>modifier</var>.<a data-lt=
38643850
"PaymentDetailsModifier.data">data</a> into a
38653851
string. If <a>JSON-serializing</a> throws an
3866-
exception, then <a>abort the update</a> with that
3867-
exception.
3852+
exception, then <a>abort the update</a> with
3853+
<var>request</var> and that exception.
38683854
</li>
38693855
<li>Add <var>serializedData</var> to
38703856
<var>serializedModifierData</var>.
@@ -3948,35 +3934,45 @@ <h2>
39483934
</li>
39493935
</ol>
39503936
</li>
3951-
<li>In either case, run the following steps, after either the upon
3952-
rejection or upon fulfillment steps have concluded:
3953-
<ol>
3954-
<li>Set <var>request</var>.<a>[[\updating]]</a> to false.
3955-
</li>
3956-
<li>The <a>user agent</a> SHOULD update the user interface based
3957-
on any changed values in <var>request</var>. If appropriate, the
3958-
user agent SHOULD re-enable user interface elements that might
3959-
have been disabled prior to running this algorithm.
3960-
</li>
3961-
</ol>
3962-
</li>
3963-
</ol>
3964-
<p>
3965-
If any of the above steps say to <dfn>abort the update</dfn> with an
3966-
exception <var>exception</var>, then:
3967-
</p>
3968-
<ol>
3969-
<li>Abort the current user interaction and close down any remaining
3970-
user interface.
3971-
</li>
3972-
<li>Set <var>request</var>.<a>[[\state]]</a> to "<a>closed</a>".
3973-
</li>
3974-
<li>Reject the promise <var>request</var>.<a>[[\acceptPromise]]</a>
3975-
with <var>exception</var>.
3937+
<li>Set <var>request</var>.<a>[[\updating]]</a> to false.
39763938
</li>
3977-
<li>Abort the algorithm.
3939+
<li>Update the user interface based on any changed values in
3940+
<var>request</var>. Re-enable user interface elements disabled prior
3941+
to running this algorithm.
39783942
</li>
39793943
</ol>
3944+
<section>
3945+
<h2>
3946+
Abort the update
3947+
</h2>
3948+
<p>
3949+
To <dfn>abort the update</dfn> with a <a>PaymentRequest</a>
3950+
<var>request</var> and <a data-cite=
3951+
"WEBIDL#dfn-exception">exception</a> <var>exception</var>:
3952+
</p>
3953+
<ol class="algorithm">
3954+
<li>Abort the current user interaction and close down any remaining
3955+
user interface.
3956+
</li>
3957+
<li>
3958+
<a>Queue a task</a> on the <a>user interaction task source</a> to
3959+
perform the following steps:
3960+
<ol>
3961+
<li>Set <var>request</var>.<a>[[\state]]</a> to
3962+
"<a>closed</a>".
3963+
</li>
3964+
<li>Reject the promise
3965+
<var>request</var>.<a>[[\acceptPromise]]</a> with
3966+
<var>exception</var>.
3967+
</li>
3968+
<li>Set <var>request</var>.<a>[[\updating]]</a> to false.
3969+
</li>
3970+
</ol>
3971+
</li>
3972+
<li>Abort the algorithm.
3973+
</li>
3974+
</ol>
3975+
</section>
39803976
<div class="note">
39813977
<p>
39823978
<a data-lt="abort the update">Aborting the update</a> is performed

0 commit comments

Comments
 (0)