Bug 71753 - IDL changes for gamepad support
Summary: IDL changes for gamepad support
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Scott Graham
URL: http://dvcs.w3.org/hg/webevents/raw-f...
Keywords:
Depends on: 71518 71763
Blocks:
  Show dependency treegraph
 
Reported: 2011-11-07 17:18 PST by Scott Graham
Modified: 2011-11-18 19:10 PST (History)
8 users (show)

See Also:


Attachments
Patch (21.02 KB, patch)
2011-11-07 17:28 PST, Scott Graham
no flags Details | Formatted Diff | Diff
remove custom binding code (17.57 KB, patch)
2011-11-09 10:53 PST, Scott Graham
no flags Details | Formatted Diff | Diff
add basic test + harness (24.25 KB, patch)
2011-11-10 11:48 PST, Scott Graham
no flags Details | Formatted Diff | Diff
reupload to re-EWS now that pipelined change 71518 is landed (24.26 KB, patch)
2011-11-15 12:13 PST, Scott Graham
no flags Details | Formatted Diff | Diff
test rebase for navigator addition (25.26 KB, patch)
2011-11-15 14:28 PST, Scott Graham
no flags Details | Formatted Diff | Diff
vendor prefix, update Skippeds (30.64 KB, patch)
2011-11-18 12:09 PST, Scott Graham
no flags Details | Formatted Diff | Diff
rebase (30.71 KB, patch)
2011-11-18 13:17 PST, Scott Graham
no flags Details | Formatted Diff | Diff
review fixes, move to Modules (31.58 KB, patch)
2011-11-18 15:36 PST, Scott Graham
no flags Details | Formatted Diff | Diff
retreat on Modules (30.78 KB, patch)
2011-11-18 15:59 PST, Scott Graham
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Scott Graham 2011-11-07 17:18:36 PST
Just the IDL changes and supporting glue code for gamepad support.

Full patch is https://bugs.webkit.org/show_bug.cgi?id=69451

This patch doesn't include plumbing through to platform (the top level access point is in Navigator and is stubbed to return null in the patch).
Comment 1 Scott Graham 2011-11-07 17:28:01 PST
Created attachment 113964 [details]
Patch
Comment 2 Adam Barth 2011-11-07 17:43:10 PST
Comment on attachment 113964 [details]
Patch

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

> Source/WebCore/bindings/v8/custom/V8GamepadCustom.cpp:37
> +static v8::Handle<v8::Value> createNumberArray(const Gamepad::FloatVector& vector)

You should teach the code generator how to do this instead of writing custom bindings.  All custom bindings are fully of bugs.
Comment 3 Scott Graham 2011-11-07 21:51:57 PST
Comment on attachment 113964 [details]
Patch

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

>> Source/WebCore/bindings/v8/custom/V8GamepadCustom.cpp:37
>> +static v8::Handle<v8::Value> createNumberArray(const Gamepad::FloatVector& vector)
> 
> You should teach the code generator how to do this instead of writing custom bindings.  All custom bindings are fully of bugs.

OK. WIP here: https://bugs.webkit.org/show_bug.cgi?id=71763
Comment 4 Scott Graham 2011-11-09 10:53:23 PST
Created attachment 114314 [details]
remove custom binding code
Comment 5 Scott Graham 2011-11-10 11:48:01 PST
Created attachment 114533 [details]
add basic test + harness
Comment 6 WebKit Review Bot 2011-11-11 13:08:03 PST
Comment on attachment 114533 [details]
add basic test + harness

Attachment 114533 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/10450568
Comment 7 Scott Graham 2011-11-15 12:13:49 PST
Created attachment 115215 [details]
reupload to re-EWS now that pipelined change 71518 is landed
Comment 8 WebKit Review Bot 2011-11-15 14:16:37 PST
Comment on attachment 115215 [details]
reupload to re-EWS now that pipelined change 71518 is landed

Attachment 115215 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/10483453

New failing tests:
fast/dom/navigator-detached-no-crash.html
Comment 9 Scott Graham 2011-11-15 14:28:26 PST
Created attachment 115247 [details]
test rebase for navigator addition
Comment 10 Scott Graham 2011-11-18 12:09:07 PST
Created attachment 115845 [details]
vendor prefix, update Skippeds
Comment 11 Adam Barth 2011-11-18 12:12:50 PST
Comment on attachment 115845 [details]
vendor prefix, update Skippeds

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

> Source/WebCore/WebCore.gypi:2954
> +            'page/Gamepad.cpp',
> +            'page/Gamepad.h',
> +            'page/GamepadList.cpp',
> +            'page/GamepadList.h',

Drive by: "page" isn't really the right place for these objects because they have document-scope, not page-scope.  I realize that there isn't a good place to put them at the moment.  It's fine to put them here for now, but we'll probably end up moving them.
Comment 12 WebKit Review Bot 2011-11-18 12:38:51 PST
Comment on attachment 115845 [details]
vendor prefix, update Skippeds

