forked from lifaon74/events-polyfill
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
750 lines (643 loc) · 25.4 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
module.exports = (function() {
if(typeof EventTarget === 'undefined') {
window.EventTarget = Node;
}
/**
* Event listener interceptor
*/
var EventListenerInterceptor = {
interceptors: [] // { target: EventTarget, interceptors: [{ add: Function, remove: Function }, ...] }
};
/**
* Returns if exists a previously registered listener from a target and the normalized arguments
* @param target
* @param normalizedArguments
* @return {*}
*/
EventListenerInterceptor.getRegisteredEventListener = function(target, normalizedArguments) {
var key = normalizedArguments.type + '-' + (normalizedArguments.options.capture ? '1' : '0');
if(
(target.__eventListeners !== void 0) &&
(target.__eventListeners[key] !== void 0)
) {
var map = target.__eventListeners[key];
for(var i = 0; i < map.length; i++) {
if(map[i].listener === normalizedArguments.listener) {
return map[i];
}
}
}
return null;
};
/**
* Registers a listener on a target with some options
* @param target
* @param normalizedArguments
*/
EventListenerInterceptor.registerEventListener = function(target, normalizedArguments) {
var key = normalizedArguments.type + '-' + (normalizedArguments.options.capture ? '1' : '0');
if(target.__eventListeners === void 0) {
target.__eventListeners = {};
}
if(target.__eventListeners[key] === void 0) {
target.__eventListeners[key] = [];
}
target.__eventListeners[key].push(normalizedArguments);
};
/**
* Unregisters a listener on a target with some options
* @param target
* @param normalizedArguments
*/
EventListenerInterceptor.unregisterEventListener = function(target, normalizedArguments) {
var key = normalizedArguments.type + '-' + (normalizedArguments.options.capture ? '1' : '0');
if(
(target.__eventListeners !== void 0) &&
(target.__eventListeners[key] !== void 0)
) {
var map = target.__eventListeners[key];
for(var i = 0; i < map.length; i++) {
if(map[i].listener === normalizedArguments.listener) {
map.splice(i, 1);
}
}
if(map.length === 0) {
delete target.__eventListeners[key];
}
}
};
EventListenerInterceptor.normalizeListenerCallback = function(listener) {
if(typeof listener === 'function') {
return listener;
} else if((typeof listener === 'object') && (typeof listener.handleEvent === 'function')) {
return listener.handleEvent;
} else {
// to support Symbol
return function(event) {
listener(event);
};
}
};
EventListenerInterceptor.normalizeListenerOptions = function(options) {
var type = options === null ? 'null' : typeof options;
switch(type) {
case 'boolean':
options = { capture: options };
break;
case 'undefined':
case 'null':
options = { capture: false };
break;
case 'object':
break;
default:
throw new Error('Unsupported options type for addEventListener');
}
options.once = Boolean(options.once);
options.passive = Boolean(options.passive);
options.capture = Boolean(options.capture);
return options;
};
EventListenerInterceptor.normalizeListenerArguments = function(type, listener, options) {
return {
type: type,
listener: this.normalizeListenerCallback(listener),
options: this.normalizeListenerOptions(options)
};
};
EventListenerInterceptor.intercept = function(target, interceptors) {
// get an interceptor with this target or null
var interceptor = null;
for (var i = 0; i < this.interceptors.length; i++) {
if(this.interceptors[i].target === target) {
interceptor = this.interceptors[i];
}
}
// if no interceptor already set
if (interceptor === null) {
interceptor = { target: target, interceptors: [interceptors] };
this.interceptors.push(interceptor);
this.interceptAddEventListener(target, interceptor);
this.interceptRemoveEventListener(target, interceptor);
} else { // if an interceptor already set, simply add interceptors to the list
interceptor.interceptors.push(interceptors);
}
// var release = function() {
// target.prototype.addEventListener = addEventListener;
// target.prototype.removeEventListener = removeEventListener;
// };
// this.interceptors.push(release);
// return release;
};
EventListenerInterceptor.interceptAddEventListener = function(target, interceptor) {
var _this = this;
var addEventListener = target.prototype.addEventListener;
target.prototype.addEventListener = function(type, listener, options) {
var normalizedArguments = _this.normalizeListenerArguments(type, listener, options);
var registeredEventListener = _this.getRegisteredEventListener(this, normalizedArguments);
if (!registeredEventListener) {
normalizedArguments.polyfilled = {
type: normalizedArguments.type,
listener: normalizedArguments.listener,
options: {
capture: normalizedArguments.options.capture,
once: normalizedArguments.options.once,
passive: normalizedArguments.options.passive
}
};
for (var i = 0; i < interceptor.interceptors.length; i++) {
var interceptors = interceptor.interceptors[i];
if (typeof interceptors.add === 'function') {
interceptors.add(normalizedArguments);
}
}
// console.log('normalizedArguments', normalizedArguments.polyfilled);
_this.registerEventListener(this, normalizedArguments);
addEventListener.call(
this,
normalizedArguments.polyfilled.type,
normalizedArguments.polyfilled.listener,
normalizedArguments.polyfilled.options
);
}
};
return function() {
target.prototype.addEventListener = addEventListener;
};
};
EventListenerInterceptor.interceptRemoveEventListener = function(target, interceptor) {
var _this = this;
var removeEventListener = target.prototype.removeEventListener;
target.prototype.removeEventListener = function(type, listener, options) {
var normalizedArguments = _this.normalizeListenerArguments(type, listener, options);
var registeredEventListener = _this.getRegisteredEventListener(this, normalizedArguments);
if (registeredEventListener) {
_this.unregisterEventListener(this, normalizedArguments);
removeEventListener.call(
this,
registeredEventListener.polyfilled.type,
registeredEventListener.polyfilled.listener,
registeredEventListener.polyfilled.options
);
} else {
removeEventListener.call(this, type, listener, options);
}
};
return function() {
target.prototype.removeEventListener = removeEventListener;
};
};
EventListenerInterceptor.interceptAll = function(interceptors) {
this.intercept(EventTarget, interceptors);
if(!(window instanceof EventTarget)) {
this.intercept(Window, interceptors);
}
};
EventListenerInterceptor.releaseAll = function() {
for(var i = 0, l = this.interceptors.length; i < l; i++) {
this.interceptors();
}
};
EventListenerInterceptor.error = function(error) {
// throw error;
console.error(error);
};
return EventListenerInterceptor;
})();
},{}],2:[function(require,module,exports){
(function(EventListenerInterceptor) {
/**
* Event listener type support
*/
EventListenerInterceptor.isSupportedOnEvent = function(target, type) {
return (('on' + type) in target);
};
EventListenerInterceptor.isSupportedTransitionEvent = function(target, type) {
return EventListenerInterceptor.isSupportedOnEvent(target, type) || (('style' in target) && (target.style['transition'] !== void 0));
};
EventListenerInterceptor.isSupportedFullScreenEvent = function(target, type) {
if(EventListenerInterceptor.isSupportedOnEvent(target, type)) {
return true;
} else {
if(/^ms/.test(type.toLowerCase())) {
return 'msRequestFullscreen' in document.body;
} else if(/^moz/.test(type)) {
return 'mozRequestFullscreen' in document.body;
} else if(/^webkit/.test(type)) {
return 'webkitRequestFullscreen' in document.body;
} else {
return false;
}
}
};
EventListenerInterceptor.generateEventTypes = function() {
var _this = this;
this.eventTypes = {}; // map of types that resolved to something else
this.vendorPrefixes = ['', 'webkit', 'moz', 'ms', 'o'];
this.eventTypes['wheel'] = ['wheel', 'mousewheel', 'DOMMouseScroll'].map(function(type) {
return { type: type, isSupported: _this.isSupportedOnEvent } ;
});
this.eventTypes['fullscreenchange'] = ['fullscreenchange', 'mozfullscreenchange', 'webkitfullscreenchange', 'MSFullscreenChange', 'msfullscreenchange'].map(function(type) {
return { type: type, isSupported: _this.isSupportedFullScreenEvent } ;
});
this.eventTypes['fullscreenerror'] = ['fullscreenerror', 'mozfullscreenerror', 'webkitfullscreenerror', 'MSFullscreenError', 'msfullscreenerror'].map(function(type) {
return { type: type, isSupported: _this.isSupportedFullScreenEvent } ;
});
[
'pointerlockchange', 'pointerlockerror',
'animationstart', 'animationiteration', 'animationend',
'pointercancel', 'pointerdown', 'pointerhover', 'pointermove', 'pointerout', 'pointerover', 'pointerup'
].forEach(function(type) {
_this.eventTypes[type] = _this.vendorPrefixes
.map(function(prefix) {
return { type: (prefix + type), isSupported: _this.isSupportedOnEvent } ;
});
});
['transitionstart', 'transitionrun', 'transitionend'].forEach(function(type) {
_this.eventTypes[type] = _this.vendorPrefixes
.map(function(prefix) {
return { type: (prefix + type), isSupported: _this.isSupportedTransitionEvent } ;
});
});
};
EventListenerInterceptor.getSupportedEventType = function(target, type) {
var types = this.eventTypes[type];
if(types === void 0) {
return type;
} else {
var _type;
for(var i = 0; i < types.length; i++) {
_type = types[i];
if(_type.isSupported(target, _type.type)) {
// console.log('use : ' + eventTypesPolyfiller[i].type);
return _type.type;
}
}
// this.error(new Error('Event listener type ' + String(type) + ' on ' + String(target) + ' is not supported by current environment'));
return type;
}
};
EventListenerInterceptor.polyfillListenerEventTypes = function() {
this.generateEventTypes();
var _this = this;
this.interceptAll({
add: function(normalizedArguments) {
normalizedArguments.polyfilled.type = _this.getSupportedEventType(this, normalizedArguments.polyfilled.type);
}
});
};
EventListenerInterceptor.polyfillListenerEventTypes();
})(require('./EventListenerInterceptor.js'));
},{"./EventListenerInterceptor.js":1}],3:[function(require,module,exports){
(function(EventListenerInterceptor) {
/**
* Event listener options support
*/
EventListenerInterceptor.detectSupportedOptions = function() {
var _this = this;
this.supportedOptions = {
once: false,
passive: false,
capture: false,
all: false,
some: false
};
document.createDocumentFragment().addEventListener('test', function() {}, {
get once() {
_this.supportedOptions.once = true;
return false;
},
get passive() {
_this.supportedOptions.passive = true;
return false;
},
get capture() {
_this.supportedOptions.capture = true;
return false;
}
});
// useful shortcuts to detect if options are all/some supported
this.supportedOptions.all = this.supportedOptions.once && this.supportedOptions.passive && this.supportedOptions.capture;
this.supportedOptions.some = this.supportedOptions.once || this.supportedOptions.passive || this.supportedOptions.capture;
};
EventListenerInterceptor.polyfillListenerOptions = function() {
this.detectSupportedOptions();
if (!this.supportedOptions.all) {
var _this = this;
this.interceptAll({
add: function(normalizedArguments) {
// console.log('intercepted', normalizedArguments);
var once = normalizedArguments.options.once && !_this.supportedOptions.once;
var passive = normalizedArguments.options.passive && !_this.supportedOptions.passive;
if (once || passive) {
var listener = normalizedArguments.polyfilled.listener;
normalizedArguments.polyfilled.listener = function(event) {
if(once) {
this.removeEventListener(normalizedArguments.type, normalizedArguments.listener, normalizedArguments.options);
}
if(passive) {
event.preventDefault = function() {
throw new Error('Unable to preventDefault inside passive event listener invocation.');
};
}
return listener.call(this, event);
};
}
if (!_this.supportedOptions.some) {
normalizedArguments.polyfilled.options = normalizedArguments.options.capture;
}
}
});
}
};
EventListenerInterceptor.polyfillListenerOptions();
// var onclick = function() {
// console.log('click');
// };
// document.body.addEventListener('click', onclick, false);
// document.body.addEventListener('click', onclick, { once: true });
// document.body.addEventListener('click', onclick, { once: true });
// document.body.addEventListener('click', onclick, false);
// document.body.addEventListener('click', onclick, false);
})(require('./EventListenerInterceptor.js'));
},{"./EventListenerInterceptor.js":1}],4:[function(require,module,exports){
module.exports = (function() {
return function ApplyThisPrototype(event, target) {
if ((typeof target === 'object') && (target !== null)) {
var proto = Object.getPrototypeOf(target);
var property;
for (property in proto) {
if (!(property in event)) {
var descriptor = Object.getOwnPropertyDescriptor(proto, property);
if (descriptor) {
Object.defineProperty(event, property, descriptor);
}
}
}
for (property in target) {
if (!(property in event)) {
event[property] = target[property];
}
}
}
}
})();
},{}],5:[function(require,module,exports){
(function(ApplyThisPrototype) {
/**
* Polyfill CustomEvent
*/
try {
var event = new window.CustomEvent('event', { bubbles: true, cancelable: true });
} catch (error) {
var CustomEventOriginal = window.CustomEvent || window.Event;
var CustomEvent = function(eventName, params) {
params = params || {};
var event = document.createEvent('CustomEvent');
event.initCustomEvent(
eventName,
(params.bubbles === void 0) ? false : params.bubbles,
(params.cancelable === void 0) ? false : params.cancelable,
(params.detail === void 0) ? {} : params.detail
);
ApplyThisPrototype(event, this);
return event;
};
CustomEvent.prototype = CustomEventOriginal.prototype;
window.CustomEvent = CustomEvent;
}
})(require('./ApplyThisPrototype.js'));
},{"./ApplyThisPrototype.js":4}],6:[function(require,module,exports){
(function(ApplyThisPrototype) {
// ✓, ✗
/**
* Polyfill Event
*/
try {
var event = new window.Event('event', { bubbles: true, cancelable: true });
} catch(error) {
var EventOriginal = window.Event;
var Event = function(eventName, params) {
params = params || {};
var event = document.createEvent('Event');
event.initEvent(
eventName,
(params.bubbles === void 0) ? false : params.bubbles,
(params.cancelable === void 0) ? false : params.cancelable,
(params.detail === void 0) ? {} : params.detail
);
ApplyThisPrototype(event, this);
return event;
};
Event.prototype = EventOriginal.prototype;
window.Event = Event;
}
})(require('./ApplyThisPrototype.js'));
},{"./ApplyThisPrototype.js":4}],7:[function(require,module,exports){
(function(ApplyThisPrototype) {
/**
* Polyfill FocusEvent : https://developer.mozilla.org/en-US/docs/Web/API/FocusEvent/FocusEvent
* - relatedTarget ✓
*/
try {
var event = new window.FocusEvent('event', { bubbles: true, cancelable: true });
} catch (error) {
var FocusEventOriginal = window.FocusEvent || window.Event;
var FocusEvent = function(eventName, params) {
params = params || {};
var event = document.createEvent('FocusEvent');
// https://msdn.microsoft.com/en-us/library/ff975954(v=vs.85).aspx
event.initFocusEvent(
eventName,
(params.bubbles === void 0) ? false : params.bubbles,
(params.cancelable === void 0) ? false : params.cancelable,
(params.view === void 0) ? window : params.view,
(params.detail === void 0) ? {} : params.detail,
(params.relatedTarget === void 0) ? null : params.relatedTarget
);
ApplyThisPrototype(event, this);
return event;
};
FocusEvent.prototype = FocusEventOriginal.prototype;
window.FocusEvent = FocusEvent;
}
})(require('./ApplyThisPrototype.js'));
},{"./ApplyThisPrototype.js":4}],8:[function(require,module,exports){
(function(ApplyThisPrototype) {
/**
* Polyfill KeyboardEvent : https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/KeyboardEvent
* - key ✓
* - char ✓
* - code ✓
* - location ✓
* - ctrlKey ✓
* - shiftKey ✓
* - altKey ✓
* - metaKey ✓
* - repeat ✓
* - isComposing ✗
* - charCode ✓
* - keyCode ✓
* - which ✓
*/
try {
var event = new window.KeyboardEvent('event', { bubbles: true, cancelable: true });
} catch (error) {
var KeyboardEventOriginal = window.KeyboardEvent || window.Event;
var KeyboardEvent = function(eventName, params) {
params = params || {};
var event = document.createEvent('KeyboardEvent');
// https://msdn.microsoft.com/en-us/library/ff975297(v=vs.85).aspx
event.initKeyboardEvent(
eventName,
(params.bubbles === void 0) ? false : params.bubbles,
(params.cancelable === void 0) ? false : params.cancelable,
(params.view === void 0) ? window : params.view,
(params.key === void 0) ? '' : params.key,
(params.location === void 0) ? 0 : params.location,
((params.ctrlKey === true) ? 'Control ' : '') +
((params.altKey === true) ? 'Alt ' : '') +
((params.shiftKey === true) ? 'Shift ' : '') +
((params.metaKey === true) ? 'Meta ' : ''),
(params.repeat === void 0) ? false : params.repeat,
(params.locale === void 0) ? navigator.language : params.locale
);
event.keyCode = (params.keyCode === void 0) ? 0 : params.keyCode;
event.code = (params.code === void 0) ? '' : params.code;
event.charCode = (params.charCode === void 0) ? 0 : params.charCode;
event.char = (params.charCode === void 0) ? '' : params.charCode;
event.which = (params.which === void 0) ? 0 : params.which;
ApplyThisPrototype(event, this);
return event;
};
KeyboardEvent.prototype = KeyboardEventOriginal.prototype;
window.KeyboardEvent = KeyboardEvent;
}
})(require('./ApplyThisPrototype.js'));
},{"./ApplyThisPrototype.js":4}],9:[function(require,module,exports){
(function(ApplyThisPrototype) {
/**
* Polyfill MouseEvent : https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/MouseEvent
* - screenX ✓
* - screenY ✓
* - clientX ✓
* - clientY ✓
* - ctrlKey ✓
* - shiftKey ✓
* - altKey ✓
* - metaKey ✓
* - button ✓
* - buttons ✓
* - region ✓
*/
try {
var event = new window.MouseEvent('event', { bubbles: true, cancelable: true });
} catch (error) {
var MouseEventOriginal = window.MouseEvent || window.Event;
var MouseEvent = function(eventName, params) {
params = params || {};
var event = document.createEvent('MouseEvent');
// https://msdn.microsoft.com/en-us/library/ff975292(v=vs.85).aspx
event.initMouseEvent(
eventName,
(params.bubbles === void 0) ? false : params.bubbles,
(params.cancelable === void 0) ? false : params.cancelable,
(params.view === void 0) ? window : params.view,
(params.detail === void 0) ? 0 : params.detail,
(params.screenX === void 0) ? 0 : params.screenX,
(params.screenY === void 0) ? 0 : params.screenY,
(params.clientX === void 0) ? 0 : params.clientX,
(params.clientY === void 0) ? 0 : params.clientY,
(params.ctrlKey === void 0) ? false : params.ctrlKey,
(params.altKey === void 0) ? false : params.altKey,
(params.shiftKey === void 0) ? false : params.shiftKey,
(params.metaKey === void 0) ? false : params.metaKey,
(params.button === void 0) ? 0 : params.button,
(params.relatedTarget === void 0) ? null : params.relatedTarget
);
event.buttons = (params.buttons === void 0) ? 0 : params.buttons;
event.region = (params.region === void 0) ? null : params.region;
ApplyThisPrototype(event, this);
return event;
};
MouseEvent.prototype = MouseEventOriginal.prototype;
window.MouseEvent = MouseEvent;
}
})(require('./ApplyThisPrototype.js'));
},{"./ApplyThisPrototype.js":4}],10:[function(require,module,exports){
(function(ApplyThisPrototype) {
/**
* Polyfill PointerEvent
* - pointerId ✓
* - width ✓
* - height ✓
* - pressure ✓
* - tangentialPressure ✓
* - tiltX ✓
* - tiltY ✓
* - twist ✓
* - pointerType ✓
* - isPrimary ✓
*/
try {
var event = new window.PointerEvent('event', { bubbles: true, cancelable: true });
} catch (error) {
var PointerEventOriginal = window.PointerEvent || window.Event;
var PointerEvent = function(eventName, params) {
params = params || {};
var event = document.createEvent('PointerEvent');
// https://msdn.microsoft.com/en-us/library/jj192039(v=vs.85).aspx
event.initPointerEvent(
eventName,
(params.bubbles === void 0) ? false : params.bubbles,
(params.cancelable === void 0) ? false : params.cancelable,
(params.view === void 0) ? window : params.view,
(params.detail === void 0) ? 0 : params.detail,
(params.screenX === void 0) ? 0 : params.screenX,
(params.screenY === void 0) ? 0 : params.screenY,
(params.clientX === void 0) ? 0 : params.clientX,
(params.clientY === void 0) ? 0 : params.clientY,
(params.ctrlKey === void 0) ? false : params.ctrlKey,
(params.altKey === void 0) ? false : params.altKey,
(params.shiftKey === void 0) ? false : params.shiftKey,
(params.metaKey === void 0) ? false : params.metaKey,
(params.button === void 0) ? 0 : params.button,
(params.relatedTarget === void 0) ? null : params.relatedTarget,
(params.offsetX === void 0) ? 0 : params.offsetX,
(params.offsetY === void 0) ? 0 : params.offsetY,
(params.width === void 0) ? 1 : params.width,
(params.height === void 0) ? 1 : params.height,
(params.pressure === void 0) ? 0 : params.pressure,
(params.twist === void 0) ? 0 : params.twist,
(params.tiltX === void 0) ? 0 : params.tiltX,
(params.tiltY === void 0) ? 0 : params.tiltY,
(params.pointerId === void 0) ? 0 : params.pointerId,
(params.pointerType === void 0) ? '' : params.pointerType,
(params.hwTimestamp === void 0) ? 0 : params.hwTimestamp,
(params.isPrimary === void 0) ? false : params.isPrimary
);
event.tangentialPressure = (params.tangentialPressure === void 0) ? 0 : params.tangentialPressure;
ApplyThisPrototype(event, this);
return event;
};
PointerEvent.prototype = PointerEventOriginal.prototype;
var rotationDescriptor = Object.getOwnPropertyDescriptor(PointerEvent.prototype, 'rotation');
if (rotationDescriptor) {
Object.defineProperty(PointerEvent.prototype, 'twist', rotationDescriptor);
}
window.PointerEvent = PointerEvent;
}
})(require('./ApplyThisPrototype.js'));
},{"./ApplyThisPrototype.js":4}],11:[function(require,module,exports){
require('./Event.js');
require('./CustomEvent.js');
require('./MouseEvent.js');
require('./KeyboardEvent.js');
require('./FocusEvent.js');
require('./PointerEvent.js');
},{"./CustomEvent.js":5,"./Event.js":6,"./FocusEvent.js":7,"./KeyboardEvent.js":8,"./MouseEvent.js":9,"./PointerEvent.js":10}],12:[function(require,module,exports){
require('./constructors/index.js');
require('./ListenerOptions.js');
require('./ListenerEventTypes.js');
},{"./ListenerEventTypes.js":2,"./ListenerOptions.js":3,"./constructors/index.js":11}]},{},[12]);