Skip to content

Commit 7ca8b40

Browse files
authored
Drop support for EdgeHTML browser using -sMIN_EDGE_VESRION (#20881)
This browser was replaced with the chromium-based Edge back in 2018: https://blog.mozilla.org/en/mozilla/goodbye-edge/ According to https://www.statista.com/statistics/545520/market-share-of-internet-browsers-usa/ Edge Legacy accouts for just 0.05% of the browser market.
1 parent dabbde6 commit 7ca8b40

15 files changed

+37
-56
lines changed

ChangeLog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ 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.
2327
- Breaking change: Using the `*glGetProcAddress()` family of functions now
2428
requires passing a linker flag -sGL_ENABLE_GET_PROC_ADDRESS. This prevents
2529
ports of native GL renderers from later accidentally attempting to activate

src/embind/embind.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ var LibraryEmbind = {
175175
}),
176176
// All browsers that support WebAssembly also support configurable function name,
177177
// but we might be building for very old browsers via WASM2JS.
178-
#if MIN_CHROME_VERSION < 43 || MIN_EDGE_VERSION < 14 || MIN_SAFARI_VERSION < 100101 || MIN_FIREFOX_VERSION < 38
178+
#if MIN_CHROME_VERSION < 43 || MIN_SAFARI_VERSION < 100101 || MIN_FIREFOX_VERSION < 38
179179
// In that case, check if configurable function name is supported at init time
180180
// and, if not, replace with a fallback that returns function as-is as those browsers
181181
// don't support other methods either.

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_EDGE_VERSION < 12 || 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_IE_VERSION != TARGET_NOT_SUPPORTED || MIN_SAFARI_VERSION < 100101
301301
$reflectConstruct: null,
302302
$reflectConstruct__postset: `
303303
if (typeof Reflect !== 'undefined') {

src/library.js

Lines changed: 2 additions & 2 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_EDGE_VERSION < 14 || 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_IE_VERSION != TARGET_NOT_SUPPORTED || 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.
@@ -3090,7 +3090,7 @@ addToLibrary({
30903090
},
30913091

30923092
$listenOnce: (object, event, func) => {
3093-
#if MIN_CHROME_VERSION < 55 || MIN_EDGE_VERSION < 18 || 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 || MIN_IE_VERSION != TARGET_NOT_SUPPORTED // 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_atomic.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
assert(SHARED_MEMORY);
88

99
addToLibrary({
10-
// Chrome 87 (and hence Edge 87) shipped Atomics.waitAsync:
10+
// Chrome 87 shipped Atomics.waitAsync:
1111
// https://www.chromestatus.com/feature/6243382101803008
1212
// However its implementation is faulty:
1313
// https://bugs.chromium.org/p/chromium/issues/detail?id=1167541
1414
// Firefox Nightly 86.0a1 (2021-01-15) does not yet have it:
1515
// https://bugzilla.mozilla.org/show_bug.cgi?id=1467846
1616
// And at the time of writing, no other browser has it either.
17-
#if MIN_EDGE_VERSION < 91 || MIN_CHROME_VERSION < 91 || MIN_SAFARI_VERSION != TARGET_NOT_SUPPORTED || MIN_FIREFOX_VERSION != TARGET_NOT_SUPPORTED || ENVIRONMENT_MAY_BE_NODE
17+
#if MIN_CHROME_VERSION < 91 || MIN_SAFARI_VERSION != TARGET_NOT_SUPPORTED || MIN_FIREFOX_VERSION != TARGET_NOT_SUPPORTED || ENVIRONMENT_MAY_BE_NODE
1818
// Partially polyfill Atomics.waitAsync() if not available in the browser.
1919
// Also polyfill for old Chrome-based browsers, where Atomics.waitAsync is
2020
// broken until Chrome 91, see:

src/library_html5.js

Lines changed: 10 additions & 10 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_EDGE_VERSION <= 12 || MIN_CHROME_VERSION <= 21 // https://caniuse.com/#search=movementX
35+
#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED || 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,
@@ -469,7 +469,7 @@ var LibraryHTML5 = {
469469
#if MIN_CHROME_VERSION <= 36 // || MIN_ANDROID_BROWSER_VERSION <= 4.4.4
470470
|| e["webkitMovementX"]
471471
#endif
472-
#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED || MIN_SAFARI_VERSION <= 80000 || MIN_EDGE_VERSION <= 12 || MIN_CHROME_VERSION <= 21 // https://caniuse.com/#search=movementX
472+
#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED || MIN_SAFARI_VERSION <= 80000 || MIN_CHROME_VERSION <= 21 // https://caniuse.com/#search=movementX
473473
|| (e.screenX-JSEvents.previousScreenX)
474474
#endif
475475
;
@@ -481,7 +481,7 @@ var LibraryHTML5 = {
481481
#if MIN_CHROME_VERSION <= 36 // || MIN_ANDROID_BROWSER_VERSION <= 4.4.4
482482
|| e["webkitMovementY"]
483483
#endif
484-
#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED || MIN_SAFARI_VERSION <= 80000 || MIN_EDGE_VERSION <= 12 || MIN_CHROME_VERSION <= 21 // https://caniuse.com/#search=movementX
484+
#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED || MIN_SAFARI_VERSION <= 80000 || MIN_CHROME_VERSION <= 21 // https://caniuse.com/#search=movementX
485485
|| (e.screenY-JSEvents.previousScreenY)
486486
#endif
487487
;
@@ -500,7 +500,7 @@ var LibraryHTML5 = {
500500
HEAP32[idx + {{{ C_STRUCTS.EmscriptenMouseEvent.targetX / 4 }}}] = e.clientX - rect.left;
501501
HEAP32[idx + {{{ C_STRUCTS.EmscriptenMouseEvent.targetY / 4 }}}] = e.clientY - rect.top;
502502

503-
#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED || MIN_SAFARI_VERSION <= 80000 || MIN_EDGE_VERSION <= 12 || MIN_CHROME_VERSION <= 21 // https://caniuse.com/#search=movementX
503+
#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED || MIN_SAFARI_VERSION <= 80000 || MIN_CHROME_VERSION <= 21 // https://caniuse.com/#search=movementX
504504
#if MIN_CHROME_VERSION <= 76
505505
// wheel and mousewheel events contain wrong screenX/screenY on chrome/opera <= 76,
506506
// so there we should not record previous screen coordinates on wheel events.
@@ -1284,10 +1284,10 @@ var LibraryHTML5 = {
12841284
#if MIN_FIREFOX_VERSION <= 63 // https://caniuse.com/#feat=mdn-api_documentorshadowroot_fullscreenelement
12851285
|| document.mozFullScreenElement
12861286
#endif
1287-
#if MIN_EDGE_VERSION != TARGET_NOT_SUPPORTED || MIN_CHROME_VERSION != TARGET_NOT_SUPPORTED || MIN_SAFARI_VERSION != TARGET_NOT_SUPPORTED // https://caniuse.com/#feat=mdn-api_documentorshadowroot_fullscreenelement
1287+
#if MIN_CHROME_VERSION != TARGET_NOT_SUPPORTED || MIN_SAFARI_VERSION != TARGET_NOT_SUPPORTED // https://caniuse.com/#feat=mdn-api_documentorshadowroot_fullscreenelement
12881288
|| document.webkitFullscreenElement
12891289
#endif
1290-
#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED || MIN_EDGE_VERSION < 76
1290+
#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED
12911291
|| document.msFullscreenElement
12921292
#endif
12931293
;
@@ -1781,7 +1781,7 @@ var LibraryHTML5 = {
17811781
} else if (target.webkitRequestPointerLock) {
17821782
target.webkitRequestPointerLock();
17831783
#endif
1784-
#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED || MIN_EDGE_VERSION < 76
1784+
#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED
17851785
} else if (target.msRequestPointerLock) {
17861786
target.msRequestPointerLock();
17871787
#endif
@@ -1795,7 +1795,7 @@ var LibraryHTML5 = {
17951795
#if MIN_CHROME_VERSION <= 36 // https://caniuse.com/#feat=pointerlock
17961796
|| document.body.webkitRequestPointerLock
17971797
#endif
1798-
#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED || MIN_EDGE_VERSION < 76
1798+
#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED
17991799
|| document.body.msRequestPointerLock
18001800
#endif
18011801
) {
@@ -1821,7 +1821,7 @@ var LibraryHTML5 = {
18211821
#if MIN_CHROME_VERSION <= 36 // https://caniuse.com/#feat=pointerlock
18221822
&& !target.webkitRequestPointerLock
18231823
#endif
1824-
#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED || MIN_EDGE_VERSION < 76
1824+
#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED
18251825
&& !target.msRequestPointerLock
18261826
#endif
18271827
) {
@@ -1854,7 +1854,7 @@ var LibraryHTML5 = {
18541854

18551855
if (document.exitPointerLock) {
18561856
document.exitPointerLock();
1857-
#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED || MIN_EDGE_VERSION < 76
1857+
#if MIN_IE_VERSION != TARGET_NOT_SUPPORTED
18581858
} else if (document.msExitPointerLock) {
18591859
document.msExitPointerLock();
18601860
#endif

src/library_webgl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
682682
#endif
683683
(canvas.getContext("webgl", webGLContextAttributes)
684684
// https://caniuse.com/#feat=webgl
685-
#if MIN_IE_VERSION <= 10 || MIN_EDGE_VERSION <= 18 || MIN_FIREFOX_VERSION <= 23 || MIN_CHROME_VERSION <= 32 || MIN_SAFARI_VERSION <= 70101
685+
#if MIN_IE_VERSION <= 10 || MIN_FIREFOX_VERSION <= 23 || MIN_CHROME_VERSION <= 32 || MIN_SAFARI_VERSION <= 70101
686686
|| canvas.getContext("experimental-webgl", webGLContextAttributes)
687687
#endif
688688
);

src/runtime_math.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul
8-
#if POLYFILL_OLD_MATH_FUNCTIONS || MIN_CHROME_VERSION < 28 || MIN_EDGE_VERSION < 12 || MIN_FIREFOX_VERSION < 20 || MIN_IE_VERSION != TARGET_NOT_SUPPORTED || MIN_SAFARI_VERSION < 90000 // || MIN_NODE_VERSION < 0.12
8+
#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
99
// || MIN_NODE_VERSION < 0.12
1010
// check for imul support, and also for correctness ( https://bugs.webkit.org/show_bug.cgi?id=126345 )
1111
if (!Math.imul || Math.imul(0xffffffff, 5) !== -5) Math.imul = (a, b) => {
@@ -18,15 +18,15 @@ if (!Math.imul || Math.imul(0xffffffff, 5) !== -5) Math.imul = (a, b) => {
1818
#endif
1919

2020
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/fround
21-
#if POLYFILL_OLD_MATH_FUNCTIONS || MIN_CHROME_VERSION < 38 || MIN_EDGE_VERSION < 12 || MIN_FIREFOX_VERSION < 26 || MIN_IE_VERSION != TARGET_NOT_SUPPORTED || MIN_SAFARI_VERSION < 80000 // || MIN_NODE_VERSION < 0.12
21+
#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
2222
if (!Math.fround) {
2323
var froundBuffer = new Float32Array(1);
2424
Math.fround = (x) => { froundBuffer[0] = x; return froundBuffer[0] };
2525
}
2626
#endif
2727

2828
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32
29-
#if POLYFILL_OLD_MATH_FUNCTIONS || MIN_CHROME_VERSION < 38 || MIN_EDGE_VERSION < 12 || MIN_FIREFOX_VERSION < 31 || MIN_IE_VERSION != TARGET_NOT_SUPPORTED // || MIN_NODE_VERSION < 0.12
29+
#if POLYFILL_OLD_MATH_FUNCTIONS || MIN_CHROME_VERSION < 38 || MIN_FIREFOX_VERSION < 31 || MIN_IE_VERSION != TARGET_NOT_SUPPORTED // || MIN_NODE_VERSION < 0.12
3030
Math.clz32 ||= (x) => {
3131
var n = 32;
3232
var y = x >> 16; if (y) { n -= 16; x = y; }
@@ -39,7 +39,7 @@ Math.clz32 ||= (x) => {
3939
#endif
4040

4141
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc
42-
#if POLYFILL_OLD_MATH_FUNCTIONS || MIN_CHROME_VERSION < 38 || MIN_EDGE_VERSION < 12 || MIN_FIREFOX_VERSION < 25 || MIN_IE_VERSION != TARGET_NOT_SUPPORTED || MIN_SAFARI_VERSION < 80000 // || MIN_NODE_VERSION < 0.12
42+
#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
4343
Math.trunc ||= (x) => {
4444
return x < 0 ? Math.ceil(x) : Math.floor(x);
4545
};

src/settings.js

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1805,21 +1805,6 @@ var MIN_SAFARI_VERSION = 140100;
18051805
// [link]
18061806
var MIN_IE_VERSION = 0x7FFFFFFF;
18071807

1808-
// Specifies the oldest version of Edge (EdgeHTML, the non-Chromium based
1809-
// flavor) to target. E.g. pass -sMIN_EDGE_VERSION=40 to drop support for
1810-
// EdgeHTML 39 and older.
1811-
// EdgeHTML 44.17763 was released on November 13, 2018
1812-
// EdgeHTML was completely in April 2021 and replaced by the current
1813-
// Chromium-based Edge.
1814-
// Since version 79, Edge version numbers have mirrored chromium version
1815-
// numbers, so it no longer makes sense specify MIN_EDGE_VERSION independenly.
1816-
// If Chromium and Edge ever start to diverage this setting may be revived with
1817-
// more modern post-chromium default value.
1818-
// See https://en.wikipedia.org/wiki/Microsoft_Edge#New_Edge_release_history
1819-
// MAX_INT (0x7FFFFFFF, or -1) specifies that target is not supported.
1820-
// [link]
1821-
var MIN_EDGE_VERSION = 0x7FFFFFFF;
1822-
18231808
// Specifies the oldest version of Chrome. E.g. pass -sMIN_CHROME_VERSION=58 to
18241809
// drop support for Chrome 57 and older.
18251810
// Chrome 85 was released on 2020-08-25.
@@ -2179,4 +2164,5 @@ var LEGACY_SETTINGS = [
21792164
['USES_DYNAMIC_ALLOC', [1], 'No longer supported. Use -sMALLOC=none'],
21802165
['REVERSE_DEPS', ['auto', 'all', 'none'], 'No longer needed'],
21812166
['RUNTIME_LOGGING', 'RUNTIME_DEBUG'],
2167+
['MIN_EDGE_VERSION', [0x7FFFFFFF], 'No longer supported'],
21822168
];

src/shell.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ var Module = typeof {{{ EXPORT_NAME }}} != 'undefined' ? {{{ EXPORT_NAME }}} : {
4444
#endif // USE_CLOSURE_COMPILER
4545

4646
#if POLYFILL
47-
#if ((MAYBE_WASM2JS && WASM != 2) || MODULARIZE) && (MIN_CHROME_VERSION < 33 || MIN_EDGE_VERSION < 12 || MIN_FIREFOX_VERSION < 29 || MIN_IE_VERSION != TARGET_NOT_SUPPORTED || MIN_SAFARI_VERSION < 80000)
47+
#if ((MAYBE_WASM2JS && WASM != 2) || MODULARIZE) && (MIN_CHROME_VERSION < 33 || MIN_FIREFOX_VERSION < 29 || MIN_IE_VERSION != TARGET_NOT_SUPPORTED || MIN_SAFARI_VERSION < 80000)
4848
// Include a Promise polyfill for legacy browsers. This is needed either for
4949
// wasm2js, where we polyfill the wasm API which needs Promises, or when using
5050
// modularize which creates a Promise for when the module is ready.
5151
// See https://caniuse.com/#feat=promises
5252
#include "polyfill/promise.js"
5353
#endif
5454

55-
#if MIN_CHROME_VERSION < 45 || MIN_EDGE_VERSION < 12 || MIN_FIREFOX_VERSION < 34 || MIN_IE_VERSION != TARGET_NOT_SUPPORTED || MIN_SAFARI_VERSION < 90000
55+
#if MIN_CHROME_VERSION < 45 || MIN_FIREFOX_VERSION < 34 || MIN_IE_VERSION != TARGET_NOT_SUPPORTED || MIN_SAFARI_VERSION < 90000
5656
// See https://caniuse.com/mdn-javascript_builtins_object_assign
5757
#include "polyfill/objassign.js"
5858
#endif

0 commit comments

Comments
 (0)