From 7a1372d7b13007843e84a0af7b04ee5f11b74b5e Mon Sep 17 00:00:00 2001
From: Marcos Caceres
Date: Mon, 2 Mar 2026 17:43:32 +1100
Subject: [PATCH 1/3] fix: use InvalidStateError for non-fully-active document
checks
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Per TAG Design Principles ยง3.2.2, InvalidStateError should be used
for document state issues, while AbortError is reserved for
user-initiated aborts.
See: https://www.w3.org/TR/design-principles/#handle-non-fully-active-documents
---
index.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/index.html b/index.html
index 044b2124..f22897d2 100644
--- a/index.html
+++ b/index.html
@@ -1043,7 +1043,7 @@
If |document| is
not [=Document/fully active=], then return a promise rejected
- with an {{"AbortError"}} {{DOMException}}.
+ with an {{"InvalidStateError"}} {{DOMException}}.
If |document|'s [=Document/visibility state=] is not `"visible"`,
then return a promise rejected with an {{"AbortError"}}
@@ -2488,7 +2488,7 @@
If
|document| is not [=Document/fully active=], then return a promise
- rejected with an {{"AbortError"}} {{DOMException}}.
+ rejected with an {{"InvalidStateError"}} {{DOMException}}.
If |response|.{{PaymentResponse/[[complete]]}} is true, return
a promise rejected with an {{"InvalidStateError"}}
From 9fe470425702fbf6150e8377c4aefa53a3e3fb44 Mon Sep 17 00:00:00 2001
From: Marcos Caceres
Date: Tue, 3 Mar 2026 18:36:11 +1100
Subject: [PATCH 2/3] Add Aborts for when transitioned to non-fully-active
---
index.html | 31 ++++++++++++++++++++++++++-----
1 file changed, 26 insertions(+), 5 deletions(-)
diff --git a/index.html b/index.html
index f22897d2..2448adfd 100644
--- a/index.html
+++ b/index.html
@@ -1331,9 +1331,17 @@
- Close down the user interface.
+ - Set |request|.{{PaymentRequest/[[state]]}} to
+ "[=PaymentRequest/closed=]".
+
- Set |request|'s payment-relevant browsing context's
payment request is showing boolean to false.
+ -
+ Queue a task on the user interaction task source
+ to [=reject=] |acceptPromise| with an {{"AbortError"}}
+ {{DOMException}}.
+
@@ -2589,9 +2597,17 @@
- Close down the user interface.
+ - Set |request|.{{PaymentRequest/[[state]]}} to
+ "[=PaymentRequest/closed=]".
+
- Set |request|'s payment-relevant browsing context's
payment request is showing boolean to false.
+ -
+ Queue a task on the user interaction task source
+ to [=reject=] |retryPromise| with an {{"AbortError"}}
+ {{DOMException}}.
+
Finally, when |retryPromise| settles, set
@@ -2920,6 +2936,11 @@
Set |request|'s payment-relevant browsing context's
payment request is showing boolean to false.
+
+ Queue a task on the user interaction task source
+ to [=reject=] |promise| with an {{"AbortError"}}
+ {{DOMException}}.
+
Otherwise:
@@ -4430,11 +4451,11 @@
data models used by existing payment methods, prescribing data
specifics in this API would limit its usefulness. The
{{PaymentResponse/details}} member carries data from the payment
- handler, whether Web-based (as defined by the [[[web-based-payment-handler]]])
- or proprietary. The [=user agent=] MUST NOT support payment handlers
- unless they include adequate user consent mechanisms (such as
- awareness of parties to the transaction and mechanisms for
- demonstrating the intention to share data).
+ handler, whether Web-based (as defined by the
+ [[[web-based-payment-handler]]]) or proprietary. The [=user agent=]
+ MUST NOT support payment handlers unless they include adequate user
+ consent mechanisms (such as awareness of parties to the transaction
+ and mechanisms for demonstrating the intention to share data).
The user agent MUST NOT share the values of the
From 0f898c07927ca478081a6a059fe943f394282387 Mon Sep 17 00:00:00 2001
From: Marcos Caceres
Date: Wed, 4 Mar 2026 01:11:30 +1100
Subject: [PATCH 3/3] Check canMakePayment
---
index.html | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/index.html b/index.html
index 2448adfd..6a635bd4 100644
--- a/index.html
+++ b/index.html
@@ -3525,6 +3525,13 @@
"[=PaymentRequest/created=]", then return a promise rejected
with an {{"InvalidStateError"}} {{DOMException}}.
+
Let |document| be |request|'s [=relevant global object=]'s
+ [=associated `Document`=].
+
+ If |document| is not [=Document/fully active=], then return
+ a promise rejected with an {{"InvalidStateError"}}
+ {{DOMException}}.
+
Optionally, at the top-level browsing
context's discretion, return a promise rejected with a
{{"NotAllowedError"}} {{DOMException}}.