Closed rsolomakhin closed 5 years ago
TL;DR: Can show() be called on the same instance of PaymentRequest multiple times?
So, yes:
I don't think that's a bug... it's an oddity, for sure... but I don't think it's terrible.
I'll check what Firefox does...
Ok, made a fiddle: https://jsfiddle.net/cuz5mt6h/11/
Ok, so, in step 7, we should set the state to "closed".
@aestes, is that ok?
Ok, made a test page for Safari:
https://fiddle.jshell.net/cuz5mt6h/11/show/
Safari follows the spec (it show()
s the second request, even after aborting the first .show()
). I don't have a strong opinion - so if @aestes is ok with us changing step 7 above to "close" the state (and there is no valid use case for it), then that's fine.
I'll draft a PR in the meantime, as it's really simple to fix.
TL;DR: Can
show()
be called on the same instance ofPaymentRequest
multiple times?The
show()
algorithm includes the following steps:It looks like
show()
can be rejected without altering the request.[[state]], so the merchant can callshow()
on the same instance ofPaymentRequest
. Is this the only edge case whereshow()
does not change state? Or am I reading the spec wrong?