Update transient activation to match WebKit#961
Conversation
stephenmcgruer
left a comment
There was a problem hiding this comment.
I tried to find some prior art here on whether to throw a NotAllowed or SecurityError, and came up short 😂 . What I did find:
- webusb and webbluetooth throw a SecurityError
- One other spec I found threw NotAllowedError, but most other specs just quietly return or ignore calls/etc when there is no activation.
- We used to throw SecurityError, then switched to NotAllowedError without documented reason that I could find.
So... SecurityError LGTM? Maybe something the web should standardize on ;)
I've asked for this too elsewhere, but wasn't successful... as you point out, it's somewhat specific to the API (and if the API throws/rejects or can get away with doing nothing). |
|
Could someone please also approve the tests? 🙏 web-platform-tests/wpt#30006 |
|
@stephenmcgruer, filed Chrome bug https://bugs.chromium.org/p/chromium/issues/detail?id=1239453 Happy to send a patch, but please see my email as I'm not sure how to enable the right flag to trigger that code path. |
The error thrown when user activation is missing was recently changed from NotAllowedError to SecurityError: w3c/payment-request#961 This change has no effect on shipped Chrome yet as we currently don't throw at all for missing activation - the logic is hidden behind the capability delegation flag. Tested via unittest and via visiting https://wpt.live/payment-request/show-consume-activation.https.html with --enable-features=CapabilityDelegationPaymentRequest set. Bug: 1239453 Change-Id: I14f3874397468ca5da617afa930ffbbe254f1607 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3092912 Reviewed-by: Mustaq Ahmed <mustaq@chromium.org> Reviewed-by: Scott Violet <sky@chromium.org> Reviewed-by: Rouslan Solomakhin <rouslan@chromium.org> Commit-Queue: Stephen McGruer <smcgruer@chromium.org> Cr-Commit-Position: refs/heads/master@{#911813}
…or cases for PaymentRequest.show(), a=testonly Automatic update from web-platform-tests Fix some NotAllowedError --> SecurityError cases for PaymentRequest.show() (#30023) See w3c/payment-request#961 -- wpt-commits: ee2d179bcea6e4a697e89a99a245e4571bd65097 wpt-pr: 30023
…or cases for PaymentRequest.show(), a=testonly Automatic update from web-platform-tests Fix some NotAllowedError --> SecurityError cases for PaymentRequest.show() (#30023) See w3c/payment-request#961 -- wpt-commits: ee2d179bcea6e4a697e89a99a245e4571bd65097 wpt-pr: 30023
Update the spec to match what WebKit does. We can then update Chrome to match.
The following tasks have been completed:
Implementation commitment:
Optional, impact on Payment Handler spec?
none
Preview | Diff