Bug 94867 - Introduce consumable user gestures
Summary: Introduce consumable user gestures
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Cris Neckar
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-23 15:33 PDT by Cris Neckar
Modified: 2012-08-24 12:00 PDT (History)
8 users (show)

See Also:


Attachments
Patch (7.60 KB, patch)
2012-08-23 16:17 PDT, Cris Neckar
no flags Details | Formatted Diff | Diff
Patch (6.51 KB, patch)
2012-08-23 17:09 PDT, Cris Neckar
no flags Details | Formatted Diff | Diff
Patch (6.37 KB, patch)
2012-08-24 11:23 PDT, Cris Neckar
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Cris Neckar 2012-08-23 15:33:17 PDT
This should not change the behavior of user gestures unless a platform chooses to use the new feature.

The basic concept would be to introduce a count of consumable gestures which is incremented each time a gesture indicator is created and decremented when it falls out of scope. Currently, once a gesture is in scope any number of actions which require a gesture can be performed. With consumable gestures a platform could choose to consume a gesture for certain actions (navigations in new windows being a notable example).
Comment 1 Cris Neckar 2012-08-23 16:17:24 PDT
Created attachment 160274 [details]
Patch
Comment 2 WebKit Review Bot 2012-08-23 16:18:53 PDT
Please wait for approval from abarth@webkit.org, dglazkov@chromium.org, fishd@chromium.org, jamesr@chromium.org or tkent@chromium.org before submitting, as this patch contains changes to the Chromium public API. See also https://trac.webkit.org/wiki/ChromiumWebKitAPI.
Comment 3 Adam Barth 2012-08-23 16:30:31 PDT
Comment on attachment 160274 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=160274&action=review

> Source/WebCore/ChangeLog:12
> +        Adds a static counter of the number of consumable gestures. This is decremented either when
> +        a gestures falls out of scope or is consumed via a call to consumeUserGesture().
> +
> +        No new tests as this should not change behavior. The platform must implement consumable
> +        gestures for this to do anything.

Can you add more information about what you plan to use this for?

> Source/WebCore/bindings/v8/ScriptController.cpp:197
> +bool ScriptController::consumeUserGesture()
> +{
> +    return UserGestureIndicator::consumeUserGesture();
> +}

We can probably skip this function.  It's not really adding any value.  I want to get rid of ScriptController::processingUserGesture at some point too.
Comment 4 Cris Neckar 2012-08-23 17:09:44 PDT
Created attachment 160287 [details]
Patch
Comment 5 Cris Neckar 2012-08-23 17:10:50 PDT
Comment on attachment 160274 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=160274&action=review

>> Source/WebCore/ChangeLog:12
>> +        gestures for this to do anything.
> 
> Can you add more information about what you plan to use this for?

Added planned usage

>> Source/WebCore/bindings/v8/ScriptController.cpp:197
>> +}
> 
> We can probably skip this function.  It's not really adding any value.  I want to get rid of ScriptController::processingUserGesture at some point too.

I agree. I was copying the convention set by processingUserGesture()
Comment 6 Adam Barth 2012-08-23 23:10:50 PDT
Comment on attachment 160287 [details]
Patch

This seems worth experimenting with.
Comment 7 WebKit Review Bot 2012-08-23 23:27:37 PDT
Comment on attachment 160287 [details]
Patch

Rejecting attachment 160287 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2

Last 500 characters of output:
Kit/chromium/third_party/yasm/source/patched-yasm --revision 134927 --non-interactive --force --accept theirs-conflict --ignore-externals' in '/mnt/git/webkit-commit-queue/Source/WebKit/chromium'
50>At revision 134927.

________ running '/usr/bin/python tools/clang/scripts/update.py --mac-only' in '/mnt/git/webkit-commit-queue/Source/WebKit/chromium'

________ running '/usr/bin/python gyp_webkit' in '/mnt/git/webkit-commit-queue/Source/WebKit/chromium'
Updating webkit projects from gyp files...

Full output: http://queues.webkit.org/results/13594028
Comment 8 Adam Barth 2012-08-23 23:29:46 PDT
    The following ChangeLog files contain OOPS:

        trunk/Source/WebKit/chromium/ChangeLog

    Please don't ever say "OOPS" in a ChangeLog file.
Comment 9 Cris Neckar 2012-08-24 11:23:19 PDT
Created attachment 160459 [details]
Patch
Comment 10 WebKit Review Bot 2012-08-24 12:00:55 PDT
Comment on attachment 160459 [details]
Patch

Clearing flags on attachment: 160459

Committed r126609: <http://trac.webkit.org/changeset/126609>
Comment 11 WebKit Review Bot 2012-08-24 12:00:59 PDT
All reviewed patches have been landed.  Closing bug.