-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Treat trusted contextmenu
events as user activation.
#3659
Conversation
FWIW, this change makes sense to me as a small incremental step, largely separate from Mustaq's larger effort of rationalizing/simplifying this whole space. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, and brings the spec a bit more in line with existing browsers while we work on #1903. I think it's OK to forgo tests since testing user activation is not currently possible I believe (e.g. the pop-up blocker is always disabled in the web platform tests infra). I am hopeful that when we do #1903 we'll try to workaround those current testing limitations and have a larger set of tests for the whole space.
I'll give this another day to see if any other editors have thoughts, and then merge.
Is there an issue on testing being impossible? We should at least reference this so that when that issue gets resolved someone can pick up the slack... |
Also, it appears this list was in lexicographical order. Seems worth preserving? |
Finally, @mustaqahmed, you don't appear to be listed in the Acknowledgments section. Would you like to add yourself? |
|
Also add a web-platform-test for this change, which is already supported by Firefox. Intent to ship: https://groups.google.com/a/chromium.org/d/msg/blink-dev/-2AyrUFwXvY/Q_wCUmKSAgAJ Spec change PR: whatwg/html#3659 Bug: 836401 Change-Id: Ia710190857211684ce5ce7d4ff835b874f658b29
Oh, neat. I know the pop-up blocker is disabled for web platform tests, but I didn't realize navigator.vibrate would go through a different code path. |
Also add a web-platform-test for this change, which is already supported by Firefox. Intent to ship: https://groups.google.com/a/chromium.org/d/msg/blink-dev/-2AyrUFwXvY/Q_wCUmKSAgAJ Spec change PR: whatwg/html#3659 Bug: 836401 Change-Id: Ia710190857211684ce5ce7d4ff835b874f658b29 Reviewed-on: https://chromium-review.googlesource.com/1039265 Reviewed-by: Dave Tapuska <dtapuska@chromium.org> Commit-Queue: Mustaq Ahmed <mustaq@chromium.org> Cr-Commit-Position: refs/heads/master@{#555450}
Also add a web-platform-test for this change, which is already supported by Firefox. Intent to ship: https://groups.google.com/a/chromium.org/d/msg/blink-dev/-2AyrUFwXvY/Q_wCUmKSAgAJ Spec change PR: whatwg/html#3659 Bug: 836401 Change-Id: Ia710190857211684ce5ce7d4ff835b874f658b29 Reviewed-on: https://chromium-review.googlesource.com/1039265 Reviewed-by: Dave Tapuska <dtapuska@chromium.org> Commit-Queue: Mustaq Ahmed <mustaq@chromium.org> Cr-Commit-Position: refs/heads/master@{#555450}
Also add a web-platform-test for this change, which is already supported by Firefox. Intent to ship: https://groups.google.com/a/chromium.org/d/msg/blink-dev/-2AyrUFwXvY/Q_wCUmKSAgAJ Spec change PR: whatwg/html#3659 Bug: 836401 Change-Id: Ia710190857211684ce5ce7d4ff835b874f658b29 Reviewed-on: https://chromium-review.googlesource.com/1039265 Reviewed-by: Dave Tapuska <dtapuska@chromium.org> Commit-Queue: Mustaq Ahmed <mustaq@chromium.org> Cr-Commit-Position: refs/heads/master@{#555450}
…ation., a=testonly Automatic update from web-platform-testsTreat long-press gesture as a user activation. Also add a web-platform-test for this change, which is already supported by Firefox. Intent to ship: https://groups.google.com/a/chromium.org/d/msg/blink-dev/-2AyrUFwXvY/Q_wCUmKSAgAJ Spec change PR: whatwg/html#3659 Bug: 836401 Change-Id: Ia710190857211684ce5ce7d4ff835b874f658b29 Reviewed-on: https://chromium-review.googlesource.com/1039265 Reviewed-by: Dave Tapuska <dtapuska@chromium.org> Commit-Queue: Mustaq Ahmed <mustaq@chromium.org> Cr-Commit-Position: refs/heads/master@{#555450} -- wpt-commits: d86d487f8c2b41816e01ecde2116252fbdf4de43 wpt-pr: 10791
…ation., a=testonly Automatic update from web-platform-testsTreat long-press gesture as a user activation. Also add a web-platform-test for this change, which is already supported by Firefox. Intent to ship: https://groups.google.com/a/chromium.org/d/msg/blink-dev/-2AyrUFwXvY/Q_wCUmKSAgAJ Spec change PR: whatwg/html#3659 Bug: 836401 Change-Id: Ia710190857211684ce5ce7d4ff835b874f658b29 Reviewed-on: https://chromium-review.googlesource.com/1039265 Reviewed-by: Dave Tapuska <dtapuskachromium.org> Commit-Queue: Mustaq Ahmed <mustaqchromium.org> Cr-Commit-Position: refs/heads/master{#555450} -- wpt-commits: d86d487f8c2b41816e01ecde2116252fbdf4de43 wpt-pr: 10791 UltraBlame original commit: b83499fcfb6339c99b18654ecf957e180306218f
…ation., a=testonly Automatic update from web-platform-testsTreat long-press gesture as a user activation. Also add a web-platform-test for this change, which is already supported by Firefox. Intent to ship: https://groups.google.com/a/chromium.org/d/msg/blink-dev/-2AyrUFwXvY/Q_wCUmKSAgAJ Spec change PR: whatwg/html#3659 Bug: 836401 Change-Id: Ia710190857211684ce5ce7d4ff835b874f658b29 Reviewed-on: https://chromium-review.googlesource.com/1039265 Reviewed-by: Dave Tapuska <dtapuskachromium.org> Commit-Queue: Mustaq Ahmed <mustaqchromium.org> Cr-Commit-Position: refs/heads/master{#555450} -- wpt-commits: d86d487f8c2b41816e01ecde2116252fbdf4de43 wpt-pr: 10791 UltraBlame original commit: b83499fcfb6339c99b18654ecf957e180306218f
…ation., a=testonly Automatic update from web-platform-testsTreat long-press gesture as a user activation. Also add a web-platform-test for this change, which is already supported by Firefox. Intent to ship: https://groups.google.com/a/chromium.org/d/msg/blink-dev/-2AyrUFwXvY/Q_wCUmKSAgAJ Spec change PR: whatwg/html#3659 Bug: 836401 Change-Id: Ia710190857211684ce5ce7d4ff835b874f658b29 Reviewed-on: https://chromium-review.googlesource.com/1039265 Reviewed-by: Dave Tapuska <dtapuskachromium.org> Commit-Queue: Mustaq Ahmed <mustaqchromium.org> Cr-Commit-Position: refs/heads/master{#555450} -- wpt-commits: d86d487f8c2b41816e01ecde2116252fbdf4de43 wpt-pr: 10791 UltraBlame original commit: b83499fcfb6339c99b18654ecf957e180306218f
The
contextmenu
event should be considered a user activation because it indicates that the user is interacting with the page.Firefox already treats
contextmenu
events as user activation, hence allows web apps to use restricted APIs likenavigator.vibrate()
. In Chromium, we are on track to match the Firefox behavior because on mobile platforms, a web app should be able to mimic the native behavior of vibrating the device on long-press gestures (which firecontextmenu
events). Here is a demo.Note that on desktop, both Chromium and Firefox already treat
contextmenu
events as user activation (e.g.navigator.vibrate
returnstrue
in the above demo).This PR is remotely related to #1903 (which is a work in progress in Chromium).
/acknowledgements.html ( diff )
/interaction.html ( diff )