@@ -32,7 +32,7 @@ var LibraryHTML5 = {
3232 // so that we can report information about that element in the event message.
3333 previousFullscreenElement: null,
3434
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
3636 // Remember the current mouse coordinates in case we need to emulate movementXY generation for browsers that don't support it.
3737 // Some browsers (e.g. Safari 6.0.5) only give movementXY when Pointerlock is active.
3838 previousScreenX: null,
@@ -144,11 +144,9 @@ var LibraryHTML5 = {
144144 // Stores objects representing each currently registered JS event handler.
145145 eventHandlers : [ ] ,
146146
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.
152150 removeAllHandlersOnTarget : ( target , eventTypeString ) => {
153151 for ( var i = 0 ; i < JSEvents . eventHandlers . length ; ++ i ) {
154152 if ( JSEvents . eventHandlers [ i ] . target == target &&
@@ -247,10 +245,6 @@ var LibraryHTML5 = {
247245 // Safari 13.0.3 on macOS Catalina 10.15.1 still ships with prefixed webkitFullscreenEnabled.
248246 // TODO: If Safari at some point ships with unprefixed version, update the version check above.
249247 || document . webkitFullscreenEnabled
250- #endif
251- #if MIN_IE_VERSION != TARGET_NOT_SUPPORTED
252- // Last IE 11 shipped prefixed msFullscreenEnabled
253- || document . msFullscreenEnabled
254248#endif
255249 ;
256250 } ,
@@ -300,13 +294,6 @@ var LibraryHTML5 = {
300294
301295 var eventHandler = {
302296 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
310297 eventTypeString,
311298 callbackfunc,
312299 handlerFunc : keyEventHandlerFunc ,
@@ -469,7 +456,7 @@ var LibraryHTML5 = {
469456#if MIN_CHROME_VERSION <= 36 // || MIN_ANDROID_BROWSER_VERSION <= 4.4.4
470457 || e [ "webkitMovementX" ]
471458#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
473460 || ( e . screenX - JSEvents . previousScreenX )
474461#endif
475462 ;
@@ -481,7 +468,7 @@ var LibraryHTML5 = {
481468#if MIN_CHROME_VERSION <= 36 // || MIN_ANDROID_BROWSER_VERSION <= 4.4.4
482469 || e [ "webkitMovementY" ]
483470#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
485472 || ( e . screenY - JSEvents . previousScreenY )
486473#endif
487474 ;
@@ -500,7 +487,7 @@ var LibraryHTML5 = {
500487 HEAP32 [ idx + { { { C_STRUCTS . EmscriptenMouseEvent . targetX / 4 } } } ] = e . clientX - rect . left ;
501488 HEAP32 [ idx + { { { C_STRUCTS . EmscriptenMouseEvent . targetY / 4 } } } ] = e . clientY - rect . top ;
502489
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
504491#if MIN_CHROME_VERSION <= 76
505492 // wheel and mousewheel events contain wrong screenX/screenY on chrome/opera <= 76,
506493 // so there we should not record previous screen coordinates on wheel events.
@@ -548,10 +535,6 @@ var LibraryHTML5 = {
548535 handlerFunc : mouseEventHandlerFunc ,
549536 useCapture
550537 } ;
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
555538 return JSEvents . registerOrRemoveHandler ( eventHandler ) ;
556539 } ,
557540
@@ -636,7 +619,7 @@ var LibraryHTML5 = {
636619#endif
637620 if ( { { { makeDynCall ( 'iipp' , 'callbackfunc' ) } } } ( eventTypeId , wheelEvent , userData ) ) e . preventDefault ( ) ;
638621 } ;
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
640623 // The 'mousewheel' event as implemented in Safari 6.0.5
641624 var mouseWheelHandlerFunc = ( e = event ) => {
642625 fillMouseEventData ( JSEvents . wheelEvent , e , target ) ;
@@ -660,7 +643,7 @@ var LibraryHTML5 = {
660643#endif
661644 eventTypeString ,
662645 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
664647 handlerFunc : ( eventTypeString == 'wheel' ) ? wheelHandlerFunc : mouseWheelHandlerFunc ,
665648#else
666649 handlerFunc : wheelHandlerFunc ,
@@ -677,7 +660,7 @@ var LibraryHTML5 = {
677660 if ( ! target ) return { { { cDefs . EMSCRIPTEN_RESULT_UNKNOWN_TARGET } } } ;
678661 if ( typeof target . onwheel != 'undefined' ) {
679662 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
681664 } else if ( typeof target . onmousewheel ! = 'undefined' ) {
682665 return registerWheelEventCallback ( target , userData , useCapture , callbackfunc , { { { cDefs . EMSCRIPTEN_EVENT_WHEEL } } } , "mousewheel" , targetThread ) ;
683666#endif
@@ -1136,10 +1119,6 @@ var LibraryHTML5 = {
11361119 registerFullscreenChangeEventCallback ( target , userData , useCapture , callbackfunc , { { { cDefs . EMSCRIPTEN_EVENT_FULLSCREENCHANGE } } } , "webkitfullscreenchange" , targetThread ) ;
11371120#endif
11381121
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-
11431122 return registerFullscreenChangeEventCallback( target , userData, useCapture, callbackfunc, { { { cDefs . EMSCRIPTEN_EVENT_FULLSCREENCHANGE } } } , "fullscreenchange" , targetThread) ;
11441123 } ,
11451124
@@ -1160,10 +1139,6 @@ var LibraryHTML5 = {
11601139
11611140 if ( target . requestFullscreen ) {
11621141 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
11671142#if MIN_FIREFOX_VERSION <= 63 // https://caniuse.com/#feat=fullscreen
11681143 } else if ( target . mozRequestFullScreen ) {
11691144 target . mozRequestFullScreen ( ) ;
@@ -1197,15 +1172,8 @@ var LibraryHTML5 = {
11971172 var cssWidth = strategy . softFullscreen ? innerWidth : screen . width ;
11981173 var cssHeight = strategy . softFullscreen ? innerHeight : screen . height ;
11991174 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
12061175 var windowedCssWidth = rect . width ;
12071176 var windowedCssHeight = rect . height ;
1208- #endif
12091177 var canvasSize = getCanvasElementSize ( target ) ;
12101178 var windowedRttWidth = canvasSize [ 0 ] ;
12111179 var windowedRttHeight = canvasSize [ 1 ] ;
@@ -1286,9 +1254,6 @@ var LibraryHTML5 = {
12861254#endif
12871255#if MIN_CHROME_VERSION != TARGET_NOT_SUPPORTED || MIN_SAFARI_VERSION != TARGET_NOT_SUPPORTED // https://caniuse.com/#feat=mdn-api_documentorshadowroot_fullscreenelement
12881256 || document . webkitFullscreenElement
1289- #endif
1290- #if MIN_IE_VERSION != TARGET_NOT_SUPPORTED
1291- || document . msFullscreenElement
12921257#endif
12931258 ;
12941259 if ( ! fullscreenElement ) {
@@ -1304,10 +1269,6 @@ var LibraryHTML5 = {
13041269 document . removeEventListener ( 'webkitfullscreenchange' , restoreOldStyle ) ;
13051270#endif
13061271
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-
13111272 setCanvasElementSize ( canvas , oldWidth , oldHeight ) ;
13121273
13131274 canvas . style . width = oldCssWidth ;
@@ -1349,9 +1310,6 @@ var LibraryHTML5 = {
13491310 // Unprefixed Fullscreen API shipped in Chromium 71 (https://bugs.chromium.org/p/chromium/issues/detail?id=383813)
13501311 // 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.
13511312 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 ) ;
13551313#endif
13561314 return restoreOldStyle ;
13571315 } ,
@@ -1387,24 +1345,9 @@ var LibraryHTML5 = {
13871345 // Add letterboxes to a fullscreen element in a cross-browser way.
13881346 $setLetterbox__deps : [ '$JSEvents' ] ,
13891347 $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' ;
14081351 } ,
14091352
14101353 $currentFullscreenStrategy : { } ,
@@ -1480,9 +1423,6 @@ var LibraryHTML5 = {
14801423 if ( ! target ) return { { { cDefs . EMSCRIPTEN_RESULT_UNKNOWN_TARGET } } } ;
14811424
14821425 if ( ! target . requestFullscreen
1483- #if MIN_IE_VERSION != TARGET_NOT_SUPPORTED // https://caniuse.com/#feat=fullscreen
1484- && ! target . msRequestFullscreen
1485- #endif
14861426#if MIN_FIREFOX_VERSION <= 63 // https://caniuse.com/#feat=fullscreen
14871427 && ! target . mozRequestFullScreen
14881428 && ! target . mozRequestFullscreen
@@ -1626,10 +1566,6 @@ var LibraryHTML5 = {
16261566 var d = specialHTMLTargets [ { { { cDefs . EMSCRIPTEN_EVENT_TARGET_DOCUMENT } } } ] ;
16271567 if ( d . exitFullscreen ) {
16281568 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
16331569#if MIN_FIREFOX_VERSION < 64 // https://caniuse.com/#feat=mdn-api_document_exitfullscreen
16341570 } else if ( d . mozCancelFullScreen ) {
16351571 d . mozFullScreenElement && d . mozCancelFullScreen ( ) ;
@@ -1780,10 +1716,6 @@ var LibraryHTML5 = {
17801716#if MIN_CHROME_VERSION <= 36 // https://caniuse.com/#feat=pointerlock
17811717 } else if ( target . webkitRequestPointerLock ) {
17821718 target . webkitRequestPointerLock ( ) ;
1783- #endif
1784- #if MIN_IE_VERSION != TARGET_NOT_SUPPORTED
1785- } else if ( target . msRequestPointerLock ) {
1786- target . msRequestPointerLock ( ) ;
17871719#endif
17881720 } else {
17891721 // 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 = {
17941726#endif
17951727#if MIN_CHROME_VERSION <= 36 // https://caniuse.com/#feat=pointerlock
17961728 || document . body . webkitRequestPointerLock
1797- #endif
1798- #if MIN_IE_VERSION != TARGET_NOT_SUPPORTED
1799- || document . body . msRequestPointerLock
18001729#endif
18011730 ) {
18021731 return { { { cDefs . EMSCRIPTEN_RESULT_INVALID_TARGET } } } ;
@@ -1820,9 +1749,6 @@ var LibraryHTML5 = {
18201749#endif
18211750#if MIN_CHROME_VERSION <= 36 // https://caniuse.com/#feat=pointerlock
18221751 && ! target . webkitRequestPointerLock
1823- #endif
1824- #if MIN_IE_VERSION != TARGET_NOT_SUPPORTED
1825- && ! target . msRequestPointerLock
18261752#endif
18271753 ) {
18281754 return { { { cDefs . EMSCRIPTEN_RESULT_NOT_SUPPORTED } } } ;
@@ -1854,10 +1780,6 @@ var LibraryHTML5 = {
18541780
18551781 if ( document . exitPointerLock ) {
18561782 document . exitPointerLock ( ) ;
1857- #if MIN_IE_VERSION != TARGET_NOT_SUPPORTED
1858- } else if ( document . msExitPointerLock ) {
1859- document . msExitPointerLock ( ) ;
1860- #endif
18611783#if MIN_FIREFOX_VERSION <= 40 // https://caniuse.com/#feat=pointerlock
18621784 } else if ( document . mozExitPointerLock ) {
18631785 document . mozExitPointerLock ( ) ;
@@ -2525,15 +2447,8 @@ var LibraryHTML5 = {
25252447 if ( ! target ) return { { { cDefs . EMSCRIPTEN_RESULT_UNKNOWN_TARGET } } } ;
25262448
25272449 var rect = getBoundingClientRect ( target ) ;
2528- #if MIN_IE_VERSION < 9
2529- // .getBoundingClientRect(element).width & .height do not work on IE 8 and older, IE 9+ is required
2530- // (https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect)
2531- { { { makeSetValue ( 'width' , '0' , 'rect.right - rect.left' , 'double' ) } } } ;
2532- { { { makeSetValue ( 'height' , '0' , 'rect.bottom - rect.top' , 'double' ) } } } ;
2533- #else
25342450 { { { makeSetValue ( 'width' , '0' , 'rect.width' , 'double' ) } } } ;
25352451 { { { makeSetValue ( 'height' , '0' , 'rect.height' , 'double' ) } } } ;
2536- #endif
25372452
25382453 return { { { cDefs . EMSCRIPTEN_RESULT_SUCCESS } } } ;
25392454 } ,
@@ -2564,7 +2479,7 @@ var LibraryHTML5 = {
25642479#if ENVIRONMENT_MAY_BE_NODE || ENVIRONMENT_MAY_BE_SHELL
25652480 return ( typeof devicePixelRatio == 'number' && devicePixelRatio ) || 1.0 ;
25662481#else // otherwise, on the web and in workers, things are simpler
2567- #if MIN_IE_VERSION < 11 || MIN_FIREFOX_VERSION < 18 || MIN_CHROME_VERSION < 4 || MIN_SAFARI_VERSION < 30100 // https://caniuse.com/#feat=devicepixelratio
2482+ #if MIN_FIREFOX_VERSION < 18 || MIN_CHROME_VERSION < 4 || MIN_SAFARI_VERSION < 30100 // https://caniuse.com/#feat=devicepixelratio
25682483 return window . devicePixelRatio || 1.0 ;
25692484#else
25702485 return devicePixelRatio ;
0 commit comments