Navigator's share() must consume user activation
Categories
(Core :: DOM: Core & HTML, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox79 | --- | fixed |
People
(Reporter: marcosc, Assigned: marcosc)
References
()
Details
Attachments
(1 file)
When share() is called, "consume user activation" of Window.
Assignee | ||
Comment 1•4 years ago
|
||
Edgar, could you guide me a little bit here?
The spec says:
If |window| does not have [=transient activation=], return [=a promise rejected with=] with a {{"NotAllowedError"}} {{DOMException}}.
What's the equivalent in Gecko for checking "If window does not have transient activation"?
And then the spec says:
[=Consume user activation=] of |window|.
I assume I need to call UserActivation.StopHandlingUserInput()
?
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 2•4 years ago
|
||
As an aside, as these are user activation stuff is pretty common in specs, what might be nice is to document these like:
- if the spec says, "consume", do this: ...
- if the spec says "sticky activation", do this: ...
- If the spec says "transient activation", do this: ...
The we have easy recipes to follow when implementing.
Comment 3•4 years ago
|
||
To check transient activation, you could use BrowsingContext::HasValidTransientUserGestureActivation(). And BrowsingContext::ConsumeTransientUserGestureActivation() is for consuming transient activation. We also provide some chrome only api on Document for testing purpose.
Assignee | ||
Comment 4•4 years ago
|
||
Amazing! Thanks Edgar!!!
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 5•4 years ago
|
||
navigator.share() must consume the user activation.
Assignee | ||
Comment 6•4 years ago
|
||
Comment 7•4 years ago
|
||
Should this wait for the PR to land first?
Assignee | ||
Comment 8•4 years ago
|
||
Will land them all together (the PR is approved and the google folks are onboard too).
Another try:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=5e6a62dbd40d08125beff24cff2c9cca0a61d4f8
Comment 12•4 years ago
|
||
Backed out for multiple failures
backout: https://hg.mozilla.org/integration/autoland/rev/c62bd67aecccdf8aa5b6336b5a71d537175cf34e
failure logs:
- web-share/share-consume-activation.https.html https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=306645644&repo=autoland&lineNumber=64416
- dom/webshare/test/mochitest/test_navigator_share_consume_user_activation.html https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=306639433&repo=autoland&lineNumber=1226
Assignee | ||
Comment 15•4 years ago
|
||
Try try try again (disabling for windows):
https://treeherder.mozilla.org/#/jobs?repo=try&revision=90b7fd82b8f32c118ac6273123fc697d3f6c0400
Comment 16•4 years ago
|
||
Comment 18•4 years ago
|
||
bugherder |
Description
•