Changes between Initial Version and Version 1 of Ticket #16090, comment 1


Ignore:
Timestamp:
Oct 2, 2012, 2:24:33 PM (8 years ago)
Author:
Adrian Vasiliu
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #16090, comment 1

    initial v1  
    55lang.mixin({}, evt, { ... additional properties ...});
    66
    7 This is supposed to copy the properties of the native event into the synthetic event. Now, lang.mixin iterates over the "enumerable properties" of the source object (here, our native event) using a "for...in" loop. On iOS 6, just as on iOS 4 and 5, the native event does have a "touches" enumerable property (you can print its value or assign it to a var), but on iOS6 it appears Apple decided that "touches" becomes a non-enumerable property...  The attached test case also tests whether "e.touches" is hit by the "for...in" loop as done by lang.mixin. As you can see from the log trace in the test, it is not hit anymore on iOS6.
     7This is supposed to copy the properties of the native event into the synthetic event. Now, lang.mixin iterates over the "enumerable properties" of the source object (here, our native event) using a "for...in" loop. On iOS 6, just as on iOS 4 and 5, the native event does have a "touches" property (you can print its value or assign it to a var), but on iOS6 it appears Apple decided that "touches" becomes a non-enumerable property, which is not hit by for...in. The attached test case also tests whether "e.touches" is hit by the "for...in" loop. As you can see from the log trace in the test, it is not hit anymore on iOS6.
    88
    99The attached fix_synthetic-event-ios6.patch is a simple fix proposal: dojo/touch forces the copy of the "touches" property. This is only necessary (so far) on iOS6, while being harmless on iOS 4 or 5.