@@ -32,7 +32,7 @@ var LibraryHTML5 = {
32
32
// so that we can report information about that element in the event message.
33
33
previousFullscreenElement: null,
34
34
35
- #if MIN_IE_VERSION != TARGET_NOT_SUPPORTED || MIN_SAFARI_VERSION <= 80000 || MIN_CHROME_VERSION <= 21 // https://caniuse.com/#search=movementX
35
+ #if MIN_SAFARI_VERSION <= 80000 || MIN_CHROME_VERSION <= 21 // https://caniuse.com/#search=movementX
36
36
// Remember the current mouse coordinates in case we need to emulate movementXY generation for browsers that don't support it.
37
37
// Some browsers (e.g. Safari 6.0.5) only give movementXY when Pointerlock is active.
38
38
previousScreenX: null,
@@ -144,11 +144,9 @@ var LibraryHTML5 = {
144
144
// Stores objects representing each currently registered JS event handler.
145
145
eventHandlers : [ ] ,
146
146
147
- #if MIN_IE_VERSION != TARGET_NOT_SUPPORTED
148
- isInternetExplorer : ( ) => navigator . userAgent . includes ( 'MSIE' ) || navigator . appVersion . indexOf ( 'Trident/' ) > 0 ,
149
- #endif
150
-
151
- // Removes all event handlers on the given DOM element of the given type. Pass in eventTypeString == undefined/null to remove all event handlers regardless of the type.
147
+ // Removes all event handlers on the given DOM element of the given type.
148
+ // Pass in eventTypeString == undefined/null to remove all event handlers
149
+ // regardless of the type.
152
150
removeAllHandlersOnTarget : ( target , eventTypeString ) => {
153
151
for ( var i = 0 ; i < JSEvents . eventHandlers . length ; ++ i ) {
154
152
if ( JSEvents . eventHandlers [ i ] . target == target &&
@@ -247,10 +245,6 @@ var LibraryHTML5 = {
247
245
// Safari 13.0.3 on macOS Catalina 10.15.1 still ships with prefixed webkitFullscreenEnabled.
248
246
// TODO: If Safari at some point ships with unprefixed version, update the version check above.
249
247
|| document . webkitFullscreenEnabled
250
- #endif
251
- #if MIN_IE_VERSION != TARGET_NOT_SUPPORTED
252
- // Last IE 11 shipped prefixed msFullscreenEnabled
253
- || document . msFullscreenEnabled
254
248
#endif
255
249
;
256
250
} ,
@@ -300,13 +294,6 @@ var LibraryHTML5 = {
300
294
301
295
var eventHandler = {
302
296
target : findEventTarget ( target ) ,
303
- #if HTML5_SUPPORT_DEFERRING_USER_SENSITIVE_REQUESTS
304
- #if MIN_IE_VERSION != TARGET_NOT_SUPPORTED
305
- allowsDeferredCalls : JSEvents . isInternetExplorer ( ) ? false : true , // MSIE doesn't allow fullscreen and pointerlock requests from key handlers, others do.
306
- #else
307
- allowsDeferredCalls : true ,
308
- #endif
309
- #endif
310
297
eventTypeString,
311
298
callbackfunc,
312
299
handlerFunc : keyEventHandlerFunc ,
@@ -469,7 +456,7 @@ var LibraryHTML5 = {
469
456
#if MIN_CHROME_VERSION <= 36 // || MIN_ANDROID_BROWSER_VERSION <= 4.4.4
470
457
|| e [ "webkitMovementX" ]
471
458
#endif
472
- #if MIN_IE_VERSION != TARGET_NOT_SUPPORTED || MIN_SAFARI_VERSION <= 80000 || MIN_CHROME_VERSION <= 21 // https://caniuse.com/#search=movementX
459
+ #if MIN_SAFARI_VERSION <= 80000 || MIN_CHROME_VERSION <= 21 // https://caniuse.com/#search=movementX
473
460
|| ( e . screenX - JSEvents . previousScreenX )
474
461
#endif
475
462
;
@@ -481,7 +468,7 @@ var LibraryHTML5 = {
481
468
#if MIN_CHROME_VERSION <= 36 // || MIN_ANDROID_BROWSER_VERSION <= 4.4.4
482
469
|| e [ "webkitMovementY" ]
483
470
#endif
484
- #if MIN_IE_VERSION != TARGET_NOT_SUPPORTED || MIN_SAFARI_VERSION <= 80000 || MIN_CHROME_VERSION <= 21 // https://caniuse.com/#search=movementX
471
+ #if MIN_SAFARI_VERSION <= 80000 || MIN_CHROME_VERSION <= 21 // https://caniuse.com/#search=movementX
485
472
|| ( e . screenY - JSEvents . previousScreenY )
486
473
#endif
487
474
;
@@ -500,7 +487,7 @@ var LibraryHTML5 = {
500
487
HEAP32 [ idx + { { { C_STRUCTS . EmscriptenMouseEvent . targetX / 4 } } } ] = e . clientX - rect . left ;
501
488
HEAP32 [ idx + { { { C_STRUCTS . EmscriptenMouseEvent . targetY / 4 } } } ] = e . clientY - rect . top ;
502
489
503
- #if MIN_IE_VERSION != TARGET_NOT_SUPPORTED || MIN_SAFARI_VERSION <= 80000 || MIN_CHROME_VERSION <= 21 // https://caniuse.com/#search=movementX
490
+ #if MIN_SAFARI_VERSION <= 80000 || MIN_CHROME_VERSION <= 21 // https://caniuse.com/#search=movementX
504
491
#if MIN_CHROME_VERSION <= 76
505
492
// wheel and mousewheel events contain wrong screenX/screenY on chrome/opera <= 76,
506
493
// so there we should not record previous screen coordinates on wheel events.
@@ -548,10 +535,6 @@ var LibraryHTML5 = {
548
535
handlerFunc : mouseEventHandlerFunc ,
549
536
useCapture
550
537
} ;
551
- #if MIN_IE_VERSION != TARGET_NOT_SUPPORTED && HTML5_SUPPORT_DEFERRING_USER_SENSITIVE_REQUESTS
552
- // In IE, mousedown events don't either allow deferred calls to be run!
553
- if ( JSEvents . isInternetExplorer ( ) && eventTypeString == 'mousedown' ) eventHandler . allowsDeferredCalls = false ;
554
- #endif
555
538
return JSEvents . registerOrRemoveHandler ( eventHandler ) ;
556
539
} ,
557
540
@@ -636,7 +619,7 @@ var LibraryHTML5 = {
636
619
#endif
637
620
if ( { { { makeDynCall ( 'iipp' , 'callbackfunc' ) } } } ( eventTypeId , wheelEvent , userData ) ) e . preventDefault ( ) ;
638
621
} ;
639
- #if MIN_IE_VERSION <= 8 || MIN_SAFARI_VERSION < 60100 // Browsers that do not support https://caniuse.com/#feat=mdn-api_wheelevent
622
+ #if MIN_SAFARI_VERSION < 60100 // Browsers that do not support https://caniuse.com/#feat=mdn-api_wheelevent
640
623
// The 'mousewheel' event as implemented in Safari 6.0.5
641
624
var mouseWheelHandlerFunc = ( e = event ) => {
642
625
fillMouseEventData ( JSEvents . wheelEvent , e , target ) ;
@@ -660,7 +643,7 @@ var LibraryHTML5 = {
660
643
#endif
661
644
eventTypeString ,
662
645
callbackfunc ,
663
- #if MIN_IE_VERSION <= 8 || MIN_SAFARI_VERSION < 60100 // Browsers that do not support https://caniuse.com/#feat=mdn-api_wheelevent
646
+ #if MIN_SAFARI_VERSION < 60100 // Browsers that do not support https://caniuse.com/#feat=mdn-api_wheelevent
664
647
handlerFunc : ( eventTypeString == 'wheel' ) ? wheelHandlerFunc : mouseWheelHandlerFunc ,
665
648
#else
666
649
handlerFunc : wheelHandlerFunc ,
@@ -677,7 +660,7 @@ var LibraryHTML5 = {
677
660
if ( ! target ) return { { { cDefs . EMSCRIPTEN_RESULT_UNKNOWN_TARGET } } } ;
678
661
if ( typeof target . onwheel != 'undefined' ) {
679
662
return registerWheelEventCallback ( target , userData , useCapture , callbackfunc , { { { cDefs . EMSCRIPTEN_EVENT_WHEEL } } } , "wheel" , targetThread ) ;
680
- #if MIN_IE_VERSION <= 8 || MIN_SAFARI_VERSION < 60100 // Browsers that do not support https://caniuse.com/#feat=mdn-api_wheelevent
663
+ #if MIN_SAFARI_VERSION < 60100 // Browsers that do not support https://caniuse.com/#feat=mdn-api_wheelevent
681
664
} else if ( typeof target . onmousewheel ! = 'undefined' ) {
682
665
return registerWheelEventCallback ( target , userData , useCapture , callbackfunc , { { { cDefs . EMSCRIPTEN_EVENT_WHEEL } } } , "mousewheel" , targetThread ) ;
683
666
#endif
@@ -1136,10 +1119,6 @@ var LibraryHTML5 = {
1136
1119
registerFullscreenChangeEventCallback ( target , userData , useCapture , callbackfunc , { { { cDefs . EMSCRIPTEN_EVENT_FULLSCREENCHANGE } } } , "webkitfullscreenchange" , targetThread ) ;
1137
1120
#endif
1138
1121
1139
- #if MIN_IE_VERSION ! = TARGET_NOT_SUPPORTED // https://caniuse.com/#feat=mdn-api_document_fullscreenchange_event
1140
- registerFullscreenChangeEventCallback ( target , userData , useCapture , callbackfunc , { { { cDefs . EMSCRIPTEN_EVENT_FULLSCREENCHANGE } } } , "MSFullscreenChange" , targetThread ) ;
1141
- #endif
1142
-
1143
1122
return registerFullscreenChangeEventCallback( target , userData, useCapture, callbackfunc, { { { cDefs . EMSCRIPTEN_EVENT_FULLSCREENCHANGE } } } , "fullscreenchange" , targetThread) ;
1144
1123
} ,
1145
1124
@@ -1160,10 +1139,6 @@ var LibraryHTML5 = {
1160
1139
1161
1140
if ( target . requestFullscreen ) {
1162
1141
target . requestFullscreen ( ) ;
1163
- #if MIN_IE_VERSION != TARGET_NOT_SUPPORTED // https://caniuse.com/#feat=fullscreen
1164
- } else if ( target . msRequestFullscreen ) {
1165
- target . msRequestFullscreen ( ) ;
1166
- #endif
1167
1142
#if MIN_FIREFOX_VERSION <= 63 // https://caniuse.com/#feat=fullscreen
1168
1143
} else if ( target . mozRequestFullScreen ) {
1169
1144
target . mozRequestFullScreen ( ) ;
@@ -1197,15 +1172,8 @@ var LibraryHTML5 = {
1197
1172
var cssWidth = strategy . softFullscreen ? innerWidth : screen . width ;
1198
1173
var cssHeight = strategy . softFullscreen ? innerHeight : screen . height ;
1199
1174
var rect = getBoundingClientRect ( target ) ;
1200
- #if MIN_IE_VERSION < 9
1201
- // .getBoundingClientRect(element).width & .height do not work on IE 8 and older, IE 9+ is required
1202
- // (https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect)
1203
- var windowedCssWidth = rect . right - rect . left ;
1204
- var windowedCssHeight = rect . bottom - rect . top ;
1205
- #else
1206
1175
var windowedCssWidth = rect . width ;
1207
1176
var windowedCssHeight = rect . height ;
1208
- #endif
1209
1177
var canvasSize = getCanvasElementSize ( target ) ;
1210
1178
var windowedRttWidth = canvasSize [ 0 ] ;
1211
1179
var windowedRttHeight = canvasSize [ 1 ] ;
@@ -1286,9 +1254,6 @@ var LibraryHTML5 = {
1286
1254
#endif
1287
1255
#if MIN_CHROME_VERSION != TARGET_NOT_SUPPORTED || MIN_SAFARI_VERSION != TARGET_NOT_SUPPORTED // https://caniuse.com/#feat=mdn-api_documentorshadowroot_fullscreenelement
1288
1256
|| document . webkitFullscreenElement
1289
- #endif
1290
- #if MIN_IE_VERSION != TARGET_NOT_SUPPORTED
1291
- || document . msFullscreenElement
1292
1257
#endif
1293
1258
;
1294
1259
if ( ! fullscreenElement ) {
@@ -1304,10 +1269,6 @@ var LibraryHTML5 = {
1304
1269
document . removeEventListener ( 'webkitfullscreenchange' , restoreOldStyle ) ;
1305
1270
#endif
1306
1271
1307
- #if MIN_IE_VERSION != TARGET_NOT_SUPPORTED // https://caniuse.com/#feat=mdn-api_document_fullscreenchange_event
1308
- document . removeEventListener ( 'MSFullscreenChange' , restoreOldStyle ) ;
1309
- #endif
1310
-
1311
1272
setCanvasElementSize ( canvas , oldWidth , oldHeight ) ;
1312
1273
1313
1274
canvas . style . width = oldCssWidth ;
@@ -1349,9 +1310,6 @@ var LibraryHTML5 = {
1349
1310
// Unprefixed Fullscreen API shipped in Chromium 71 (https://bugs.chromium.org/p/chromium/issues/detail?id=383813)
1350
1311
// As of Safari 13.0.3 on macOS Catalina 10.15.1 still ships with prefixed webkitfullscreenchange. TODO: revisit this check once Safari ships unprefixed version.
1351
1312
document . addEventListener ( 'webkitfullscreenchange' , restoreOldStyle ) ;
1352
- #endif
1353
- #if MIN_IE_VERSION != TARGET_NOT_SUPPORTED // https://caniuse.com/#feat=mdn-api_document_fullscreenchange_event
1354
- document . addEventListener ( 'MSFullscreenChange' , restoreOldStyle ) ;
1355
1313
#endif
1356
1314
return restoreOldStyle ;
1357
1315
} ,
@@ -1387,24 +1345,9 @@ var LibraryHTML5 = {
1387
1345
// Add letterboxes to a fullscreen element in a cross-browser way.
1388
1346
$setLetterbox__deps : [ '$JSEvents' ] ,
1389
1347
$setLetterbox : ( element , topBottom , leftRight ) = > {
1390
- #if MIN_IE_VERSION != TARGET_NOT_SUPPORTED
1391
- if ( JSEvents . isInternetExplorer ( ) ) {
1392
- // Cannot use padding on IE11, because IE11 computes padding in addition to the size, unlike
1393
- // other browsers, which treat padding to be part of the size.
1394
- // e.g.
1395
- // FF, Chrome: If CSS size = 1920x1080, padding-leftright = 460, padding-topbottomx40, then content size = (1920 - 2*460) x (1080-2*40) = 1000x1000px, and total element size = 1920x1080px.
1396
- // IE11: If CSS size = 1920x1080, padding-leftright = 460, padding-topbottomx40, then content size = 1920x1080px and total element size = (1920+2*460) x (1080+2*40)px.
1397
- // IE11 treats margin like Chrome and FF treat padding.
1398
- element . style . marginLeft = element . style . marginRight = leftRight + 'px' ;
1399
- element . style . marginTop = element . style . marginBottom = topBottom + 'px' ;
1400
- } else {
1401
- #endif
1402
- // Cannot use margin to specify letterboxes in FF or Chrome, since those ignore margins in fullscreen mode.
1403
- element . style . paddingLeft = element . style . paddingRight = leftRight + 'px' ;
1404
- element . style . paddingTop = element . style . paddingBottom = topBottom + 'px' ;
1405
- #if MIN_IE_VERSION != TARGET_NOT_SUPPORTED
1406
- }
1407
- #endif
1348
+ // Cannot use margin to specify letterboxes in FF or Chrome, since those ignore margins in fullscreen mode.
1349
+ element . style . paddingLeft = element . style . paddingRight = leftRight + 'px' ;
1350
+ element . style . paddingTop = element . style . paddingBottom = topBottom + 'px' ;
1408
1351
} ,
1409
1352
1410
1353
$currentFullscreenStrategy : { } ,
@@ -1480,9 +1423,6 @@ var LibraryHTML5 = {
1480
1423
if ( ! target ) return { { { cDefs . EMSCRIPTEN_RESULT_UNKNOWN_TARGET } } } ;
1481
1424
1482
1425
if ( ! target . requestFullscreen
1483
- #if MIN_IE_VERSION != TARGET_NOT_SUPPORTED // https://caniuse.com/#feat=fullscreen
1484
- && ! target . msRequestFullscreen
1485
- #endif
1486
1426
#if MIN_FIREFOX_VERSION <= 63 // https://caniuse.com/#feat=fullscreen
1487
1427
&& ! target . mozRequestFullScreen
1488
1428
&& ! target . mozRequestFullscreen
@@ -1626,10 +1566,6 @@ var LibraryHTML5 = {
1626
1566
var d = specialHTMLTargets [ { { { cDefs . EMSCRIPTEN_EVENT_TARGET_DOCUMENT } } } ] ;
1627
1567
if ( d . exitFullscreen ) {
1628
1568
d . fullscreenElement && d . exitFullscreen ( ) ;
1629
- #if MIN_IE_VERSION != TARGET_NOT_SUPPORTED // https://caniuse.com/#feat=mdn-api_document_exitfullscreen
1630
- } else if ( d . msExitFullscreen ) {
1631
- d . msFullscreenElement && d . msExitFullscreen ( ) ;
1632
- #endif
1633
1569
#if MIN_FIREFOX_VERSION < 64 // https://caniuse.com/#feat=mdn-api_document_exitfullscreen
1634
1570
} else if ( d . mozCancelFullScreen ) {
1635
1571
d . mozFullScreenElement && d . mozCancelFullScreen ( ) ;
@@ -1780,10 +1716,6 @@ var LibraryHTML5 = {
1780
1716
#if MIN_CHROME_VERSION <= 36 // https://caniuse.com/#feat=pointerlock
1781
1717
} else if ( target . webkitRequestPointerLock ) {
1782
1718
target . webkitRequestPointerLock ( ) ;
1783
- #endif
1784
- #if MIN_IE_VERSION != TARGET_NOT_SUPPORTED
1785
- } else if ( target . msRequestPointerLock ) {
1786
- target . msRequestPointerLock ( ) ;
1787
1719
#endif
1788
1720
} else {
1789
1721
// document.body is known to accept pointer lock, so use that to differentiate if the user passed a bad element,
@@ -1794,9 +1726,6 @@ var LibraryHTML5 = {
1794
1726
#endif
1795
1727
#if MIN_CHROME_VERSION <= 36 // https://caniuse.com/#feat=pointerlock
1796
1728
|| document . body . webkitRequestPointerLock
1797
- #endif
1798
- #if MIN_IE_VERSION != TARGET_NOT_SUPPORTED
1799
- || document . body . msRequestPointerLock
1800
1729
#endif
1801
1730
) {
1802
1731
return { { { cDefs . EMSCRIPTEN_RESULT_INVALID_TARGET } } } ;
@@ -1820,9 +1749,6 @@ var LibraryHTML5 = {
1820
1749
#endif
1821
1750
#if MIN_CHROME_VERSION <= 36 // https://caniuse.com/#feat=pointerlock
1822
1751
&& ! target . webkitRequestPointerLock
1823
- #endif
1824
- #if MIN_IE_VERSION != TARGET_NOT_SUPPORTED
1825
- && ! target . msRequestPointerLock
1826
1752
#endif
1827
1753
) {
1828
1754
return { { { cDefs . EMSCRIPTEN_RESULT_NOT_SUPPORTED } } } ;
@@ -1854,10 +1780,6 @@ var LibraryHTML5 = {
1854
1780
1855
1781
if ( document . exitPointerLock ) {
1856
1782
document . exitPointerLock ( ) ;
1857
- #if MIN_IE_VERSION != TARGET_NOT_SUPPORTED
1858
- } else if ( document . msExitPointerLock ) {
1859
- document . msExitPointerLock ( ) ;
1860
- #endif
1861
1783
#if MIN_FIREFOX_VERSION <= 40 // https://caniuse.com/#feat=pointerlock
1862
1784
} else if ( document . mozExitPointerLock ) {
1863
1785
document . mozExitPointerLock ( ) ;
@@ -2538,15 +2460,8 @@ var LibraryHTML5 = {
2538
2460
if ( ! target ) return { { { cDefs . EMSCRIPTEN_RESULT_UNKNOWN_TARGET } } } ;
2539
2461
2540
2462
var rect = getBoundingClientRect ( target ) ;
2541
- #if MIN_IE_VERSION < 9
2542
- // .getBoundingClientRect(element).width & .height do not work on IE 8 and older, IE 9+ is required
2543
- // (https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect)
2544
- { { { makeSetValue ( 'width' , '0' , 'rect.right - rect.left' , 'double' ) } } } ;
2545
- { { { makeSetValue ( 'height' , '0' , 'rect.bottom - rect.top' , 'double' ) } } } ;
2546
- #else
2547
2463
{ { { makeSetValue ( 'width' , '0' , 'rect.width' , 'double' ) } } } ;
2548
2464
{ { { makeSetValue ( 'height' , '0' , 'rect.height' , 'double' ) } } } ;
2549
- #endif
2550
2465
2551
2466
return { { { cDefs . EMSCRIPTEN_RESULT_SUCCESS } } } ;
2552
2467
} ,
@@ -2577,7 +2492,7 @@ var LibraryHTML5 = {
2577
2492
#if ENVIRONMENT_MAY_BE_NODE || ENVIRONMENT_MAY_BE_SHELL
2578
2493
return ( typeof devicePixelRatio == 'number' && devicePixelRatio ) || 1.0 ;
2579
2494
#else // otherwise, on the web and in workers, things are simpler
2580
- #if MIN_IE_VERSION < 11 || MIN_FIREFOX_VERSION < 18 || MIN_CHROME_VERSION < 4 || MIN_SAFARI_VERSION < 30100 // https://caniuse.com/#feat=devicepixelratio
2495
+ #if MIN_FIREFOX_VERSION < 18 || MIN_CHROME_VERSION < 4 || MIN_SAFARI_VERSION < 30100 // https://caniuse.com/#feat=devicepixelratio
2581
2496
return window . devicePixelRatio || 1.0 ;
2582
2497
#else
2583
2498
return devicePixelRatio ;
0 commit comments