diff --git a/ChangeLog.md b/ChangeLog.md index 9c339139fe1c6..728523514b996 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -20,10 +20,9 @@ See docs/process.md for more on how version tagging works. 3.1.51 (in development) ----------------------- -- Support for explicitly targeting the legacy EdgeHTML browser (edge version - prior to the chromium-based edge) via `-sMIN_EDGE_VERSION` was removed. - Using `-sLEGACY_VM_SUPPORT` should still work if anyone still wanted to target - this or any other legacy browser. +- Support for explicitly targeting the legacy Interet Explorer or EdgeHTML + (edge version prior to the chromium-based edge) browsers via + `-sMIN_EDGE_VERSION/-sMIN_IE_VERSION` was removed. (#20881) - Breaking change: Using the `*glGetProcAddress()` family of functions now requires passing a linker flag -sGL_ENABLE_GET_PROC_ADDRESS. This prevents ports of native GL renderers from later accidentally attempting to activate diff --git a/src/embind/emval.js b/src/embind/emval.js index 2a775b1efc350..c25327f58b409 100644 --- a/src/embind/emval.js +++ b/src/embind/emval.js @@ -297,7 +297,7 @@ var LibraryEmVal = { return id; }, -#if MIN_CHROME_VERSION < 49 || MIN_FIREFOX_VERSION < 42 || MIN_IE_VERSION != TARGET_NOT_SUPPORTED || MIN_SAFARI_VERSION < 100101 +#if MIN_CHROME_VERSION < 49 || MIN_FIREFOX_VERSION < 42 || MIN_SAFARI_VERSION < 100101 $reflectConstruct: null, $reflectConstruct__postset: ` if (typeof Reflect !== 'undefined') { diff --git a/src/library.js b/src/library.js index e19648c1b5e38..cfaf9144aee49 100644 --- a/src/library.js +++ b/src/library.js @@ -402,7 +402,7 @@ addToLibrary({ // so we cannot override parts of it, and therefore cannot use libc_optz. #if (SHRINK_LEVEL < 2 || LINKABLE || process.env.EMCC_FORCE_STDLIBS) && !STANDALONE_WASM && !BULK_MEMORY -#if MIN_CHROME_VERSION < 45 || MIN_FIREFOX_VERSION < 34 || MIN_IE_VERSION != TARGET_NOT_SUPPORTED || MIN_SAFARI_VERSION < 100101 +#if MIN_CHROME_VERSION < 45 || MIN_FIREFOX_VERSION < 34 || MIN_SAFARI_VERSION < 100101 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin lists browsers that support TypedArray.prototype.copyWithin, but it // has outdated information for Safari, saying it would not support it. // https://github.com/WebKit/webkit/commit/24a800eea4d82d6d595cdfec69d0f68e733b5c52#diff-c484911d8df319ba75fce0d8e7296333R1 suggests support was added on Aug 28, 2015. @@ -2358,7 +2358,7 @@ addToLibrary({ // respective time origins. _emscripten_get_now = () => performance.timeOrigin + {{{ getPerformanceNow() }}}(); #else -#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 +#if MIN_FIREFOX_VERSION <= 14 || MIN_CHROME_VERSION <= 23 || MIN_SAFARI_VERSION <= 80400 || AUDIO_WORKLET // https://caniuse.com/#feat=high-resolution-time // AudioWorkletGlobalScope does not have performance.now() // (https://github.com/WebAudio/web-audio-api/issues/2527), so if building // with @@ -2387,7 +2387,7 @@ addToLibrary({ return 1; // nanoseconds } #endif -#if MIN_IE_VERSION <= 9 || MIN_FIREFOX_VERSION <= 14 || MIN_CHROME_VERSION <= 23 || MIN_SAFARI_VERSION <= 80400 // https://caniuse.com/#feat=high-resolution-time +#if MIN_FIREFOX_VERSION <= 14 || MIN_CHROME_VERSION <= 23 || MIN_SAFARI_VERSION <= 80400 // https://caniuse.com/#feat=high-resolution-time if (typeof performance == 'object' && performance && typeof performance['now'] == 'function') { return 1000; // microseconds (1/1000 of a millisecond) } @@ -2401,7 +2401,7 @@ addToLibrary({ // Represents whether emscripten_get_now is guaranteed monotonic; the Date.now // implementation is not :( $nowIsMonotonic__internal: true, -#if MIN_IE_VERSION <= 9 || MIN_FIREFOX_VERSION <= 14 || MIN_CHROME_VERSION <= 23 || MIN_SAFARI_VERSION <= 80400 // https://caniuse.com/#feat=high-resolution-time +#if MIN_FIREFOX_VERSION <= 14 || MIN_CHROME_VERSION <= 23 || MIN_SAFARI_VERSION <= 80400 // https://caniuse.com/#feat=high-resolution-time $nowIsMonotonic: ` ((typeof performance == 'object' && performance && typeof performance['now'] == 'function') #if ENVIRONMENT_MAY_BE_NODE @@ -3090,7 +3090,7 @@ addToLibrary({ }, $listenOnce: (object, event, func) => { -#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 +#if MIN_CHROME_VERSION < 55 || MIN_FIREFOX_VERSION < 50 // https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener object.addEventListener(event, function handler() { func(); object.removeEventListener(event, handler); diff --git a/src/library_html5.js b/src/library_html5.js index fcf0f3247cb7d..350158882b713 100644 --- a/src/library_html5.js +++ b/src/library_html5.js @@ -32,7 +32,7 @@ var LibraryHTML5 = { // so that we can report information about that element in the event message. previousFullscreenElement: null, -#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED || MIN_SAFARI_VERSION <= 80000 || MIN_CHROME_VERSION <= 21 // https://caniuse.com/#search=movementX +#if MIN_SAFARI_VERSION <= 80000 || MIN_CHROME_VERSION <= 21 // https://caniuse.com/#search=movementX // Remember the current mouse coordinates in case we need to emulate movementXY generation for browsers that don't support it. // Some browsers (e.g. Safari 6.0.5) only give movementXY when Pointerlock is active. previousScreenX: null, @@ -144,11 +144,9 @@ var LibraryHTML5 = { // Stores objects representing each currently registered JS event handler. eventHandlers: [], -#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED - isInternetExplorer: () => navigator.userAgent.includes('MSIE') || navigator.appVersion.indexOf('Trident/') > 0, -#endif - - // 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. + // 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. removeAllHandlersOnTarget: (target, eventTypeString) => { for (var i = 0; i < JSEvents.eventHandlers.length; ++i) { if (JSEvents.eventHandlers[i].target == target && @@ -247,10 +245,6 @@ var LibraryHTML5 = { // Safari 13.0.3 on macOS Catalina 10.15.1 still ships with prefixed webkitFullscreenEnabled. // TODO: If Safari at some point ships with unprefixed version, update the version check above. || document.webkitFullscreenEnabled -#endif -#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED - // Last IE 11 shipped prefixed msFullscreenEnabled - || document.msFullscreenEnabled #endif ; }, @@ -300,13 +294,6 @@ var LibraryHTML5 = { var eventHandler = { target: findEventTarget(target), -#if HTML5_SUPPORT_DEFERRING_USER_SENSITIVE_REQUESTS -#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED - allowsDeferredCalls: JSEvents.isInternetExplorer() ? false : true, // MSIE doesn't allow fullscreen and pointerlock requests from key handlers, others do. -#else - allowsDeferredCalls: true, -#endif -#endif eventTypeString, callbackfunc, handlerFunc: keyEventHandlerFunc, @@ -469,7 +456,7 @@ var LibraryHTML5 = { #if MIN_CHROME_VERSION <= 36 // || MIN_ANDROID_BROWSER_VERSION <= 4.4.4 || e["webkitMovementX"] #endif -#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED || MIN_SAFARI_VERSION <= 80000 || MIN_CHROME_VERSION <= 21 // https://caniuse.com/#search=movementX +#if MIN_SAFARI_VERSION <= 80000 || MIN_CHROME_VERSION <= 21 // https://caniuse.com/#search=movementX || (e.screenX-JSEvents.previousScreenX) #endif ; @@ -481,7 +468,7 @@ var LibraryHTML5 = { #if MIN_CHROME_VERSION <= 36 // || MIN_ANDROID_BROWSER_VERSION <= 4.4.4 || e["webkitMovementY"] #endif -#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED || MIN_SAFARI_VERSION <= 80000 || MIN_CHROME_VERSION <= 21 // https://caniuse.com/#search=movementX +#if MIN_SAFARI_VERSION <= 80000 || MIN_CHROME_VERSION <= 21 // https://caniuse.com/#search=movementX || (e.screenY-JSEvents.previousScreenY) #endif ; @@ -500,7 +487,7 @@ var LibraryHTML5 = { HEAP32[idx + {{{ C_STRUCTS.EmscriptenMouseEvent.targetX / 4 }}}] = e.clientX - rect.left; HEAP32[idx + {{{ C_STRUCTS.EmscriptenMouseEvent.targetY / 4 }}}] = e.clientY - rect.top; -#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED || MIN_SAFARI_VERSION <= 80000 || MIN_CHROME_VERSION <= 21 // https://caniuse.com/#search=movementX +#if MIN_SAFARI_VERSION <= 80000 || MIN_CHROME_VERSION <= 21 // https://caniuse.com/#search=movementX #if MIN_CHROME_VERSION <= 76 // wheel and mousewheel events contain wrong screenX/screenY on chrome/opera <= 76, // so there we should not record previous screen coordinates on wheel events. @@ -548,10 +535,6 @@ var LibraryHTML5 = { handlerFunc: mouseEventHandlerFunc, useCapture }; -#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED && HTML5_SUPPORT_DEFERRING_USER_SENSITIVE_REQUESTS - // In IE, mousedown events don't either allow deferred calls to be run! - if (JSEvents.isInternetExplorer() && eventTypeString == 'mousedown') eventHandler.allowsDeferredCalls = false; -#endif return JSEvents.registerOrRemoveHandler(eventHandler); }, @@ -636,7 +619,7 @@ var LibraryHTML5 = { #endif if ({{{ makeDynCall('iipp', 'callbackfunc') }}}(eventTypeId, wheelEvent, userData)) e.preventDefault(); }; -#if MIN_IE_VERSION <= 8 || MIN_SAFARI_VERSION < 60100 // Browsers that do not support https://caniuse.com/#feat=mdn-api_wheelevent +#if MIN_SAFARI_VERSION < 60100 // Browsers that do not support https://caniuse.com/#feat=mdn-api_wheelevent // The 'mousewheel' event as implemented in Safari 6.0.5 var mouseWheelHandlerFunc = (e = event) => { fillMouseEventData(JSEvents.wheelEvent, e, target); @@ -660,7 +643,7 @@ var LibraryHTML5 = { #endif eventTypeString, callbackfunc, -#if MIN_IE_VERSION <= 8 || MIN_SAFARI_VERSION < 60100 // Browsers that do not support https://caniuse.com/#feat=mdn-api_wheelevent +#if MIN_SAFARI_VERSION < 60100 // Browsers that do not support https://caniuse.com/#feat=mdn-api_wheelevent handlerFunc: (eventTypeString == 'wheel') ? wheelHandlerFunc : mouseWheelHandlerFunc, #else handlerFunc: wheelHandlerFunc, @@ -677,7 +660,7 @@ var LibraryHTML5 = { if (!target) return {{{ cDefs.EMSCRIPTEN_RESULT_UNKNOWN_TARGET }}}; if (typeof target.onwheel != 'undefined') { return registerWheelEventCallback(target, userData, useCapture, callbackfunc, {{{ cDefs.EMSCRIPTEN_EVENT_WHEEL }}}, "wheel", targetThread); -#if MIN_IE_VERSION <= 8 || MIN_SAFARI_VERSION < 60100 // Browsers that do not support https://caniuse.com/#feat=mdn-api_wheelevent +#if MIN_SAFARI_VERSION < 60100 // Browsers that do not support https://caniuse.com/#feat=mdn-api_wheelevent } else if (typeof target.onmousewheel != 'undefined') { return registerWheelEventCallback(target, userData, useCapture, callbackfunc, {{{ cDefs.EMSCRIPTEN_EVENT_WHEEL }}}, "mousewheel", targetThread); #endif @@ -1136,10 +1119,6 @@ var LibraryHTML5 = { registerFullscreenChangeEventCallback(target, userData, useCapture, callbackfunc, {{{ cDefs.EMSCRIPTEN_EVENT_FULLSCREENCHANGE }}}, "webkitfullscreenchange", targetThread); #endif -#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED // https://caniuse.com/#feat=mdn-api_document_fullscreenchange_event - registerFullscreenChangeEventCallback(target, userData, useCapture, callbackfunc, {{{ cDefs.EMSCRIPTEN_EVENT_FULLSCREENCHANGE }}}, "MSFullscreenChange", targetThread); -#endif - return registerFullscreenChangeEventCallback(target, userData, useCapture, callbackfunc, {{{ cDefs.EMSCRIPTEN_EVENT_FULLSCREENCHANGE }}}, "fullscreenchange", targetThread); }, @@ -1160,10 +1139,6 @@ var LibraryHTML5 = { if (target.requestFullscreen) { target.requestFullscreen(); -#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED // https://caniuse.com/#feat=fullscreen - } else if (target.msRequestFullscreen) { - target.msRequestFullscreen(); -#endif #if MIN_FIREFOX_VERSION <= 63 // https://caniuse.com/#feat=fullscreen } else if (target.mozRequestFullScreen) { target.mozRequestFullScreen(); @@ -1197,15 +1172,8 @@ var LibraryHTML5 = { var cssWidth = strategy.softFullscreen ? innerWidth : screen.width; var cssHeight = strategy.softFullscreen ? innerHeight : screen.height; var rect = getBoundingClientRect(target); -#if MIN_IE_VERSION < 9 - // .getBoundingClientRect(element).width & .height do not work on IE 8 and older, IE 9+ is required - // (https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect) - var windowedCssWidth = rect.right - rect.left; - var windowedCssHeight = rect.bottom - rect.top; -#else var windowedCssWidth = rect.width; var windowedCssHeight = rect.height; -#endif var canvasSize = getCanvasElementSize(target); var windowedRttWidth = canvasSize[0]; var windowedRttHeight = canvasSize[1]; @@ -1286,9 +1254,6 @@ var LibraryHTML5 = { #endif #if MIN_CHROME_VERSION != TARGET_NOT_SUPPORTED || MIN_SAFARI_VERSION != TARGET_NOT_SUPPORTED // https://caniuse.com/#feat=mdn-api_documentorshadowroot_fullscreenelement || document.webkitFullscreenElement -#endif -#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED - || document.msFullscreenElement #endif ; if (!fullscreenElement) { @@ -1304,10 +1269,6 @@ var LibraryHTML5 = { document.removeEventListener('webkitfullscreenchange', restoreOldStyle); #endif -#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED // https://caniuse.com/#feat=mdn-api_document_fullscreenchange_event - document.removeEventListener('MSFullscreenChange', restoreOldStyle); -#endif - setCanvasElementSize(canvas, oldWidth, oldHeight); canvas.style.width = oldCssWidth; @@ -1349,9 +1310,6 @@ var LibraryHTML5 = { // Unprefixed Fullscreen API shipped in Chromium 71 (https://bugs.chromium.org/p/chromium/issues/detail?id=383813) // 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. document.addEventListener('webkitfullscreenchange', restoreOldStyle); -#endif -#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED // https://caniuse.com/#feat=mdn-api_document_fullscreenchange_event - document.addEventListener('MSFullscreenChange', restoreOldStyle); #endif return restoreOldStyle; }, @@ -1387,24 +1345,9 @@ var LibraryHTML5 = { // Add letterboxes to a fullscreen element in a cross-browser way. $setLetterbox__deps: ['$JSEvents'], $setLetterbox: (element, topBottom, leftRight) => { -#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED - if (JSEvents.isInternetExplorer()) { - // Cannot use padding on IE11, because IE11 computes padding in addition to the size, unlike - // other browsers, which treat padding to be part of the size. - // e.g. - // 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. - // 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. - // IE11 treats margin like Chrome and FF treat padding. - element.style.marginLeft = element.style.marginRight = leftRight + 'px'; - element.style.marginTop = element.style.marginBottom = topBottom + 'px'; - } else { -#endif - // Cannot use margin to specify letterboxes in FF or Chrome, since those ignore margins in fullscreen mode. - element.style.paddingLeft = element.style.paddingRight = leftRight + 'px'; - element.style.paddingTop = element.style.paddingBottom = topBottom + 'px'; -#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED - } -#endif + // Cannot use margin to specify letterboxes in FF or Chrome, since those ignore margins in fullscreen mode. + element.style.paddingLeft = element.style.paddingRight = leftRight + 'px'; + element.style.paddingTop = element.style.paddingBottom = topBottom + 'px'; }, $currentFullscreenStrategy: {}, @@ -1480,9 +1423,6 @@ var LibraryHTML5 = { if (!target) return {{{ cDefs.EMSCRIPTEN_RESULT_UNKNOWN_TARGET }}}; if (!target.requestFullscreen -#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED // https://caniuse.com/#feat=fullscreen - && !target.msRequestFullscreen -#endif #if MIN_FIREFOX_VERSION <= 63 // https://caniuse.com/#feat=fullscreen && !target.mozRequestFullScreen && !target.mozRequestFullscreen @@ -1626,10 +1566,6 @@ var LibraryHTML5 = { var d = specialHTMLTargets[{{{ cDefs.EMSCRIPTEN_EVENT_TARGET_DOCUMENT }}}]; if (d.exitFullscreen) { d.fullscreenElement && d.exitFullscreen(); -#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED // https://caniuse.com/#feat=mdn-api_document_exitfullscreen - } else if (d.msExitFullscreen) { - d.msFullscreenElement && d.msExitFullscreen(); -#endif #if MIN_FIREFOX_VERSION < 64 // https://caniuse.com/#feat=mdn-api_document_exitfullscreen } else if (d.mozCancelFullScreen) { d.mozFullScreenElement && d.mozCancelFullScreen(); @@ -1780,10 +1716,6 @@ var LibraryHTML5 = { #if MIN_CHROME_VERSION <= 36 // https://caniuse.com/#feat=pointerlock } else if (target.webkitRequestPointerLock) { target.webkitRequestPointerLock(); -#endif -#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED - } else if (target.msRequestPointerLock) { - target.msRequestPointerLock(); #endif } else { // 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 = { #endif #if MIN_CHROME_VERSION <= 36 // https://caniuse.com/#feat=pointerlock || document.body.webkitRequestPointerLock -#endif -#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED - || document.body.msRequestPointerLock #endif ) { return {{{ cDefs.EMSCRIPTEN_RESULT_INVALID_TARGET }}}; @@ -1820,9 +1749,6 @@ var LibraryHTML5 = { #endif #if MIN_CHROME_VERSION <= 36 // https://caniuse.com/#feat=pointerlock && !target.webkitRequestPointerLock -#endif -#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED - && !target.msRequestPointerLock #endif ) { return {{{ cDefs.EMSCRIPTEN_RESULT_NOT_SUPPORTED }}}; @@ -1854,10 +1780,6 @@ var LibraryHTML5 = { if (document.exitPointerLock) { document.exitPointerLock(); -#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED - } else if (document.msExitPointerLock) { - document.msExitPointerLock(); -#endif #if MIN_FIREFOX_VERSION <= 40 // https://caniuse.com/#feat=pointerlock } else if (document.mozExitPointerLock) { document.mozExitPointerLock(); @@ -2525,15 +2447,8 @@ var LibraryHTML5 = { if (!target) return {{{ cDefs.EMSCRIPTEN_RESULT_UNKNOWN_TARGET }}}; var rect = getBoundingClientRect(target); -#if MIN_IE_VERSION < 9 - // .getBoundingClientRect(element).width & .height do not work on IE 8 and older, IE 9+ is required - // (https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect) - {{{ makeSetValue('width', '0', 'rect.right - rect.left', 'double') }}}; - {{{ makeSetValue('height', '0', 'rect.bottom - rect.top', 'double') }}}; -#else {{{ makeSetValue('width', '0', 'rect.width', 'double') }}}; {{{ makeSetValue('height', '0', 'rect.height', 'double') }}}; -#endif return {{{ cDefs.EMSCRIPTEN_RESULT_SUCCESS }}}; }, @@ -2564,7 +2479,7 @@ var LibraryHTML5 = { #if ENVIRONMENT_MAY_BE_NODE || ENVIRONMENT_MAY_BE_SHELL return (typeof devicePixelRatio == 'number' && devicePixelRatio) || 1.0; #else // otherwise, on the web and in workers, things are simpler -#if MIN_IE_VERSION < 11 || MIN_FIREFOX_VERSION < 18 || MIN_CHROME_VERSION < 4 || MIN_SAFARI_VERSION < 30100 // https://caniuse.com/#feat=devicepixelratio +#if MIN_FIREFOX_VERSION < 18 || MIN_CHROME_VERSION < 4 || MIN_SAFARI_VERSION < 30100 // https://caniuse.com/#feat=devicepixelratio return window.devicePixelRatio || 1.0; #else return devicePixelRatio; diff --git a/src/library_webgl.js b/src/library_webgl.js index aae02b8f92edb..45713722acaa3 100644 --- a/src/library_webgl.js +++ b/src/library_webgl.js @@ -682,7 +682,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}}; #endif (canvas.getContext("webgl", webGLContextAttributes) // https://caniuse.com/#feat=webgl -#if MIN_IE_VERSION <= 10 || MIN_FIREFOX_VERSION <= 23 || MIN_CHROME_VERSION <= 32 || MIN_SAFARI_VERSION <= 70101 +#if MIN_FIREFOX_VERSION <= 23 || MIN_CHROME_VERSION <= 32 || MIN_SAFARI_VERSION <= 70101 || canvas.getContext("experimental-webgl", webGLContextAttributes) #endif ); diff --git a/src/runtime_math.js b/src/runtime_math.js index 3e1ddfa3cf317..999255167fae6 100644 --- a/src/runtime_math.js +++ b/src/runtime_math.js @@ -5,7 +5,7 @@ */ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul -#if POLYFILL_OLD_MATH_FUNCTIONS || MIN_CHROME_VERSION < 28 || MIN_FIREFOX_VERSION < 20 || MIN_IE_VERSION != TARGET_NOT_SUPPORTED || MIN_SAFARI_VERSION < 90000 // || MIN_NODE_VERSION < 0.12 +#if POLYFILL_OLD_MATH_FUNCTIONS || MIN_CHROME_VERSION < 28 || MIN_FIREFOX_VERSION < 20 || MIN_SAFARI_VERSION < 90000 // || MIN_NODE_VERSION < 0.12 // || MIN_NODE_VERSION < 0.12 // check for imul support, and also for correctness ( https://bugs.webkit.org/show_bug.cgi?id=126345 ) if (!Math.imul || Math.imul(0xffffffff, 5) !== -5) Math.imul = (a, b) => { @@ -18,7 +18,7 @@ if (!Math.imul || Math.imul(0xffffffff, 5) !== -5) Math.imul = (a, b) => { #endif // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/fround -#if POLYFILL_OLD_MATH_FUNCTIONS || MIN_CHROME_VERSION < 38 || MIN_FIREFOX_VERSION < 26 || MIN_IE_VERSION != TARGET_NOT_SUPPORTED || MIN_SAFARI_VERSION < 80000 // || MIN_NODE_VERSION < 0.12 +#if POLYFILL_OLD_MATH_FUNCTIONS || MIN_CHROME_VERSION < 38 || MIN_FIREFOX_VERSION < 26 || MIN_SAFARI_VERSION < 80000 // || MIN_NODE_VERSION < 0.12 if (!Math.fround) { var froundBuffer = new Float32Array(1); Math.fround = (x) => { froundBuffer[0] = x; return froundBuffer[0] }; @@ -26,7 +26,7 @@ if (!Math.fround) { #endif // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32 -#if POLYFILL_OLD_MATH_FUNCTIONS || MIN_CHROME_VERSION < 38 || MIN_FIREFOX_VERSION < 31 || MIN_IE_VERSION != TARGET_NOT_SUPPORTED // || MIN_NODE_VERSION < 0.12 +#if POLYFILL_OLD_MATH_FUNCTIONS || MIN_CHROME_VERSION < 38 || MIN_FIREFOX_VERSION < 31 // || MIN_NODE_VERSION < 0.12 Math.clz32 ||= (x) => { var n = 32; var y = x >> 16; if (y) { n -= 16; x = y; } @@ -39,7 +39,7 @@ Math.clz32 ||= (x) => { #endif // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc -#if POLYFILL_OLD_MATH_FUNCTIONS || MIN_CHROME_VERSION < 38 || MIN_FIREFOX_VERSION < 25 || MIN_IE_VERSION != TARGET_NOT_SUPPORTED || MIN_SAFARI_VERSION < 80000 // || MIN_NODE_VERSION < 0.12 +#if POLYFILL_OLD_MATH_FUNCTIONS || MIN_CHROME_VERSION < 38 || MIN_FIREFOX_VERSION < 25 || MIN_SAFARI_VERSION < 80000 // || MIN_NODE_VERSION < 0.12 Math.trunc ||= (x) => { return x < 0 ? Math.ceil(x) : Math.floor(x); }; diff --git a/src/settings.js b/src/settings.js index 53763b537c1e7..2ff4e643e7a84 100644 --- a/src/settings.js +++ b/src/settings.js @@ -1798,13 +1798,6 @@ var MIN_FIREFOX_VERSION = 79; // [link] var MIN_SAFARI_VERSION = 140100; -// Specifies the oldest version of Internet Explorer to target. E.g. pass -s -// MIN_IE_VERSION = 11 to drop support for IE 10 and older. -// Internet Explorer is at end of life and does not support WebAssembly. -// MAX_INT (0x7FFFFFFF, or -1) specifies that target is not supported. -// [link] -var MIN_IE_VERSION = 0x7FFFFFFF; - // Specifies the oldest version of Chrome. E.g. pass -sMIN_CHROME_VERSION=58 to // drop support for Chrome 57 and older. // Chrome 85 was released on 2020-08-25. @@ -2165,4 +2158,5 @@ var LEGACY_SETTINGS = [ ['REVERSE_DEPS', ['auto', 'all', 'none'], 'No longer needed'], ['RUNTIME_LOGGING', 'RUNTIME_DEBUG'], ['MIN_EDGE_VERSION', [0x7FFFFFFF], 'No longer supported'], + ['MIN_IE_VERSION', [0x7FFFFFFF], 'No longer supported'], ]; diff --git a/src/shell.js b/src/shell.js index e639d6fca7f17..5e6550c2aaec5 100644 --- a/src/shell.js +++ b/src/shell.js @@ -44,7 +44,7 @@ var Module = typeof {{{ EXPORT_NAME }}} != 'undefined' ? {{{ EXPORT_NAME }}} : { #endif // USE_CLOSURE_COMPILER #if POLYFILL -#if ((MAYBE_WASM2JS && WASM != 2) || MODULARIZE) && (MIN_CHROME_VERSION < 33 || MIN_FIREFOX_VERSION < 29 || MIN_IE_VERSION != TARGET_NOT_SUPPORTED || MIN_SAFARI_VERSION < 80000) +#if ((MAYBE_WASM2JS && WASM != 2) || MODULARIZE) && (MIN_CHROME_VERSION < 33 || MIN_FIREFOX_VERSION < 29 || MIN_SAFARI_VERSION < 80000) // Include a Promise polyfill for legacy browsers. This is needed either for // wasm2js, where we polyfill the wasm API which needs Promises, or when using // modularize which creates a Promise for when the module is ready. @@ -52,7 +52,7 @@ var Module = typeof {{{ EXPORT_NAME }}} != 'undefined' ? {{{ EXPORT_NAME }}} : { #include "polyfill/promise.js" #endif -#if MIN_CHROME_VERSION < 45 || MIN_FIREFOX_VERSION < 34 || MIN_IE_VERSION != TARGET_NOT_SUPPORTED || MIN_SAFARI_VERSION < 90000 +#if MIN_CHROME_VERSION < 45 || MIN_FIREFOX_VERSION < 34 || MIN_SAFARI_VERSION < 90000 // See https://caniuse.com/mdn-javascript_builtins_object_assign #include "polyfill/objassign.js" #endif diff --git a/src/shell_minimal.js b/src/shell_minimal.js index 115c13198e16d..5dcfd039a1f9b 100644 --- a/src/shell_minimal.js +++ b/src/shell_minimal.js @@ -149,7 +149,7 @@ function ready() { #if POLYFILL // See https://caniuse.com/mdn-javascript_builtins_object_assign -#if MIN_CHROME_VERSION < 45 || MIN_FIREFOX_VERSION < 34 || MIN_IE_VERSION != TARGET_NOT_SUPPORTED || MIN_SAFARI_VERSION < 90000 +#if MIN_CHROME_VERSION < 45 || MIN_FIREFOX_VERSION < 34 || MIN_SAFARI_VERSION < 90000 #include "polyfill/objassign.js" #endif #endif diff --git a/test/minimal_webgl/CMakeLists.txt b/test/minimal_webgl/CMakeLists.txt index 6822ee02301fb..97108f70d2239 100644 --- a/test/minimal_webgl/CMakeLists.txt +++ b/test/minimal_webgl/CMakeLists.txt @@ -43,7 +43,6 @@ if (EMSCRIPTEN) # emulation code may be present for old browser quirks. append_linker_flags("-sMIN_FIREFOX_VERSION=70") append_linker_flags("-sMIN_SAFARI_VERSION=130000") - append_linker_flags("-sMIN_IE_VERSION=0x7FFFFFFF") # Do not support Internet Explorer at all (this is the Emscripten default, shown here for posterity) append_linker_flags("-sMIN_CHROME_VERSION=80") # Fine tuning for code size: do not generate code to abort program execution on malloc() failures, that will diff --git a/test/test_browser.py b/test/test_browser.py index 423185975be77..227ee74bf953a 100644 --- a/test/test_browser.py +++ b/test/test_browser.py @@ -2712,7 +2712,7 @@ def test_doublestart_bug(self): 'closure': (['-O2', '-g1', '--closure=1', '-sHTML5_SUPPORT_DEFERRING_USER_SENSITIVE_REQUESTS=0'],), 'pthread': (['-pthread'],), 'proxy_to_pthread': (['-pthread', '-sPROXY_TO_PTHREAD'],), - 'legacy': (['-sMIN_FIREFOX_VERSION=0', '-sMIN_SAFARI_VERSION=0', '-sMIN_IE_VERSION=0', '-sMIN_CHROME_VERSION=0', '-Wno-transpile'],) + 'legacy': (['-sMIN_FIREFOX_VERSION=0', '-sMIN_SAFARI_VERSION=0', '-sMIN_CHROME_VERSION=0', '-Wno-transpile'],) }) @requires_threads def test_html5_core(self, opts): diff --git a/test/test_other.py b/test/test_other.py index 1d0ca3db6f223..4c2ad90bbd8cc 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -11662,9 +11662,10 @@ def test_output_to_nowhere(self): # I.e. -sMIN_X_VERSION=-1 is equal to -sMIN_X_VERSION=Infinity def test_drop_support_for_browser(self): # Test that -1 means "not supported" - self.run_process([EMCC, test_file('test_html5_core.c'), '-sMIN_IE_VERSION=-1']) - self.assertContained('allowsDeferredCalls: true', read_file('a.out.js')) - self.assertNotContained('allowsDeferredCalls: JSEvents.isInternetExplorer()', read_file('a.out.js')) + self.run_process([EMCC, test_file('test_html5_core.c')]) + self.assertContained('document.webkitFullscreenEnabled', read_file('a.out.js')) + self.run_process([EMCC, test_file('test_html5_core.c'), '-sMIN_SAFARI_VERSION=-1']) + self.assertNotContained('document.webkitFullscreenEnabled', read_file('a.out.js')) def test_errno_type(self): create_file('errno_type.c', ''' diff --git a/tools/feature_matrix.py b/tools/feature_matrix.py index 0eb10e48a0670..64bc14c638cfe 100644 --- a/tools/feature_matrix.py +++ b/tools/feature_matrix.py @@ -90,10 +90,6 @@ def report_missing(setting_name): if settings.MIN_SAFARI_VERSION < min_versions['safari']: report_missing('MIN_SAFARI_VERSION') return False - # IE don't support any non-MVP features - if settings.MIN_IE_VERSION != 0x7FFFFFFF: - report_missing('MIN_IE_VERSION') - return False if 'node' in min_versions and settings.MIN_NODE_VERSION < min_versions['node']: report_missing('MIN_NODE_VERSION') return False diff --git a/tools/link.py b/tools/link.py index 932b7d95f3302..9e200f322ed0a 100644 --- a/tools/link.py +++ b/tools/link.py @@ -1098,7 +1098,6 @@ def phase_linker_setup(options, state, newargs): # Support all old browser versions settings.MIN_FIREFOX_VERSION = 0 settings.MIN_SAFARI_VERSION = 0 - settings.MIN_IE_VERSION = 0 settings.MIN_CHROME_VERSION = 0 settings.MIN_NODE_VERSION = 0 @@ -1140,8 +1139,7 @@ def phase_linker_setup(options, state, newargs): settings.TRANSPILE_TO_ES5 = (settings.MIN_FIREFOX_VERSION < 79 or settings.MIN_CHROME_VERSION < 85 or settings.MIN_SAFARI_VERSION < 140000 or - settings.MIN_NODE_VERSION < 160000 or - settings.MIN_IE_VERSION != 0x7FFFFFFF) + settings.MIN_NODE_VERSION < 160000) if options.use_closure_compiler is None and settings.TRANSPILE_TO_ES5: diagnostics.warning('transpile', 'enabling transpilation via closure due to browser version settings. This warning can be suppressed by passing `--closure=1` or `--closure=0` to opt into this explicitly.') @@ -1149,8 +1147,7 @@ def phase_linker_setup(options, state, newargs): # https://caniuse.com/class: FF:45 CHROME:49 SAFARI:9 supports_es6_classes = (settings.MIN_FIREFOX_VERSION >= 45 and settings.MIN_CHROME_VERSION >= 49 and - settings.MIN_SAFARI_VERSION >= 90000 and - settings.MIN_IE_VERSION == 0x7FFFFFFF) + settings.MIN_SAFARI_VERSION >= 90000) if not settings.DISABLE_EXCEPTION_CATCHING and settings.EXCEPTION_STACK_TRACES and not supports_es6_classes: diagnostics.warning('transpile', '-sEXCEPTION_STACK_TRACES requires an engine that support ES6 classes.')