Updating gamepads test to match new spec #646

Merged
merged 2 commits into from Aug 6, 2012

Conversation

Projects
None yet
3 participants
@ebidel
Contributor

ebidel commented Aug 2, 2012

No description provided.

@ebidel

This comment has been minimized.

Show comment
Hide comment
@ebidel

ebidel Aug 2, 2012

Owner

Fix for #645

Owner

ebidel commented on b24c347 Aug 2, 2012

Fix for #645

feature-detects/gamepad.js
@@ -2,4 +2,5 @@
// https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html
// By Eric Bidelman
-Modernizr.addTest('gamepads', !!Modernizr.prefixed('gamepads', navigator));
+Modernizr.addTest('gamepads', !!Modernizr.prefixed('Gamepads', navigator) ||
+ !!Modernizr.prefixed('GetGamepads', navigator));

This comment has been minimized.

@paulirish

paulirish Aug 2, 2012

Member

lowercase for both, actually. getGamepads. prefixed() will uppercase both while it checks for prefixes versions. but the standard unprefixed is targetting lower.

@paulirish

paulirish Aug 2, 2012

Member

lowercase for both, actually. getGamepads. prefixed() will uppercase both while it checks for prefixes versions. but the standard unprefixed is targetting lower.

paulirish added a commit that referenced this pull request Aug 6, 2012

Merge pull request #646 from ebidel/master
Updating gamepads test to match new spec

@paulirish paulirish merged commit eb5ed64 into Modernizr:master Aug 6, 2012

@paulirish

This comment has been minimized.

Show comment
Hide comment
@paulirish

paulirish Aug 6, 2012

Member

pulled. thx. i'm gonna make a note about FF's inability to feature detect.

Member

paulirish commented Aug 6, 2012

pulled. thx. i'm gonna make a note about FF's inability to feature detect.

@Ms2ger

This comment has been minimized.

Show comment
Hide comment
@Ms2ger

Ms2ger Aug 16, 2012

Contributor

Hey Paul, what do you mean by "FF's inability to feature detect"?

Contributor

Ms2ger commented Aug 16, 2012

Hey Paul, what do you mean by "FF's inability to feature detect"?

@paulirish

This comment has been minimized.

Show comment
Hide comment
@paulirish

paulirish Aug 16, 2012

Member

@Ms2ger I mean there is no way to feature detect support for the gamepad API in Firefox.

You can only see that gamepad events are firing, but cannot see that the API is available

A day after posting the above, I realized that gamepad support is only available in special builds and not even behind a flag in nightly firefox. So it's not a huge deal. Sounds like updating the impl to the newest spec rev will happen soon.

Member

paulirish commented Aug 16, 2012

@Ms2ger I mean there is no way to feature detect support for the gamepad API in Firefox.

You can only see that gamepad events are firing, but cannot see that the API is available

A day after posting the above, I realized that gamepad support is only available in special builds and not even behind a flag in nightly firefox. So it's not a huge deal. Sounds like updating the impl to the newest spec rev will happen soon.

@Ms2ger

This comment has been minimized.

Show comment
Hide comment
@Ms2ger

Ms2ger Aug 16, 2012

Contributor

Oh, because we don't support the navigator property in the initial patch, right. |"GamePad" in window| should work, though.

Contributor

Ms2ger commented Aug 16, 2012

Oh, because we don't support the navigator property in the initial patch, right. |"GamePad" in window| should work, though.

@ebidel

This comment has been minimized.

Show comment
Hide comment
@ebidel

ebidel Aug 16, 2012

Contributor

IMO we should probably stay way from returning a false positive for FF's implementation.
It's not up to date with the current spec.

Contributor

ebidel commented Aug 16, 2012

IMO we should probably stay way from returning a false positive for FF's implementation.
It's not up to date with the current spec.

patrickkettner pushed a commit to patrickkettner/Modernizr that referenced this pull request Feb 22, 2015

Merge pull request #646 from ebidel/master
Updating gamepads test to match new spec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment