Closed Bug 697002 Opened 13 years ago Closed 13 years ago

Feature detection using window.ontouchstart/.ontouchend/etc. does not work

Categories

(Firefox for Android Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 659350
Firefox 9

People

(Reporter: soconnor.work, Assigned: mbrubeck)

References

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0a2) Gecko/20111024 Firefox/9.0a2
Build ID: 20111024042025

Steps to reproduce:

Tried to use JS to test for presence of 'touchstart', 'touchmove' or 'touchend' events on window, document or any HTML element.


Actual results:

'ontouchstart' in window is false
'ontouchmove' in window is false
'ontouchstart' in window is false

'ontouchstart' in document is false
'ontouchmove' in document is false
'ontouchstart' in document is false

'ontouchstart' in document.body is false
'ontouchmove' in document.body is false
'ontouchstart' in document.body is false


Expected results:

http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
OS: Mac OS X → Android
Assignee: nobody → mbrubeck
Blocks: 544614, 616348
OS: Android → All
Hardware: x86 → All
We'll have to make sure these properties are present only when the "dom.w3c_touch_events.enabled" preferences is true.  Smaug, can you point me to the right way to do this?  (Or feel free to steal this bug if you have time to work on it.)
Summary: touch[start|move|end] not JS testable → Feature detection using window.ontouchstart/.ontouchend/etc. does not work
Version: Firefox 8 → Trunk
Note: For now, you can detect touch event support in Firefox and other browsers with this test: ("createTouch" in document)
It looks like this is already fixed in Firefox 9 by bug 659350, which also made the same type of feature detection work for other events, like: ("onclick" in document)
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
Target Milestone: --- → Firefox 9
You need to log in before you can comment on or make changes to this bug.