Description

For "touchmove" native events, dojo/touch creates a synthetic touch.move event. Now, the trouble is that, in iOS6, all the properties of the native touchmove event are missing from the synthetic event, while they are available when running on iOS 4 and 5.

Reproduced on iPhone 4S under iOS 6 (6.0), using any recent Dojo version (initial 1.8, 1.8-patch or trunk).

The attached test_bug-synthetic-event-ios6.html is a simple test case which demonstrates the difference of behavior on iOS6 vs. iOS4 or 5. How to reproduce:

Run the test on iOS 4 or 5.

Follow the indication written in the app itself (touch and move over the blue upper area, and check the log written in the white scrollable area).

=> You can see in the lower part of the window the log traces for three events: a touch.press, a touch.move, and a synthetic touch.move. For all these events, all the properties of the event are NOT undefined. So far so good.

Run the same test on an iOS6 device.

=> All the properties present on the native mousemove event are now undefined for the synthetic touch.move (and only for this event).

This is a follow-up of #16090, which holds only for the "touches" property of the event and is fixed in Dojo 1.8.1.

Colin suggested using Object.getOwnPropertyNames() if available, rather than lang.mixin(). I'll try that.

The documentation for touch.move also needs to be updated. It says it registers a "touchmove" listener but what it does is actually quite different than that because of when the event fires, which is when the finger is over the specified node, not when the finger started on the specified node.

This problem stems from trying to make a copy of the event, which triggers the iOS6 bug mentioned above. I thought that making a copy was necessary because:

if I didn't make a copy I couldn't reset evt.target

Resetting evt.target would affect listeners to the native "touchmove" event

However, my tests now show neither of those things to be problems. So I want to just remove the copying altogether. I'll check that into trunk, and if the change is working for you too then I'll backport it to 1.8.

Don't make copy of event object. It appears to be unnecessary, and it triggers an iOS6 bug with properties in the event object being marked as non-enumerable. Fixes #16108, #16090 on 1.8/ branch !strict.