Remove workarounds for old DOM APIs prior ot event.movementX/Y - #27341
Merged
Conversation
sbc100
force-pushed
the
inline-movementx
branch
2 times, most recently
from
July 14, 2026 05:25
42c04d2 to
6c72998
Compare
dschuff
approved these changes
Jul 14, 2026
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Inline
event.movementXandevent.movementYdirectly intocalculateMouseEventinlibbrowser.js, removing thegetMovementXandgetMovementYhelper methods fromLibraryBrowser.Remove references to
mozMovementX,webkitMovementX,mozMovementY, andwebkitMovementYfromlibbrowser.jsandlibsdl.js. Also updatelibhtml5.jsandlibsdl.jsto 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:
MouseEvent.movementXandMouseEvent.movementYbecame standard unprefixed properties in Firefox 41 (2015) and Chrome 37 (2014).MIN_FIREFOX_VERSIONandMIN_CHROME_VERSION) are well beyond when unprefixedmovementXbecame universal across all engines.mozMovementX,webkitMovementX) have been removed from modern browser engines.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