Modernizr.touch changes, as per #548 #800

Merged
merged 3 commits into from Jan 29, 2013

Projects

None yet

3 participants

@stucox
Member
stucox commented Jan 29, 2013

Modernizr.touch changes, as per #548:

  • Modernizr.touch -> Modernizr.touchevent (but touch still aliased)
  • Modernizr.pointerevents (CSS pointer-events) -> Modernizr.csspointerevents
  • Added test for DOM PointerEvents as Modernizr.pointerevents

API-breaking change.

I've done the PointerEvents test by checking for presence of the pointerdown event. Microsoft's recommendation is to use window.navigator.pointerEnabled (prefixed), but it isn't clear if pointerEnabled is intended to change dynamically as devices are connected/disconnected... anyone know? We agreed on #548 that Modernizr should focus on static capability to support pointer events, not dynamic state of whether or not an appropriate device is connected.

Review please!

@stucox
Owner
stucox commented on b36a6b2 Jan 29, 2013

Most of the changes in modulizr are thanks to Sublime trimming trailing whitespace...

@SlexAxton
Member

This looks good to me. I think the modulizr folder can pretty much go away in this new world, if I'm remembering correctly. Ashamed that I didn't have auto-whitespace removal when I wrote that file.

@SlexAxton SlexAxton merged commit 63f0022 into Modernizr:master Jan 29, 2013
@ryanseddon
Member

I think navigator.pointerEnabled would be just fine as the device should always have at least one input.

@stucox
Member
stucox commented Jan 29, 2013

Touch screen via a KVM which hasn't been switched over?

And for the sake of future-proofing, who knows what people will come up with in the future... we thought they'd always have a mouse.

@stucox
Member
stucox commented Jan 29, 2013

(I'm aware I'm probably being overly cautious...)

@stucox stucox deleted the stucox:548-touch branch Jan 29, 2013
@ryanseddon
Member

fair enough it's not overly complicated test and like you said it's more robust than just checking pointerEnabled.

@stucox
Member
stucox commented Jan 29, 2013

Of course keyboard-only is perfectly valid too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment