@@ -112,7 +112,7 @@ define([
112
112
createPointer ( utils . events . OUT , e , touch , { relatedTarget : touchTarget } ) ) ;
113
113
// generate pointerleave event(s)
114
114
utils . dispatchLeaveEvents ( lastElementFromPoint , touchTarget ,
115
- createPointer ( utils . events . LEAVE , e , touch , { relatedTarget : touchTarget , bubbles : false } ) ) ;
115
+ createPointer ( utils . events . LEAVE , e , touch , { relatedTarget : touchTarget } ) ) ;
116
116
// generate pointermove
117
117
utils . dispatchEvent ( touchTarget , createPointer ( utils . events . MOVE , e , touch , { } ) ) ;
118
118
// generate pointerover
@@ -121,7 +121,7 @@ define([
121
121
// generate pointerenter event(s)
122
122
utils . dispatchEnterEvents ( touchTarget , lastElementFromPoint ,
123
123
createPointer ( utils . events . ENTER , e , touch ,
124
- { relatedTarget : lastElementFromPoint , bubbles : false } ) ) ;
124
+ { relatedTarget : lastElementFromPoint } ) ) ;
125
125
} else {
126
126
utils . dispatchEvent ( touchTarget , createPointer ( utils . events . MOVE , e , touch , { } ) ) ;
127
127
}
@@ -233,16 +233,16 @@ define([
233
233
props . altKey = touchEvent . altKey ;
234
234
props . shiftKey = touchEvent . shiftKey ;
235
235
props . metaKey = touchEvent . metaKey ;
236
+ props . pageX = touch . pageX ;
237
+ props . pageY = touch . pageY ;
236
238
if ( TouchTracker . hasCapture ( touch . identifier ) ) { // W3C spec §10.1
237
239
props . relatedTarget = null ;
238
240
}
239
241
// normalize button/buttons values
240
242
// http://www.w3.org/TR/pointerevents/#chorded-button-interactions
241
- // for pointer: button=0, buttons=1, which=1 for all events but PointerMove: button=-1,buttons=0,which=0
242
- // as it is not possible to assign negative value to button(s), just use 0.
243
- props . button = 0 ;
243
+ props . button = ( pointerType === utils . events . MOVE ) ? - 1 : 0 ;
244
244
props . buttons = 1 ;
245
- props . which = 1 ;
245
+ props . which = props . button + 1 ;
246
246
// Pointer Events properties
247
247
props . pointerId = touch . identifier + 2 ; // avoid id collision: 1 is reserved for mouse events mapping
248
248
props . pointerType = "touch" ;
@@ -282,18 +282,17 @@ define([
282
282
* @return HTMLElement the DOM element.
283
283
*/
284
284
function elementFromTouch ( touch ) {
285
- //todo: investigate #15821 (different behaviors?)
286
- return touch . target . ownerDocument . elementFromPoint ( touch . pageX , touch . pageY ) ;
285
+ return touch . target . ownerDocument . elementFromPoint ( touch . clientX , touch . clientY ) ;
287
286
}
288
287
289
288
// todo:refactor + document TouchTracker/TouchInfo
290
- /* function TouchInfo(touchId, touchAction) {
291
- this.touchId = touchId;
292
- this.touchAction = 0;
293
- this.lastNativeEvent = null;
294
- this.lastTargetElement = null;
295
- this.captureTarget = null;
296
- }*/
289
+ /* function TouchInfo(touchId, touchAction) {
290
+ this.touchId = touchId;
291
+ this.touchAction = 0;
292
+ this.lastNativeEvent = null;
293
+ this.lastTargetElement = null;
294
+ this.captureTarget = null;
295
+ }*/
297
296
var TouchTracker = {
298
297
// touchId of the primary pointer, or -1 if no primary pointer set.
299
298
primaryTouchId : - 1 ,
0 commit comments