Closed Bug 1081070 Opened 10 years ago Closed 8 years ago

'ontouchstart' and other properties are not attached to the window object when simulating touch events in the debugger tools responsive design mode

Categories

(DevTools :: Responsive Design Mode, defect)

34 Branch
x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 52

People

(Reporter: fabiosantosart, Unassigned)

References

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:34.0) Gecko/20100101 Firefox/34.0
Build ID: 20141009004002

Steps to reproduce:

 - Press F12 to open debugger tools
 - Click the "responsive design mode" button
 - Click the "simulate touch events" icon (a finger touching)
 - Refresh


Actual results:

I can't detect touch events because:

 - there's no 'ontouchstart' in window, document, documentElement or in any element
 - there's no 'ontouchmove' or 'ontouchend' either


Expected results:

My code would be able to detect touch events because:

 - there should be 'ontouchstart', 'ontouchmove' and 'ontouchend' properties in the javascript window object and in elements, initially set to null
Version: 35 Branch → 34 Branch
I'm on Firefox Aurora (34.0a2 (2014-10-09)), but a friend has confirmed this on 32.0.3
Component: Untriaged → DOM: Events
Product: Firefox → Core
Component: DOM: Events → Developer Tools
Product: Core → Firefox
Component: Developer Tools → Developer Tools: Responsive Mode
To be clear, in my javascript code there's a condition for checking whether touch events exist:

if ('ontouchstart' in window) {
    // listen to touch events
}

The condition fails when simulating touch events on firefox, but I strongly feel that it shouldn't.
Even on my hardware-touch-enabled laptop, the condition stated above is false.  I have a feeling that this scheme is generally broken (tested on Firefox 33.0.2).

E.g. this page also shows that touch is not supported, while it does on Chrome and Internet Explorer on the same machine.
http://www.kirupa.com/html5/check_if_you_are_on_a_touch_enabled_device.htm
Scrolling and pinching by touch work, though.
This is still broken on Firefox 35.

The properties which indicate that touch events can be listened to on elements are not present yet. Emulation of touch events in this responsive view is very important for mobile web development, and firefox is still behind chrome in that dragging won't simulate mobile scrolling.
This bug appears to be fixed in the new RDM UI shipping in Firefox 52.
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Depends on: enable-rdm
Resolution: --- → FIXED
Target Milestone: --- → Firefox 52
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.