Bug 133850 - HTML5 Gamepad API implementation
Summary: HTML5 Gamepad API implementation
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 133848 133849
Blocks: 133847 133851 133854 133853
  Show dependency treegraph
 
Reported: 2014-06-13 06:47 PDT by Michal Debski
Modified: 2014-06-26 04:12 PDT (History)
11 users (show)

See Also:


Attachments
Patch (71.78 KB, patch)
2014-06-23 03:20 PDT, Michal Debski
no flags Details | Formatted Diff | Diff
Patch (57.17 KB, patch)
2014-06-24 07:25 PDT, Michal Debski
no flags Details | Formatted Diff | Diff
Patch (60.58 KB, patch)
2014-06-24 07:30 PDT, Michal Debski
no flags Details | Formatted Diff | Diff
Patch (59.17 KB, patch)
2014-06-24 09:52 PDT, Michal Debski
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michal Debski 2014-06-13 06:47:23 PDT
For information on spec, please see:
http://www.w3.org/TR/gamepad/

The gamepad API implementation consist of 3 main parts. Per DOMWindow EventController, global Gamepads Manager and port specific Provider.
GamepadEventController is created as supplement to DOMWindow, but does not trigger creation of GamepadsManager until any of Gamepad related functions are called. When the need for gamepad arise (through navigator.getGamepads, or window.addListner( gamepadevent )) GamepadEventController will request manager and register for all events. It will forward any events received from manager to DOMWindow for dispatching.
GamepadsManager is first created when any of GamepadEventControllers request it and will live as long as last GamepadEventController has reference to it(ownership of GamepadsManager is shared between controllers). This ensures that the Gamepad objects will live as long as page which might have reference to it. GamepadsManager creates GamepadsProvider on construction and allows it to update gamepads information manger's methods.
GamepadsProvder is port specific and communicates directly with devices. It informs manager about connected/disconnected and changed gamepads.
Comment 1 Michal Debski 2014-06-23 03:20:08 PDT
Created attachment 233591 [details]
Patch
Comment 2 Michal Debski 2014-06-24 07:25:54 PDT
Created attachment 233702 [details]
Patch

Rebase
Comment 3 Michal Debski 2014-06-24 07:30:41 PDT
Created attachment 233703 [details]
Patch

Rebase
Comment 4 WebKit Commit Bot 2014-06-24 07:32:48 PDT
Attachment 233703 [details] did not pass style-queue:


