Remove legacy vendor-prefixed DOM APIs and fallbacks#27347
Merged
Conversation
186b3c4 to
85231ff
Compare
24af87d to
d883ab7
Compare
kripken
reviewed
Jul 14, 2026
d883ab7 to
0464dca
Compare
Collaborator
Author
|
I updated the webkitRequestFullscreen usage to apply only for safari < 16.4 |
ba322df to
2772bb3
Compare
This was referenced Jul 14, 2026
2772bb3 to
95087f4
Compare
slouken
pushed a commit
to libsdl-org/SDL
that referenced
this pull request
Jul 14, 2026
This modern navigator.mediaDevices.getUserMedia has been available since Chrome 53 / Firefox 38 / Safari 11. See emscripten-core/emscripten#27347
slouken
pushed a commit
to libsdl-org/SDL
that referenced
this pull request
Jul 14, 2026
This modern navigator.mediaDevices.getUserMedia has been available since Chrome 53 / Firefox 38 / Safari 11. See emscripten-core/emscripten#27347 (cherry picked from commit 31bd4ff)
slouken
pushed a commit
to libsdl-org/SDL
that referenced
this pull request
Jul 14, 2026
This modern navigator.mediaDevices.getUserMedia has been available since Chrome 53 / Firefox 38 / Safari 11. See emscripten-core/emscripten#27347
kripken
reviewed
Jul 14, 2026
89bd1af to
1b09445
Compare
kripken
approved these changes
Jul 14, 2026
kripken
left a comment
Member
There was a problem hiding this comment.
lgtm though I would still recommend manual testing here, ideally including safari, but even without, I don't think we have automatic tests that actually verify fullscreen works.
Collaborator
Author
|
I think @juj runs the whole browser test suite on Safari. We don't do any in our CI I'm afraid, although we arguably should do at least some! To really test this change we would need to test to also test on safari older then 16.4. I will manually test chrome and ff interactive full screen tests. |
Remove references to `mozRequestFullScreen`, `msRequestFullscreen`, `mozCancelFullScreen`, `msExitFullscreen`, `cancelFullScreen`, `mozfullscreenchange`, and `MSFullscreenChange` across `libbrowser.js` and `libglfw.js`. Convert bracket notation (`canvasContainer['requestFullscreen']`, `document['exitFullscreen']`) to standard dot notation. In `libhtml5.js`, remove `document.mozFullScreenElement`, `document.webkitCurrentFullScreenElement`, and `document.msFullscreenElement` from `$getFullscreenElement()`, leaving `document.fullscreenElement` and `document.webkitFullscreenElement` (guarded by `MIN_SAFARI_VERSION`). Also remove `screen.mozLockOrientation`, `screen.webkitLockOrientation`, `screen.mozUnlockOrientation`, and `screen.webkitUnlockOrientation` from `emscripten_lock_orientation` and `emscripten_unlock_orientation`. In `libbrowser.js`, `libopenal.js`, and `closure-externs.js`, remove obsolete `mozGetUserMedia`, `msGetUserMedia`, and `webkitGetUserMedia` fallbacks and extern definitions, and transition `getUserMedia` calls from the deprecated callback API (`navigator.getUserMedia`) to standard Promise-based `navigator.mediaDevices.getUserMedia`. These prefixed properties and fallbacks are safe to remove because: 1. Fullscreen, Screen Orientation, and MediaDevices APIs became unprefixed standards across Firefox, Chrome, and Safari years ago (e.g. `requestFullscreen` in Firefox 64 / Chrome 71, `navigator.mediaDevices.getUserMedia` in Chrome 53 / Firefox 38 / Safari 11). Emscripten's minimum supported browser versions (`MIN_FIREFOX_VERSION = 79`, `MIN_CHROME_VERSION = 85`) are well beyond when these unprefixed properties and methods became standard across major engines. 2. IE and legacy Edge (`ms` prefix) and Firefox OS (`moz` prefixes) are no longer supported. 3. Safari < 16.4 still requires `webkit` prefixes for Fullscreen, so `webkitRequestFullscreen`, `webkitExitFullscreen`, `webkitfullscreenchange`, and `webkitFullscreenElement` are retained where appropriate.
1b09445 to
a9c46cf
Compare
a9c46cf to
137373d
Compare
Collaborator
Author
|
I tested locally with chrome and firefox using interactive.test_html5_fullscreen and interactive.test_html5_emscripten_exit_fullscreen |
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.
Remove references to
mozRequestFullScreen,msRequestFullscreen,mozCancelFullScreen,msExitFullscreen,cancelFullScreen,mozfullscreenchange, andMSFullscreenChangeacrosslibbrowser.jsand
libglfw.js. Convert bracket notation(
canvasContainer['requestFullscreen'],document['exitFullscreen'])to standard dot notation.
In
libhtml5.js, removedocument.mozFullScreenElement,document.webkitCurrentFullScreenElement, anddocument.msFullscreenElementfrom$getFullscreenElement(), leavingdocument.fullscreenElementanddocument.webkitFullscreenElement(guarded by
MIN_SAFARI_VERSION). Also removescreen.mozLockOrientation,screen.webkitLockOrientation,screen.mozUnlockOrientation, andscreen.webkitUnlockOrientationfrom
emscripten_lock_orientationandemscripten_unlock_orientation.In
libbrowser.js,libopenal.js, andclosure-externs.js, removeobsolete
mozGetUserMedia,msGetUserMedia, andwebkitGetUserMediafallbacks and extern definitions, and transition
getUserMediacallsfrom the deprecated callback API (
navigator.getUserMedia) to standardPromise-based
navigator.mediaDevices.getUserMedia.These prefixed properties and fallbacks are safe to remove because:
unprefixed standards across Firefox, Chrome, and Safari years ago
(e.g.
requestFullscreenin Firefox 64 / Chrome 71,navigator.mediaDevices.getUserMediain Chrome 53 / Firefox 38 / Safari11). Emscripten's minimum supported browser versions
(
MIN_FIREFOX_VERSION = 79,MIN_CHROME_VERSION = 85) are well beyondwhen these unprefixed properties and methods became standard across
major engines.
msprefix) and Firefox OS (mozprefixes) areno longer supported.
webkitprefixes for Fullscreen, sowebkitRequestFullscreen,webkitExitFullscreen,webkitfullscreenchange, andwebkitFullscreenElementare retainedwhere appropriate.