You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove use of global event object from libhtml5.js. NFC (#25827)
This fallback to `windows.event` goes all the way back to the original
implementation in 2014: 96895e6.
According to AI the reason for this code was likely IE support:
"""
This common JavaScript pattern used in legacy code to ensure
cross-browser compatibility for accessing the event object. This was
necessary because older versions of Microsoft Internet Explorer (IE)
handled events differently than the standards-compliant browsers.
"""
Copy file name to clipboardExpand all lines: src/lib/libglut.js
-1Lines changed: 0 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -257,7 +257,6 @@ var LibraryGLUT = {
257
257
Browser.calculateMouseEvent(event);
258
258
259
259
// cross-browser wheel delta
260
-
vare=window.event||event;// old IE support
261
260
// Note the minus sign that flips browser wheel direction (positive direction scrolls page down) to native wheel direction (positive direction is mouse wheel up)
262
261
vardelta=-Browser.getMouseWheelDelta(event);
263
262
delta=(delta==0) ? 0 : (delta>0 ? Math.max(delta,1) : Math.min(delta,-1));// Quantize to integer so that minimum scroll is at least +/- 1.
fillDeviceOrientationEventData(JSEvents.deviceOrientationEvent,e,target);// TODO: Thread-safety with respect to emscripten_get_deviceorientation_status()
0 commit comments