Skip to content

Commit 9e339d0

Browse files
author
Marcos Cáceres
authored
Throw on dup shippingOptions ids (w3c#596)
* closes w3c#594
1 parent 8307698 commit 9e339d0

File tree

1 file changed

+14
-19
lines changed

1 file changed

+14
-19
lines changed

index.html

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -647,17 +647,16 @@ <h2>
647647
exceptions.
648648
</li>
649649
<li>If <var>seenIDs</var> contains
650-
<var>option</var>.<a>id</a>, then set <var>options</var>
651-
to an empty sequence and break.
650+
<var>option</var>.<a>id</a>, then throw a
651+
<a>TypeError</a>. Optionally, inform the developer that
652+
shipping option IDs must be unique.
652653
</li>
653-
<li>Append <var>option</var>.<a>id</a> to
654+
<li>Otherwise, append <var>option</var>.<a>id</a> to
654655
<var>seenIDs</var>.
655656
</li>
656657
</ol>
657658
</li>
658-
<li>For each <var>option</var> in <var>options</var> (which
659-
may have been reset to the empty sequence in the previous
660-
step):
659+
<li>For each <var>option</var> in <var>options</var>:
661660
<ol>
662661
<li>If <var>option</var>.<a>selected</a> is true, then
663662
set <var>selectedShippingOption</var> to
@@ -1512,11 +1511,6 @@ <h2>
15121511
<dd>
15131512
A sequence containing the different shipping options for the user
15141513
to choose from.
1515-
<p>
1516-
If the sequence is empty, then this indicates that the merchant
1517-
cannot ship to the current <a data-lt=
1518-
"PaymentRequest.shippingAddress">shippingAddress</a>.
1519-
</p>
15201514
<p>
15211515
If an item in the sequence has the <a data-lt=
15221516
"PaymentShippingOption.selected">selected</a> member set to true,
@@ -2555,20 +2549,21 @@ <h2>
25552549
exception is thrown, then <a>abort the update</a>
25562550
with that exception.
25572551
</li>
2558-
<li>If <var>seenIDs</var> contains
2552+
<li data-tests=
2553+
"PaymentRequestUpdateEvent/updateWith-duplicate-shipping-options-manual.https.html">
2554+
If <var>seenIDs</var> contains
25592555
<var>option</var>.<a data-lt=
2560-
"PaymentShippingOption.id">id</a>, then set
2561-
<var>options</var> to an empty sequence and break.
2556+
"PaymentShippingOption.id">id</a>, then <a>abort
2557+
the update</a> with a <a>TypeError</a>.
25622558
</li>
2563-
<li>Append <var>option</var>.<a data-lt=
2564-
"PaymentShippingOption.id">id</a> to
2565-
<var>seenIDs</var>.
2559+
<li>Otherwise, append
2560+
<var>option</var>.<a data-lt="PaymentShippingOption.id">id</a>
2561+
to <var>seenIDs</var>.
25662562
</li>
25672563
</ol>
25682564
</li>
25692565
<li>For each <var>option</var> in
2570-
<var>shippingOptions</var> (which may have been reset
2571-
to the empty sequence in the previous step):
2566+
<var>shippingOptions</var>:
25722567
<ol>
25732568
<li>If <var>option</var>.<a data-lt=
25742569
"PaymentShippingOption.selected">selected</a> is

0 commit comments

Comments
 (0)