Skip to content

Commit c54ebd7

Browse files
authored
Drop support for targeting IE using -sMIN_IE_VESRION (#20887)
Followup to #20881 which removed support for EdgeHTML
1 parent 9295b0a commit c54ebd7

File tree

14 files changed

+39
-138
lines changed

14 files changed

+39
-138
lines changed

ChangeLog.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ See docs/process.md for more on how version tagging works.
2020

2121
3.1.51 (in development)
2222
-----------------------
23-
- Support for explicitly targeting the legacy EdgeHTML browser (edge version
24-
prior to the chromium-based edge) via `-sMIN_EDGE_VERSION` was removed.
25-
Using `-sLEGACY_VM_SUPPORT` should still work if anyone still wanted to target
26-
this or any other legacy browser.
23+
- Support for explicitly targeting the legacy Interet Explorer or EdgeHTML
24+
(edge version prior to the chromium-based edge) browsers via
25+
`-sMIN_EDGE_VERSION/-sMIN_IE_VERSION` was removed. (#20881)
2726
- Breaking change: Using the `*glGetProcAddress()` family of functions now
2827
requires passing a linker flag -sGL_ENABLE_GET_PROC_ADDRESS. This prevents
2928
ports of native GL renderers from later accidentally attempting to activate

src/embind/emval.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ var LibraryEmVal = {
297297
return id;
298298
},
299299

300-
#if MIN_CHROME_VERSION < 49 || MIN_FIREFOX_VERSION < 42 || MIN_IE_VERSION != TARGET_NOT_SUPPORTED || MIN_SAFARI_VERSION < 100101
300+
#if MIN_CHROME_VERSION < 49 || MIN_FIREFOX_VERSION < 42 || MIN_SAFARI_VERSION < 100101
301301
$reflectConstruct: null,
302302
$reflectConstruct__postset: `
303303
if (typeof Reflect !== 'undefined') {

src/library.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ addToLibrary({
402402
// so we cannot override parts of it, and therefore cannot use libc_optz.
403403
#if (SHRINK_LEVEL < 2 || LINKABLE || process.env.EMCC_FORCE_STDLIBS) && !STANDALONE_WASM && !BULK_MEMORY
404404

405-
#if MIN_CHROME_VERSION < 45 || MIN_FIREFOX_VERSION < 34 || MIN_IE_VERSION != TARGET_NOT_SUPPORTED || MIN_SAFARI_VERSION < 100101
405+
#if MIN_CHROME_VERSION < 45 || MIN_FIREFOX_VERSION < 34 || MIN_SAFARI_VERSION < 100101
406406
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin lists browsers that support TypedArray.prototype.copyWithin, but it
407407
// has outdated information for Safari, saying it would not support it.
408408
// https://github.com/WebKit/webkit/commit/24a800eea4d82d6d595cdfec69d0f68e733b5c52#diff-c484911d8df319ba75fce0d8e7296333R1 suggests support was added on Aug 28, 2015.
@@ -2358,7 +2358,7 @@ addToLibrary({
23582358
// respective time origins.
23592359
_emscripten_get_now = () => performance.timeOrigin + {{{ getPerformanceNow() }}}();
23602360
#else
2361-
#if MIN_IE_VERSION <= 9 || MIN_FIREFOX_VERSION <= 14 || MIN_CHROME_VERSION <= 23 || MIN_SAFARI_VERSION <= 80400 || AUDIO_WORKLET // https://caniuse.com/#feat=high-resolution-time
2361+
#if MIN_FIREFOX_VERSION <= 14 || MIN_CHROME_VERSION <= 23 || MIN_SAFARI_VERSION <= 80400 || AUDIO_WORKLET // https://caniuse.com/#feat=high-resolution-time
23622362
// AudioWorkletGlobalScope does not have performance.now()
23632363
// (https://github.com/WebAudio/web-audio-api/issues/2527), so if building
23642364
// with
@@ -2387,7 +2387,7 @@ addToLibrary({
23872387
return 1; // nanoseconds
23882388
}
23892389
#endif
2390-
#if MIN_IE_VERSION <= 9 || MIN_FIREFOX_VERSION <= 14 || MIN_CHROME_VERSION <= 23 || MIN_SAFARI_VERSION <= 80400 // https://caniuse.com/#feat=high-resolution-time
2390+
#if MIN_FIREFOX_VERSION <= 14 || MIN_CHROME_VERSION <= 23 || MIN_SAFARI_VERSION <= 80400 // https://caniuse.com/#feat=high-resolution-time
23912391
if (typeof performance == 'object' && performance && typeof performance['now'] == 'function') {
23922392
return 1000; // microseconds (1/1000 of a millisecond)
23932393
}
@@ -2401,7 +2401,7 @@ addToLibrary({
24012401
// Represents whether emscripten_get_now is guaranteed monotonic; the Date.now
24022402
// implementation is not :(
24032403
$nowIsMonotonic__internal: true,
2404-
#if MIN_IE_VERSION <= 9 || MIN_FIREFOX_VERSION <= 14 || MIN_CHROME_VERSION <= 23 || MIN_SAFARI_VERSION <= 80400 // https://caniuse.com/#feat=high-resolution-time
2404+
#if MIN_FIREFOX_VERSION <= 14 || MIN_CHROME_VERSION <= 23 || MIN_SAFARI_VERSION <= 80400 // https://caniuse.com/#feat=high-resolution-time
24052405
$nowIsMonotonic: `
24062406
((typeof performance == 'object' && performance && typeof performance['now'] == 'function')
24072407
#if ENVIRONMENT_MAY_BE_NODE
@@ -3090,7 +3090,7 @@ addToLibrary({
30903090
},
30913091

30923092
$listenOnce: (object, event, func) => {
3093-
#if MIN_CHROME_VERSION < 55 || MIN_FIREFOX_VERSION < 50 || MIN_IE_VERSION != TARGET_NOT_SUPPORTED // https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener
3093+
#if MIN_CHROME_VERSION < 55 || MIN_FIREFOX_VERSION < 50 // https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener
30943094
object.addEventListener(event, function handler() {
30953095
func();
30963096
object.removeEventListener(event, handler);

src/library_html5.js

Lines changed: 14 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -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();
@@ -2538,15 +2460,8 @@ var LibraryHTML5 = {
25382460
if (!target) return {{{ cDefs.EMSCRIPTEN_RESULT_UNKNOWN_TARGET }}};
25392461

25402462
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
25472463
{{{ makeSetValue('width', '0', 'rect.width', 'double') }}};
25482464
{{{ makeSetValue('height', '0', 'rect.height', 'double') }}};
2549-
#endif
25502465

25512466
return {{{ cDefs.EMSCRIPTEN_RESULT_SUCCESS }}};
25522467
},
@@ -2577,7 +2492,7 @@ var LibraryHTML5 = {
25772492
#if ENVIRONMENT_MAY_BE_NODE || ENVIRONMENT_MAY_BE_SHELL
25782493
return (typeof devicePixelRatio == 'number' && devicePixelRatio) || 1.0;
25792494
#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
25812496
return window.devicePixelRatio || 1.0;
25822497
#else
25832498
return devicePixelRatio;

0 commit comments

Comments
 (0)