fix: use InvalidStateError for non-fully-active document checks#1056
Open
marcoscaceres wants to merge 3 commits intogh-pagesfrom
Open
fix: use InvalidStateError for non-fully-active document checks#1056marcoscaceres wants to merge 3 commits intogh-pagesfrom
marcoscaceres wants to merge 3 commits intogh-pagesfrom
Conversation
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
Collaborator
|
I don't have any comments on this and defer to @stephenmcgruer |
Collaborator
|
LGTM; can you file implementation bugs against the various browsers, and also file an issue (or even update?) the relevant WPTs (if any exist) ? |
Member
Author
|
Filed WebKit bug and will update the tests. However, unfortunately I'm having issues filing the Chromium bug :( |
Member
Author
|
Tests - web-platform-tests/wpt#58210 |
Collaborator
|
Chrome bug filed - https://crbug.com/489361935 |
stephenmcgruer
approved these changes
Mar 3, 2026
marcoscaceres
added a commit
to marcoscaceres/WebKit
that referenced
this pull request
Mar 4, 2026
…ully active rdar://171593464 https://bugs.webkit.org/show_bug.cgi?id=309027 Reviewed by NOBODY (OOPS!). Uses InvalidStateError for when the API is called from a detatched document, and AbortError if script itself destroyed the script execution context/document. Spec change: w3c/payment-request#1056 Upstream WPT commit: web-platform-tests/wpt@c1c52b4 Test: imported/w3c/web-platform-tests/payment-request/rejects_if_not_active.https.html * LayoutTests/TestExpectations: * LayoutTests/http/tests/paymentrequest/page-cache-created-payment-response.https-expected.txt: * LayoutTests/http/tests/paymentrequest/page-cache-created-payment-response.https.html: * LayoutTests/http/tests/paymentrequest/page-cache-retried-payment-response.https-expected.txt: * LayoutTests/http/tests/paymentrequest/page-cache-retried-payment-response.https.html: * LayoutTests/http/tests/paymentrequest/payment-response-rejects-if-not-active.https.html: * LayoutTests/http/tests/paymentrequest/rejects_if_not_active.https.html: * LayoutTests/imported/w3c/resources/resource-files.json: * LayoutTests/imported/w3c/web-platform-tests/feature-policy/payment-allowed-by-feature-policy-attribute-redirect-on-load.https.sub-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/feature-policy/payment-allowed-by-feature-policy-attribute.https.sub-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/feature-policy/payment-allowed-by-feature-policy.https.sub-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/feature-policy/payment-default-feature-policy.https.sub-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/feature-policy/payment-disabled-by-feature-policy.https.sub-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/payment-request/META.yml: * LayoutTests/imported/w3c/web-platform-tests/payment-request/WEB_FEATURES.yml: Added. * LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-is-showing.https-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-is-showing.https.html: * LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-request-abort-method.https-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-request-show-method.https-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/payment-request/rejects_if_not_active.https-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/payment-request/rejects_if_not_active.https.html: * LayoutTests/imported/w3c/web-platform-tests/payment-request/w3c-import.log: * LayoutTests/imported/w3c/web-platform-tests/permissions-policy/payment-allowed-by-permissions-policy.https.sub-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/permissions-policy/payment-allowed-by-permissions-policy.https.sub.html: * LayoutTests/imported/w3c/web-platform-tests/permissions-policy/payment-disabled-by-permissions-policy.https.sub-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/permissions-policy/payment-disabled-by-permissions-policy.https.sub.html: * LayoutTests/imported/w3c/web-platform-tests/permissions-policy/payment-extension-allowed-by-permissions-policy-attribute.https.sub.html: Added. * LayoutTests/imported/w3c/web-platform-tests/permissions-policy/payment-supported-by-permissions-policy.tentative.html: * LayoutTests/platform/ios/TestExpectations: * LayoutTests/platform/mac-wk2/TestExpectations: * LayoutTests/tests-options.json: * Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp: (WebCore::PaymentRequest::show): (WebCore::PaymentRequest::canMakePayment): * Source/WebCore/Modules/paymentrequest/PaymentResponse.cpp: (WebCore::PaymentResponse::complete): (WebCore::PaymentResponse::retry): * Source/WebCore/Modules/paymentrequest/PaymentResponse.h: * Source/WebCore/Modules/paymentrequest/PaymentResponse.idl:
Member
Author
|
Sent a PR to patch WebKit ... and fixed a bunch of WPTs!!! web-platform-tests/wpt#58210 Worthwhile change. 🕺 |
marcoscaceres
added a commit
to marcoscaceres/WebKit
that referenced
this pull request
Mar 4, 2026
…ully active rdar://171593464 https://bugs.webkit.org/show_bug.cgi?id=309027 Reviewed by NOBODY (OOPS!). Uses InvalidStateError for when the API is called from a detatched document, and AbortError if script itself destroyed the script execution context/document. Spec change: w3c/payment-request#1056 Upstream WPT commit: web-platform-tests/wpt@c1c52b4 Test: imported/w3c/web-platform-tests/payment-request/rejects_if_not_active.https.html * LayoutTests/TestExpectations: * LayoutTests/http/tests/paymentrequest/page-cache-created-payment-response.https-expected.txt: * LayoutTests/http/tests/paymentrequest/page-cache-created-payment-response.https.html: * LayoutTests/http/tests/paymentrequest/page-cache-retried-payment-response.https-expected.txt: * LayoutTests/http/tests/paymentrequest/page-cache-retried-payment-response.https.html: * LayoutTests/http/tests/paymentrequest/payment-response-rejects-if-not-active.https.html: * LayoutTests/http/tests/paymentrequest/rejects_if_not_active.https-expected.txt: * LayoutTests/http/tests/paymentrequest/rejects_if_not_active.https.html: * LayoutTests/imported/w3c/resources/resource-files.json: * LayoutTests/imported/w3c/web-platform-tests/feature-policy/payment-allowed-by-feature-policy-attribute-redirect-on-load.https.sub-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/feature-policy/payment-allowed-by-feature-policy-attribute.https.sub-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/feature-policy/payment-allowed-by-feature-policy.https.sub-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/feature-policy/payment-default-feature-policy.https.sub-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/feature-policy/payment-disabled-by-feature-policy.https.sub-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/payment-request/META.yml: * LayoutTests/imported/w3c/web-platform-tests/payment-request/WEB_FEATURES.yml: Added. * LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-is-showing.https-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-is-showing.https.html: * LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-request-abort-method.https-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-request-show-method.https-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/payment-request/rejects_if_not_active.https-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/payment-request/rejects_if_not_active.https.html: * LayoutTests/imported/w3c/web-platform-tests/payment-request/w3c-import.log: * LayoutTests/imported/w3c/web-platform-tests/permissions-policy/payment-allowed-by-permissions-policy.https.sub-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/permissions-policy/payment-allowed-by-permissions-policy.https.sub.html: * LayoutTests/imported/w3c/web-platform-tests/permissions-policy/payment-disabled-by-permissions-policy.https.sub-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/permissions-policy/payment-disabled-by-permissions-policy.https.sub.html: * LayoutTests/imported/w3c/web-platform-tests/permissions-policy/payment-extension-allowed-by-permissions-policy-attribute.https.sub.html: Added. * LayoutTests/imported/w3c/web-platform-tests/permissions-policy/payment-supported-by-permissions-policy.tentative-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/permissions-policy/payment-supported-by-permissions-policy.tentative.html: * LayoutTests/platform/ios/TestExpectations: * LayoutTests/platform/mac-wk2/TestExpectations: * LayoutTests/tests-options.json: * Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp: (WebCore::PaymentRequest::show): (WebCore::PaymentRequest::canMakePayment): * Source/WebCore/Modules/paymentrequest/PaymentResponse.cpp: (WebCore::PaymentResponse::complete): (WebCore::PaymentResponse::retry): * Source/WebCore/Modules/paymentrequest/PaymentResponse.h: * Source/WebCore/Modules/paymentrequest/PaymentResponse.idl:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Per TAG Design Principles §3.2.2, InvalidStateError should be used for document state issues, while AbortError is reserved for user-initiated and developer-initiated aborts (e.g., navigating or removing a traversable).
See: https://www.w3.org/TR/design-principles/#handle-non-fully-active-documents
part of #1040
The following tasks have been completed:
Implementation commitment:
Optional, impact on Payment Handler spec?
Preview | Diff