Closed
Bug 1442078
Opened 7 years ago
Closed 7 years ago
PaymentRequest.show() must only be triggered by user activation
Categories
(Core :: DOM: Web Payments, enhancement, P1)
Core
DOM: Web Payments
Tracking
()
RESOLVED
FIXED
mozilla61
Tracking | Status | |
---|---|---|
firefox61 | --- | fixed |
People
(Reporter: marcosc, Assigned: jonathanGB)
References
(Depends on 1 open bug, Blocks 1 open bug, )
Details
(Keywords: dev-doc-complete, Whiteboard: [webpayments])
Attachments
(3 files)
Calling show() without being triggered by user activation needs to throw, as per spec.
Reporter | ||
Updated•7 years ago
|
Comment 1•7 years ago
|
||
This can be implemented with EventStateManager::IsHandlingUserInput
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → jonathan.guillotte.blouin
Status: NEW → ASSIGNED
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment 5•7 years ago
|
||
mozreview-review |
Comment on attachment 8957428 [details]
Bug 1442078 - Modify UI tests that were broken by the change to the "show" specs.
https://reviewboard.mozilla.org/r/226354/#review232244
Thanks Jonathan!
::: toolkit/components/payments/test/PaymentTestUtils.jsm:86
(Diff revision 1)
> + content.QueryInterface(Ci.nsIInterfaceRequestor)
> + .getInterface(Ci.nsIDOMWindowUtils)
> + .setHandlingUserInput(true);
> +
> const rq = new content.PaymentRequest(methodData, details, options);
> content.rq = rq; // assign it so we can retrieve it later
> content.showPromise = rq.show();
I think we should reset this after show() is called… not sure if that will break more tests but it may be worth it. Can you give that a try?
Attachment #8957428 -
Flags: review?(MattN+bmo)
Assignee | ||
Updated•7 years ago
|
Attachment #8957427 -
Flags: review?(amarchesini)
Comment 6•7 years ago
|
||
mozreview-review |
Comment on attachment 8957426 [details]
Bug 1442078 - throw "SecurityError" if `show` is not triggered by user activation.
https://reviewboard.mozilla.org/r/226350/#review232256
Please, add a test.
Attachment #8957426 -
Flags: review?(amarchesini) → review+
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment 9•7 years ago
|
||
mozreview-review |
Comment on attachment 8957428 [details]
Bug 1442078 - Modify UI tests that were broken by the change to the "show" specs.
https://reviewboard.mozilla.org/r/226354/#review232436
Thanks
Attachment #8957428 -
Flags: review?(MattN+bmo) → review+
Comment 10•7 years ago
|
||
mozreview-review |
Comment on attachment 8957428 [details]
Bug 1442078 - Modify UI tests that were broken by the change to the "show" specs.
https://reviewboard.mozilla.org/r/226354/#review232438
::: toolkit/components/payments/test/PaymentTestUtils.jsm:86
(Diff revision 2)
> + const handle = content.QueryInterface(Ci.nsIInterfaceRequestor)
> + .getInterface(Ci.nsIDOMWindowUtils)
> + .setHandlingUserInput(true);
> +
To make the test more accurate, technically this should go directly above the `rq.show()` call.
Comment hidden (mozreview-request) |
Comment 12•7 years ago
|
||
mozreview-review |
Comment on attachment 8957427 [details]
Bug 1442078 - Modify DOM tests that were broken by the change to the "show" specs.
https://reviewboard.mozilla.org/r/226352/#review232580
Attachment #8957427 -
Flags: review?(amarchesini) → review+
Assignee | ||
Updated•7 years ago
|
Keywords: checkin-needed
Assignee | ||
Updated•7 years ago
|
Keywords: checkin-needed
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Updated•7 years ago
|
Keywords: checkin-needed
Comment 15•7 years ago
|
||
We're sorry, Autoland could not rebase your commits for you automatically. Please manually rebase your commits and try again.
hg error in cmd: hg rebase -s 75437fefd4a91ce5af2fe7b49b6ac7a8dbd14baa -d 5b4fefc4bb90: rebasing 452208:75437fefd4a9 "Bug 1442078 - throw "SecurityError" if `show` is not triggered by user activation. r=baku"
merging dom/payments/PaymentRequest.cpp
rebasing 452209:4cfe935ec290 "Bug 1442078 - Modify DOM tests that were broken by the change to the "show" specs. r=baku"
merging dom/payments/test/ShowPaymentChromeScript.js
merging dom/payments/test/test_showPayment.html
warning: conflicts while merging dom/payments/test/test_showPayment.html! (edit, then use 'hg resolve --mark')
unresolved conflicts (see hg resolve, then hg rebase --continue)
Comment 16•7 years ago
|
||
There are conflicts while landing this patch, :jonathanGB Can you please have a look?
Flags: needinfo?(jonathan.guillotte.blouin)
Updated•7 years ago
|
Keywords: checkin-needed
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Updated•7 years ago
|
Flags: needinfo?(jonathan.guillotte.blouin)
Keywords: checkin-needed
Assignee | ||
Comment 20•7 years ago
|
||
Resolved the conflicts :ccoroiu !
Comment 21•7 years ago
|
||
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/f6b8e0261486
throw "SecurityError" if `show` is not triggered by user activation. r=baku
https://hg.mozilla.org/integration/autoland/rev/dcc9329ec127
Modify DOM tests that were broken by the change to the "show" specs. r=baku
https://hg.mozilla.org/integration/autoland/rev/457b8e3d5efa
Modify UI tests that were broken by the change to the "show" specs. r=MattN
Keywords: checkin-needed
Comment 22•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/f6b8e0261486
https://hg.mozilla.org/mozilla-central/rev/dcc9329ec127
https://hg.mozilla.org/mozilla-central/rev/457b8e3d5efa
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox61:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
Updated•7 years ago
|
Whiteboard: [webpayments]
Reporter | ||
Comment 23•7 years ago
|
||
Testing in Nightly, "triggered by user activation" doesn't seem to survive `postMessage()`?
For this to be usable by Stripe, and to be compatible with Chrome, it has to be possible to `postMessage()` from a user gesture, and then have a script in the iframe pick it up.
I've created a web platform test:
https://github.com/w3c/web-platform-tests/pull/10090
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Updated•7 years ago
|
Priority: P1 → --
Whiteboard: [webpayments]
Comment 24•7 years ago
|
||
Marcos, once code has landed, we generally don't re-open bugs unless that code is backed out. It makes it hard to track what version code landed in otherwise. Follow-up bugs should be filed for follow-up issues.
Also, that issue isn't specific to PaymentRequest… Jonathan implemented the Gecko standard method of checking for user interaction so if we want to loosen that it should be considered for other uses of IsHandlingUserInput too. Can you file a follow-up Core::DOM bug that blocks this one and mark it with [webpayments]? If you prefer I file it then needinfo me please. Thanks
Status: REOPENED → RESOLVED
Closed: 7 years ago → 7 years ago
Priority: -- → P1
Resolution: --- → FIXED
Whiteboard: [webpayments]
Reporter | ||
Comment 25•7 years ago
|
||
(In reply to Matthew N. [:MattN] (PM if requests are blocking you) from comment #24)
> Marcos, once code has landed, we generally don't re-open bugs unless that
> code is backed out.
No probs.
> It makes it hard to track what version code landed in
> otherwise. Follow-up bugs should be filed for follow-up issues.
>
> Also, that issue isn't specific to PaymentRequest… Jonathan implemented the
> Gecko standard method of checking for user interaction so if we want to
> loosen that it should be considered for other uses of IsHandlingUserInput
> too. Can you file a follow-up Core::DOM bug that blocks this one and mark it
> with [webpayments]? If you prefer I file it then needinfo me please. Thanks
Sounds good. Let's follow up in a new bug. I'll file it tomorrow, unless you want to do it... we might need to drag bz in. If we can't propagate the trigger, that might be kinda bad.
Reporter | ||
Comment 26•7 years ago
|
||
File new bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=1447178
Interested folks should follow along there.
Updated•6 years ago
|
Keywords: dev-doc-needed
You need to log in
before you can comment on or make changes to this bug.
Description
•