Bug 114379

Summary: Enable consumable user gestures for WebKit2 and Mac/Win ports
Product: WebKit Reporter: jochen
Component: New BugsAssignee: jochen
Status: RESOLVED WONTFIX    
Severity: Normal CC: ap, buildbot, ggaren
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 118247    
Bug Blocks: 114021    
Attachments:
Description Flags
Patch
none
Archive of layout-test-results from webkit-ews-05 for mac-mountainlion
none
Patch beidson: review-

Description jochen 2013-04-10 13:42:42 PDT
Enable consumable user gestures for WebKit2 ports
Comment 1 jochen 2013-04-10 13:44:50 PDT
Created attachment 197398 [details]
Patch
Comment 2 jochen 2013-04-10 13:46:27 PDT
I guess this will fail to compile on all but mac-wk2, but I first need to symbol names to add UserGestureIndicator::consumeUserGesture to all the export lists
Comment 3 Build Bot 2013-04-10 21:53:13 PDT
Comment on attachment 197398 [details]
Patch

Attachment 197398 [details] did not pass mac-ews (mac):
Output: http://webkit-commit-queue.appspot.com/results/17590107

New failing tests:
fast/events/popup-forwarded-gesture-blocked.html
fast/events/popup-allowed-from-gesture-only-once-iframes.html
fast/events/popup-allowed-from-gesture-only-once-two-events.html
fast/events/popup-allowed-from-gesture-only-once.html
Comment 4 Build Bot 2013-04-10 21:53:14 PDT
Created attachment 197503 [details]
Archive of layout-test-results from webkit-ews-05 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-05  Port: mac-mountainlion  Platform: Mac OS X 10.8.2
Comment 5 jochen 2013-04-11 09:38:31 PDT
Created attachment 197627 [details]
Patch
Comment 6 jochen 2013-04-11 09:39:56 PDT
I guess we should ask on webkit-dev whether the other ports want this enabled or have the new tests skipped.
Comment 7 Brady Eidson 2013-04-12 13:42:26 PDT
Comment on attachment 197627 [details]
Patch

From the email thread on webkit-dev:

"There are some gotchas: e.g. if your port is using out of process plugins, and the plugin wants to react to a user gesture, you're probably storing whether WebKit is processing a user gesture before calling out to the plugin, and restore a UserGestureIndicator once the plugin replies. To make sure a plugin cannot use this to generate additional user gestures (after the original user gesture was already consumed), you should store the UserGestureIndicator::currentToken() and use that to create the UserGestureIndicator (it's basically a ref-counted integer of how many gestures are left to consume)."

If this patch is known to break out-of-process plugins, then this patch is known to break "must not break" ports.
Comment 8 jochen 2013-04-12 13:59:54 PDT
(In reply to comment #7)
> (From update of attachment 197627 [details])
> From the email thread on webkit-dev:
> 
> "There are some gotchas: e.g. if your port is using out of process plugins, and the plugin wants to react to a user gesture, you're probably storing whether WebKit is processing a user gesture before calling out to the plugin, and restore a UserGestureIndicator once the plugin replies. To make sure a plugin cannot use this to generate additional user gestures (after the original user gesture was already consumed), you should store the UserGestureIndicator::currentToken() and use that to create the UserGestureIndicator (it's basically a ref-counted integer of how many gestures are left to consume)."
> 
> If this patch is known to break out-of-process plugins, then this patch is known to break "must not break" ports.

I guess that paragraph was unclear: it does not break the port, it just doesn't fix all the ways a website could work around the check.
Comment 9 jochen 2013-07-01 13:00:34 PDT
As discussed on IRC, the concept of consumable user gestures doesn't quite match what seems desirable for current ports, so I'm closing this bug.