[Webkit-unassigned] [Bug 212969] [GTK] Add an API to run javascript without forced user gestures

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jun 10 08:51:33 PDT 2020


https://bugs.webkit.org/show_bug.cgi?id=212969

--- Comment #3 from Charlie Turner <cturner at igalia.com> ---
I still think we need this API.

The fullscreen request will be denied and the test will hang without active user gestures, because document.documentElement.webkitRequestFullScreen() ends up in
WebCore::FullscreenManager::requestFullscreenForElement, which early
returns if no gesture tokens are installed.

User gestures are kept in a static global on the main thread. webkit_web_view_run_javascript and synthetic key events both cause this global to get a gesture installed, so why doesn't it work calling it right before I run the JS without explicitly enabling user gestures? They should be sticky, no?

Gestures are only active for the lifetime of the script run by webkit_web_view_run_javascript and the processing of the key event in WebCore::EventHandler::internalKeyEvent respectively.

It's a tad tricksy how UserGestureIndicator keeps that static global valid only for the scope in which it's stack allocated.

So, we want an API that runs JS without user gestures explicitly. Cocoa has _evaluateJavaScriptWithoutUserGesture, I think we should too after learning the above.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200610/11d94fa9/attachment-0001.htm>


More information about the webkit-unassigned mailing list