ERROR: Source/WebCore/Modules/gamepad/Gamepad.h:65:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/Modules/gamepad/Gamepad.h:80:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/Modules/gamepad/Gamepad.h:98:  The parameter name "data" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/WebCore/platform/GamepadsProvider.h:33:  Alphabetical sorting problem.  [build/include_order] [4]
ERROR: Source/WebCore/platform/efl/GamepadsProviderEfl.cpp:32:  Found header this file implements after other header. Should be: config.h, primary header, blank line, and then alphabetically sorted.  [build/include_order] [4]
ERROR: Source/WebCore/Modules/gamepad/GamepadEventController.cpp:30:  Found other header before a header this file implements. Should be: config.h, primary header, blank line, and then alphabetically sorted.  [build/include_order] [4]
ERROR: Source/WebCore/Modules/gamepad/GamepadEventController.cpp:30:  Alphabetical sorting problem.  [build/include_order] [4]
ERROR: Source/WebCore/Modules/gamepad/GamepadEventController.cpp:32:  Found header this file implements after other header. Should be: config.h, primary header, blank line, and then alphabetically sorted.  [build/include_order] [4]
ERROR: Source/WebCore/Modules/gamepad/GamepadEventController.cpp:35:  Found header this file implements after other header. Should be: config.h, primary header, blank line, and then alphabetically sorted.  [build/include_order] [4]
ERROR: Source/WebCore/Modules/gamepad/GamepadEventController.cpp:48:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/Modules/gamepad/GamepadEventController.cpp:49:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/Modules/gamepad/GamepadEventController.cpp:49:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
ERROR: Source/WebCore/Modules/gamepad/GamepadEventController.cpp:50:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/Modules/gamepad/GamepadEventController.cpp:50:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
ERROR: Source/WebCore/Modules/gamepad/GamepadEventController.cpp:110:  Missing space before ( in if(  [whitespace/parens] [5]
ERROR: Source/WebCore/Modules/gamepad/GamepadEvent.h:44:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/Modules/gamepad/GamepadEvent.h:61:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/Modules/gamepad/GamepadEvent.h:64:  The parameter name "gamepad" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/WebCore/Modules/gamepad/GamepadEvent.h:65:  The parameter name "gamepad" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/WebCore/platform/gtk/GamepadsProviderGtk.cpp:32:  Found header this file implements after other header. Should be: config.h, primary header, blank line, and then alphabetically sorted.  [build/include_order] [4]
ERROR: Source/WebCore/platform/gtk/GamepadsProviderGtk.cpp:38:  Alphabetical sorting problem.  [build/include_order] [4]
ERROR: Source/WebCore/platform/gtk/GamepadsProviderGtk.cpp:87:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
ERROR: Source/WebCore/Modules/gamepad/GamepadsManager.cpp:30:  Found other header before a header this file implements. Should be: config.h, primary header, blank line, and then alphabetically sorted.  [build/include_order] [4]
ERROR: Source/WebCore/Modules/gamepad/GamepadsManager.cpp:31:  Found header this file implements after other header. Should be: config.h, primary header, blank line, and then alphabetically sorted.  [build/include_order] [4]
ERROR: Source/WebCore/Modules/gamepad/GamepadsManager.cpp:33:  Found header this file implements after other header. Should be: config.h, primary header, blank line, and then alphabetically sorted.  [build/include_order] [4]
ERROR: Source/WebCore/Modules/gamepad/GamepadEvent.cpp:31:  You should add a blank line after implementation file's own header.  [build/include_order] [4]
ERROR: Source/WebCore/Modules/gamepad/GamepadEvent.cpp:31:  You should not add a blank line before implementation file's own header.  [build/include_order] [4]
ERROR: Source/WebCore/Modules/gamepad/GamepadEvent.cpp:60:  Code inside a namespace should not be indented.  [whitespace/indent] [4]
ERROR: Source/WebCore/Modules/gamepad/GamepadEvent.cpp:38:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/Modules/gamepad/GamepadEvent.cpp:44:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/Modules/gamepad/GamepadEvent.cpp:54:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/Modules/gamepad/GamepadEvent.cpp:59:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/Modules/gamepad/GamepadEvent.cpp:60:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/Modules/gamepad/NavigatorGamepad.cpp:31:  You should not add a blank line before implementation file's own header.  [build/include_order] [4]
ERROR: Source/WebCore/Modules/gamepad/Gamepad.cpp:30:  You should add a blank line after implementation file's own header.  [build/include_order] [4]
ERROR: Source/WebCore/Modules/gamepad/Gamepad.cpp:30:  You should not add a blank line before implementation file's own header.  [build/include_order] [4]
ERROR: Source/WebCore/Modules/gamepad/Gamepad.cpp:69:  Code inside a namespace should not be indented.  [whitespace/indent] [4]
ERROR: Source/WebCore/Modules/gamepad/Gamepad.cpp:68:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/Modules/gamepad/Gamepad.cpp:69:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/Modules/gamepad/GamepadButton.h:51:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/Modules/gamepad/GamepadButton.h:56:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/Modules/gamepad/GamepadButton.h:73:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/Modules/gamepad/GamepadButton.h:77:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/Modules/gamepad/GamepadButton.h:81:  Missing space before {  [whitespace/braces] [5]
Total errors found: 44 in 31 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Michal Debski 2014-06-24 09:52:42 PDT
Created attachment 233710 [details]
Patch

Fixed some code-styles (rest is unsupported uniform initalizations) and EFL build.
Comment 6 WebKit Commit Bot 2014-06-24 09:54:44 PDT
Attachment 233710 [details] did not pass style-queue:


ERROR: Source/WebCore/Modules/gamepad/Gamepad.h:65:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/Modules/gamepad/Gamepad.h:80:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/Modules/gamepad/Gamepad.h:98:  The parameter name "data" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/WebCore/platform/GamepadsProvider.h:34:  Alphabetical sorting problem.  [build/include_order] [4]
ERROR: Source/WebCore/Modules/gamepad/GamepadEventController.cpp:31:  Alphabetical sorting problem.  [build/include_order] [4]
ERROR: Source/WebCore/Modules/gamepad/GamepadEventController.cpp:48:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/Modules/gamepad/GamepadEventController.cpp:49:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/Modules/gamepad/GamepadEventController.cpp:49:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
ERROR: Source/WebCore/Modules/gamepad/GamepadEventController.cpp:50:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/Modules/gamepad/GamepadEventController.cpp:50:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
ERROR: Source/WebCore/Modules/gamepad/GamepadEventController.cpp:110:  Missing space before ( in if(  [whitespace/parens] [5]
ERROR: Source/WebCore/Modules/gamepad/GamepadEvent.h:44:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/Modules/gamepad/GamepadEvent.h:61:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/platform/gtk/GamepadsProviderGtk.cpp:32:  Found header this file implements after other header. Should be: config.h, primary header, blank line, and then alphabetically sorted.  [build/include_order] [4]
ERROR: Source/WebCore/platform/gtk/GamepadsProviderGtk.cpp:38:  Alphabetical sorting problem.  [build/include_order] [4]
ERROR: Source/WebCore/platform/gtk/GamepadsProviderGtk.cpp:87:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
ERROR: Source/WebCore/Modules/gamepad/GamepadEvent.cpp:60:  Code inside a namespace should not be indented.  [whitespace/indent] [4]
ERROR: Source/WebCore/Modules/gamepad/GamepadEvent.cpp:38:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/Modules/gamepad/GamepadEvent.cpp:44:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/Modules/gamepad/GamepadEvent.cpp:54:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/Modules/gamepad/GamepadEvent.cpp:59:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/Modules/gamepad/GamepadEvent.cpp:60:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/Modules/gamepad/Gamepad.cpp:69:  Code inside a namespace should not be indented.  [whitespace/indent] [4]
ERROR: Source/WebCore/Modules/gamepad/Gamepad.cpp:68:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/Modules/gamepad/Gamepad.cpp:69:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/Modules/gamepad/GamepadButton.h:51:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/Modules/gamepad/GamepadButton.h:56:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/Modules/gamepad/GamepadButton.h:73:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/Modules/gamepad/GamepadButton.h:77:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/Modules/gamepad/GamepadButton.h:81:  Missing space before {  [whitespace/braces] [5]
Total errors found: 30 in 29 files


If any of these errors are false positives, please file a bug against check-webkit-style.