pointerdown event not considered as user gesture by autoplay policy |
||||||
Issue descriptionChrome Version: 66.0.3359.117 OS: Linux (have not tried other platforms yet). Repro steps (also see attached screencast) 1. Load attached HTML file. 2. Open DevTools and turn on Device mode (otherwise it will not repro). 3. Click in the Omnibox and hit enter (this is necessary apparently). 4. Click on the 2nd button once (which uses 'pointerdown' event). 5. Observe warning thrown in the console "The AudioContext was not allowed to start. It must be resume (or created) after a user gesture on the page." 6. Repeat steps 3 and 4 a few times, it will keep throwing the warning in the console. 7. Repeat step 3, and then click on the 1st button (which uses a 'click' event). Notice that there is no warning. Also note that if step 3 is replaced with "Hit the refresh button", the bug does not reproduce (most likely refresh is different than navigation). What is the expected result? pointerdown should be considered a user gesture, because it is one. What happens instead? pointerdown is not detected as a user gesture. Started noticing this on the version mentioned above. Have not performed a bisect yet. Also have not tried other platforms yet.
,
Apr 20 2018
,
Apr 20 2018
,
May 9 2018
Any updates here?
,
May 15 2018
,
May 15 2018
Sorry, pointerdown for touch is intentionally not a user gesture because scrolling is not a user gesture (eg. scrolling on top of an ad should not allow that ad to open a popup - see issue 582140 and my doc here: https://docs.google.com/document/d/1oF1T3O7_E4t1PYHV6gyCwHxOi3ystm0eSL5xZu7nvOg/edit#). Use pointerup or click instead.
,
May 15 2018
Thanks for the links, I understand the tradeoff now, but there is still a problem where pointerdown is not necessarily always leading to a scroll. One can use pointerdown for various reasons, for example attaching it to a button because it is more responsive than click (happens before user releases the finger), or to implement a drag-and-drop functionality, or any other scenario where a pointerdown is actually the result of the user interacting with the page other than scrolling. |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by dpa...@chromium.org
, Apr 20 2018