Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Test for Safari WebKit Force Touch Events #1613

Merged
merged 1 commit into from Nov 27, 2015

Conversation

@KraigWalker
Copy link
Contributor

@KraigWalker KraigWalker commented Jul 18, 2015

Will test if the currently defined flow of webkitmouseforce events from Apple is supported by the browser, and if the browser provides the WEBKIT_FORCE_AT_MOUSE_DOWN and WEBKIT_FORCE_AT_FORCE_MOUSE_DOWN constants on the MouseEvent object.

https://developer.apple.com/library/prerelease/mac/documentation/AppleApplications/Conceptual/SafariJSProgTopics/Articles/RespondingtoForceTouchEventsfromJavaScript.html#//apple_ref/doc/uid/TP40016162-SW1

@modernizr-savage
Copy link

@modernizr-savage modernizr-savage commented Jul 18, 2015

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: 116035a
Build details: https://travis-ci.org/modernizr-savage/Modernizr/builds/71570544

(Please note that this is a fully automated comment.)

@modernizr-savage
Copy link

@modernizr-savage modernizr-savage commented Jul 18, 2015

Tests passed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED

Commit: 4cd0df2
Build details: https://travis-ci.org/modernizr-savage/Modernizr/builds/71571124

(Please note that this is a fully automated comment.)

@KraigWalker
Copy link
Contributor Author

@KraigWalker KraigWalker commented Jul 19, 2015

See #1606

Modernizr.addTest('forcetouch', function() {

// Test if the browser supports the force touch event progression (see notes link)
if (!hasEvent('webkitmouseforcewillbegin', window) &&

This comment has been minimized.

@ryanseddon

ryanseddon Aug 2, 2015
Member

We should probably generate these event names via Modernizr.prefixed so in the case they become unprefixed.

@KraigWalker
Copy link
Contributor Author

@KraigWalker KraigWalker commented Sep 9, 2015

@ryanseddon thanks for looking into that. I'll be adding a revision over this with Modernizr.prefixed today.

@KraigWalker
Copy link
Contributor Author

@KraigWalker KraigWalker commented Sep 14, 2015

Updated to use Modernizr.prefixed

@patrickkettner
Copy link
Member

@patrickkettner patrickkettner commented Sep 21, 2015

@KraigWalker looks like you have committed with git's markers in it still. Wanna clean it up and squash it down to a single commit?

@patrickkettner
Copy link
Member

@patrickkettner patrickkettner commented Oct 18, 2015

@KraigWalker
Copy link
Contributor Author

@KraigWalker KraigWalker commented Nov 9, 2015

+1 #cantbelieveijustleftthiswhatwasithinking sorry! 😓

@patrickkettner
Copy link
Member

@patrickkettner patrickkettner commented Nov 9, 2015

sorry, where you going to be able to update?

cheers!

@KraigWalker
Copy link
Contributor Author

@KraigWalker KraigWalker commented Nov 11, 2015

Hey, Patrick. Most likely tonight. Going to dedicate some time to fix my broken PR (it seems to exist across two branches, which really isn't nice)

Sent from my iPhone

On 9 Nov 2015, at 17:10, patrick kettner notifications@github.com wrote:

sorry, where you going to be able to update?

cheers!


Reply to this email directly or view it on GitHub.

@patrickkettner
Copy link
Member

@patrickkettner patrickkettner commented Nov 11, 2015

@KraigWalker KraigWalker force-pushed the KraigWalker:forcetouch branch 3 times, most recently from 1618417 to d2153d3 Nov 11, 2015
@KraigWalker
Copy link
Contributor Author

@KraigWalker KraigWalker commented Nov 12, 2015

That's it sorted now.

return true;
} else {
return false;
}

This comment has been minimized.

@patrickkettner

patrickkettner Nov 16, 2015
Member

this should just be return MouseEvent.WEBKIT_FORCE_AT_MOUSE_DOWN && MouseEvent.WEBKIT_FORCE_AT_FORCE_MOUSE_DOWN

Modernizr.addTest('forcetouch', function() {
// github.com/Modernizr/Modernizr/issues/1613
// Test if the browser supports the force touch event progression (see notes link)
if (!hasEvent(prefixed('mouseforcewillbegin', window, false), window) &&

This comment has been minimized.

@patrickkettner

patrickkettner Nov 16, 2015
Member

keying off of one of these events is fine. Its extremely unlikely to have a situation where mouseforcewillbegin exists but the others do not. Removign the others saves a fair amount of bits

@patrickkettner
Copy link
Member

@patrickkettner patrickkettner commented Nov 16, 2015

sorry, couple more nits then we will be all good and merged

@KraigWalker
Copy link
Contributor Author

@KraigWalker KraigWalker commented Nov 17, 2015

No problem. Thanks for reviewing it.

On 16 Nov 2015, at 22:55, patrick kettner notifications@github.com wrote:

sorry, couple more nits then we will be all good and merged


Reply to this email directly or view it on GitHub.

Adds a feature detect for mouse force related events, and whether force values can
be read from the MouseEvent object.
@KraigWalker KraigWalker force-pushed the KraigWalker:forcetouch branch from d2153d3 to 93ceb13 Nov 19, 2015
patrickkettner added a commit that referenced this pull request Nov 27, 2015
Add Test for Safari WebKit Force Touch Events
@patrickkettner patrickkettner merged commit 9743105 into Modernizr:master Nov 27, 2015
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@patrickkettner
Copy link
Member

@patrickkettner patrickkettner commented Nov 27, 2015

cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants