Skip to content

Remove workarounds for old DOM APIs prior ot event.movementX/Y - #27341

Merged
sbc100 merged 1 commit into
emscripten-core:mainfrom
sbc100:inline-movementx
Jul 14, 2026
Merged

Remove workarounds for old DOM APIs prior ot event.movementX/Y#27341
sbc100 merged 1 commit into
emscripten-core:mainfrom
sbc100:inline-movementx

Conversation

@sbc100

@sbc100 sbc100 commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Inline event.movementX and event.movementY directly into calculateMouseEvent in libbrowser.js, removing the getMovementX and getMovementY helper methods from LibraryBrowser.

Remove references to mozMovementX, webkitMovementX, mozMovementY, and webkitMovementY from libbrowser.js and libsdl.js. Also update libhtml5.js and libsdl.js to use standard dot notation (e.movementX, event.movementX) instead of bracket notation across all mouse event handling.

These prefixed properties and their workarounds (if ('mozMovementX' in event)) were added between 2012 and 2013 for early implementations of the W3C Pointer Lock API to address Firefox bugs #750111 and #764498.

This is safe to remove because:

  1. MouseEvent.movementX and MouseEvent.movementY became standard unprefixed properties in Firefox 41 (2015) and Chrome 37 (2014).
  2. Emscripten's minimum supported browser versions (MIN_FIREFOX_VERSION and MIN_CHROME_VERSION) are well beyond when unprefixed movementX became universal across all engines.
  3. The vendor-prefixed properties (mozMovementX, webkitMovementX) have been removed from modern browser engines.
  4. Bugzilla bugs #750111 (mozMovementX is transient and becomes zero later) and #764498 (movementX and movementY have the wrong value for mousedown and mouseup) were both resolved in 2012 (Firefox 15).

See: https://bugzilla.mozilla.org/show_bug.cgi?id=750111
See: https://bugzilla.mozilla.org/show_bug.cgi?id=764498
See: https://bugzilla.mozilla.org/show_bug.cgi?id=782777

@sbc100 sbc100 changed the title [browser, html5, sdl] Inline event.movementX/Y and remove workarounds Remove workarounds for old DOM APIs prior ot event.movementX/Y Jul 14, 2026
@sbc100
sbc100 requested review from juj and kripken July 14, 2026 02:27
@sbc100
sbc100 force-pushed the inline-movementx branch 2 times, most recently from 42c04d2 to 6c72998 Compare July 14, 2026 05:25
@sbc100
sbc100 requested a review from dschuff July 14, 2026 06:04
@sbc100
sbc100 force-pushed the inline-movementx branch from 6c72998 to f33eec3 Compare July 14, 2026 16:33
Inline `event.movementX` and `event.movementY` directly into
`calculateMouseEvent` in `libbrowser.js`, removing the `getMovementX`
and `getMovementY` helper methods from `LibraryBrowser`.

Remove references to `mozMovementX`, `webkitMovementX`, `mozMovementY`,
and `webkitMovementY` from `libbrowser.js` and `libsdl.js`. Also update
`libhtml5.js` and `libsdl.js` to use standard dot notation
(`e.movementX`, `event.movementX`) instead of bracket notation across
all mouse event handling.

These prefixed properties and their workarounds (`if ('mozMovementX' in
event)`) were added between 2012 and 2013 for early implementations of
the W3C Pointer Lock API to address Firefox bugs #750111 and #764498.

This is safe to remove because:
1. `MouseEvent.movementX` and `MouseEvent.movementY` became standard
unprefixed properties in Firefox 41 (2015) and Chrome 37 (2014).
2. Emscripten's minimum supported browser versions
(`MIN_FIREFOX_VERSION` and `MIN_CHROME_VERSION`) are well beyond when
unprefixed `movementX` became universal across all engines.
3. The vendor-prefixed properties (`mozMovementX`, `webkitMovementX`)
have been removed from modern browser engines.
4. Bugzilla bugs #750111 (`mozMovementX is transient and becomes zero
later`) and #764498 (`movementX and movementY have the wrong value for
mousedown and mouseup`) were both resolved in 2012 (Firefox 15).

See: https://bugzilla.mozilla.org/show_bug.cgi?id=750111
See: https://bugzilla.mozilla.org/show_bug.cgi?id=764498
@sbc100
sbc100 force-pushed the inline-movementx branch from f33eec3 to f1be3d5 Compare July 14, 2026 16:34
@sbc100
sbc100 merged commit f01f695 into emscripten-core:main Jul 14, 2026
17 of 21 checks passed
@sbc100
sbc100 deleted the inline-movementx branch July 14, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants