Skip to content

Commit 04a03f4

Browse files
authored
Mention MEMORY64 in ChangeLog. NFC (#22883)
From #22864
1 parent 475eeda commit 04a03f4

File tree

7 files changed

+23
-19
lines changed

7 files changed

+23
-19
lines changed

ChangeLog.md

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

2121
3.1.72 (in development)
2222
-----------------------
23+
- The `MEMORY64` setting is no longer experimental. At time of writing all
24+
browsers still require a flag to run the resulting binaries but that should
25+
change in the coming months since the proposal is now at stage 4. (#22864)
2326

2427
3.1.71 - 11/04/24
2528
-----------------

src/library_glfw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ var LibraryGLFW = {
419419
// This logic comes directly from the sdl implementation. We cannot
420420
// call preventDefault on all keydown events otherwise onKeyPress will
421421
// not get called
422-
if (event.keyCode === 8 /* backspace */ || event.keyCode === 9 /* tab */) {
422+
if (event.key == 'Backspace' || event.key == 'Tab') {
423423
event.preventDefault();
424424
}
425425
},

src/library_sdl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ var LibrarySDL = {
696696
// won't fire. However, it's fine (and in some cases necessary) to
697697
// preventDefault for keys that don't generate a character. Otherwise,
698698
// preventDefault is the right thing to do in general.
699-
if (event.type !== 'keydown' || (!SDL.unicode && !SDL.textInput) || (event.keyCode === 8 /* backspace */ || event.keyCode === 9 /* tab */)) {
699+
if (event.type !== 'keydown' || (!SDL.unicode && !SDL.textInput) || (event.key == 'Backspace' || event.key == 'Tab')) {
700700
event.preventDefault();
701701
}
702702

src/proxyClient.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ if (!ENVIRONMENT_IS_NODE) {
313313
// Only prevent default on backspace/tab because we don't want unexpected navigation.
314314
// Do not prevent default on the rest as we need the keypress event.
315315
function shouldPreventDefault(event) {
316-
if (event.type === 'keydown' && event.keyCode !== 8 /* backspace */ && event.keyCode !== 9 /* tab */) {
316+
if (event.type === 'keydown' && event.key != 'Backspace' && event.key != 'Tab') {
317317
return false; // keypress, back navigation
318318
} else {
319319
return true; // NO keypress, NO back navigation

test/browser/fake_events.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,25 @@
22
* Helper function used in browser tests to simulate HTML5 events
33
*/
44

5-
function simulateKeyEvent(eventType, keyCode, code) {
5+
function simulateKeyEvent(eventType, keyCode, code, key) {
66
var props = { keyCode, charCode: keyCode, view: window, bubbles: true, cancelable: true };
77
if (code) props['code'] = code;
8+
if (key) props['key'] = key;
89
var event = new KeyboardEvent(eventType, props);
910
return document.dispatchEvent(event);
1011
}
1112

12-
function simulateKeyDown(keyCode, code = undefined) {
13-
var doDefault = simulateKeyEvent('keydown', keyCode, code);
13+
function simulateKeyDown(keyCode, code = undefined, key = undefined) {
14+
var doDefault = simulateKeyEvent('keydown', keyCode, code, key);
1415
// As long as not handler called `preventDefault` we also send a keypress
1516
// event.
1617
if (doDefault) {
17-
simulateKeyEvent('keypress', keyCode, code);
18+
simulateKeyEvent('keypress', keyCode, code, key);
1819
}
1920
}
2021

21-
function simulateKeyUp(keyCode, code = undefined) {
22-
simulateKeyEvent('keyup', keyCode, code);
22+
function simulateKeyUp(keyCode, code = undefined, key = undefined) {
23+
simulateKeyEvent('keyup', keyCode, code, key);
2324
}
2425

2526
function simulateMouseEvent(x, y, button, absolute) {

test/interactive/test_glfw_get_key_stuck.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ int main() {
9898
printf("%d. Press and hold spacebar\n", step);
9999

100100
#ifdef __EMSCRIPTEN__
101-
emscripten_set_blur_callback(NULL, NULL, true, on_focuspocus);
102-
emscripten_set_focus_callback(NULL, NULL, true, on_focuspocus);
103-
emscripten_set_focusin_callback(NULL, NULL, true, on_focuspocus);
104-
emscripten_set_focusout_callback(NULL, NULL, true, on_focuspocus);
101+
emscripten_set_blur_callback(EMSCRIPTEN_EVENT_TARGET_WINDOW, NULL, true, on_focuspocus);
102+
emscripten_set_focus_callback(EMSCRIPTEN_EVENT_TARGET_WINDOW, NULL, true, on_focuspocus);
103+
emscripten_set_focusin_callback(EMSCRIPTEN_EVENT_TARGET_WINDOW, NULL, true, on_focuspocus);
104+
emscripten_set_focusout_callback(EMSCRIPTEN_EVENT_TARGET_WINDOW, NULL, true, on_focuspocus);
105105

106106
emscripten_set_main_loop(render, 0, 1);
107107
__builtin_trap();

test/test_browser.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,15 +1013,15 @@ def post():
10131013
<script src='fake_events.js'></script>
10141014
<script>
10151015
// Send 'A'. The corresonding keypress event will not be prevented.
1016-
simulateKeyDown(65);
1017-
simulateKeyUp(65);
1016+
simulateKeyDown(65, 'a', 'KeyA');
1017+
simulateKeyUp(65, 'a', 'KeyA');
10181018
10191019
// Send backspace. The corresonding keypress event *will* be prevented due to proxyClient.js.
1020-
simulateKeyDown(8);
1021-
simulateKeyUp(8);
1020+
simulateKeyDown(8, 'Backspace', 'Backspace');
1021+
simulateKeyUp(8, 'Backspace', 'Backspace');
10221022
1023-
simulateKeyDown(100);
1024-
simulateKeyUp(100);
1023+
simulateKeyDown(100, undefined, 'Numpad4');
1024+
simulateKeyUp(100, undefined, 'Numpad4');
10251025
</script>
10261026
</body>''')
10271027

0 commit comments

Comments
 (0)