Attachment 115845 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/10517207

New failing tests:
fast/dom/navigator-detached-no-crash.html
Comment 13 Scott Graham 2011-11-18 13:17:21 PST
Created attachment 115857 [details]
rebase
Comment 14 Adam Barth 2011-11-18 15:03:20 PST
Comment on attachment 115857 [details]
rebase

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

If it's not too much trouble, would you be willing to put these files in Source/WebCore/Modules/gamepad ?  We've been discussing creating a Modules directory to hold these sorts of features, and your patch seems well timed to be the guinea pig.  (If you'd rather not be a guinea pig, we can keep these in page.)

Some minor nits below.

> Source/WebCore/page/Gamepad.h:26
> +

Please include ENABLE(GAMEPAD) guards in these header files.

> Source/WebCore/page/GamepadList.h:26
> +

ENABLE(GAMEPAD)

> Source/WebCore/page/Navigator.idl:66
> +        readonly attribute [EnabledAtRuntime] GamepadList webkitGamepads;

You can use Conditional=GAMEPAD rather than #if statements.
Comment 15 Scott Graham 2011-11-18 15:36:11 PST
(In reply to comment #14)
> (From update of attachment 115857 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=115857&action=review
> 
> If it's not too much trouble, would you be willing to put these files in Source/WebCore/Modules/gamepad ?  We've been discussing creating a Modules directory to hold these sorts of features, and your patch seems well timed to be the guinea pig.  (If you'd rather not be a guinea pig, we can keep these in page.)

Sure, I can do that if we can get it done soon-ish (I would like to get moving, as there's a lot of dependent code in Chromium). Are we decided on "Modules"?

Moved various to Modules/gamepad/, and changed WebCore.gypi and WebCore.gyp/WebCore.gyp for includes.

> 
> Some minor nits below.
> 
> > Source/WebCore/page/Gamepad.h:26
> > +
> 
> Please include ENABLE(GAMEPAD) guards in these header files.
> 
> > Source/WebCore/page/GamepadList.h:26
> > +

Done (but moved of course)

 
> ENABLE(GAMEPAD)
> 
> > Source/WebCore/page/Navigator.idl:66
> > +        readonly attribute [EnabledAtRuntime] GamepadList webkitGamepads;
> 
> You can use Conditional=GAMEPAD rather than #if statements.

Done.
Comment 16 Scott Graham 2011-11-18 15:36:46 PST
Created attachment 115894 [details]
review fixes, move to Modules
Comment 17 Early Warning System Bot 2011-11-18 15:48:43 PST
Comment on attachment 115894 [details]
review fixes, move to Modules

Attachment 115894 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/10518233
Comment 18 Scott Graham 2011-11-18 15:51:49 PST
Hmm... so there's a lot of include dirs to update for the various ports. Do you think it might make more sense to do the move to Modules as a separate patch instead?
Comment 19 Adam Barth 2011-11-18 15:54:00 PST
> Hmm... so there's a lot of include dirs to update for the various ports. Do you think it might make more sense to do the move to Modules as a separate patch instead?

Sure, that's fine.
Comment 20 Scott Graham 2011-11-18 15:59:19 PST
Created attachment 115898 [details]
retreat on Modules
Comment 21 Scott Graham 2011-11-18 16:00:27 PST
(In reply to comment #19)
> > Hmm... so there's a lot of include dirs to update for the various ports. Do you think it might make more sense to do the move to Modules as a separate patch instead?
> 
> Sure, that's fine.

OK, as soon as this one lands I'll work up a guinea pig move-to-Modules and hunt down all the necessary places to change include dirs.
Comment 22 Adam Barth 2011-11-18 16:48:22 PST
Comment on attachment 115898 [details]
retreat on Modules

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

> Source/WebCore/page/Navigator.cpp:35
> +#include "GamepadList.h"

Usually we put ifdefs around these sorts of headers so that folks who don't enable this feature don't need to include it.  This file is missing a bunch of those ifdefs, which is probably why you didn't add them.

> LayoutTests/gamepad/gamepad-api.html:3
> +<script src="gamepad-test.js"></script>

Is there some reason to use a gamepad-specific test harness rather than the usual script test harness?
Comment 23 Adam Barth 2011-11-18 16:49:08 PST
Comment on attachment 115898 [details]
retreat on Modules

This is fine to land as-is, but consider moving the test to use the usual fast/js testing helper functions as you add more gamepad tests.
Comment 24 WebKit Review Bot 2011-11-18 18:03:30 PST
Comment on attachment 115898 [details]
retreat on Modules

Clearing flags on attachment: 115898

Committed r100833: <http://trac.webkit.org/changeset/100833>
Comment 25 WebKit Review Bot 2011-11-18 18:03:37 PST
All reviewed patches have been landed.  Closing bug.
Comment 26 Scott Graham 2011-11-18 19:10:25 PST
Followup cleanup here: https://bugs.webkit.org/show_bug.cgi?id=72785