Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix globals, part 16: clearInterval() & setInterval() #36042

Merged
merged 10 commits into from
Oct 4, 2024
Merged
40 changes: 19 additions & 21 deletions files/en-us/_redirects.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1213,7 +1213,7 @@
/en-US/docs/DOM/DOM_Reference/event /en-US/docs/Web/API/Event
/en-US/docs/DOM/DOM_Reference/style /en-US/docs/Web/API/HTMLStyleElement
/en-US/docs/DOM/DOM_Reference/window /en-US/docs/Web/API/Window
/en-US/docs/DOM/DOM_Reference/window/clearInterval /en-US/docs/Web/API/clearInterval
/en-US/docs/DOM/DOM_Reference/window/clearInterval /en-US/docs/Web/API/Window/clearInterval
/en-US/docs/DOM/DOM_event_handlers /en-US/docs/Web/Events/Event_handlers
/en-US/docs/DOM/DOM_event_reference /en-US/docs/Web/Events
/en-US/docs/DOM/DOM_event_reference/DOMContentLoaded /en-US/docs/Web/API/Document/DOMContentLoaded_event
Expand Down Expand Up @@ -2082,7 +2082,7 @@
/en-US/docs/DOM/window.cancelAnimationFrame /en-US/docs/Web/API/Window/cancelAnimationFrame
/en-US/docs/DOM/window.captureEvents /en-US/docs/Web/API/Window/captureEvents
/en-US/docs/DOM/window.clearImmediate /en-US/docs/Web/API/Window/clearImmediate
/en-US/docs/DOM/window.clearInterval /en-US/docs/Web/API/clearInterval
/en-US/docs/DOM/window.clearInterval /en-US/docs/Web/API/Window/clearInterval
/en-US/docs/DOM/window.clearTimeout /en-US/docs/Web/API/clearTimeout
/en-US/docs/DOM/window.close /en-US/docs/Web/API/Window/close
/en-US/docs/DOM/window.closed /en-US/docs/Web/API/Window/closed
Expand Down Expand Up @@ -2229,7 +2229,7 @@
/en-US/docs/DOM/window.scrollbars /en-US/docs/Web/API/Window/scrollbars
/en-US/docs/DOM/window.self /en-US/docs/Web/API/Window/self
/en-US/docs/DOM/window.setImmediate /en-US/docs/Web/API/Window/setImmediate
/en-US/docs/DOM/window.setInterval /en-US/docs/Web/API/setInterval
/en-US/docs/DOM/window.setInterval /en-US/docs/Web/API/Window/setInterval
/en-US/docs/DOM/window.setTimeout /en-US/docs/Web/API/setTimeout
/en-US/docs/DOM/window.showModalDialog /en-US/docs/Web/API/Window/showModalDialog
/en-US/docs/DOM/window.sidebar /en-US/docs/Web/API/Window/external
Expand Down Expand Up @@ -2542,7 +2542,7 @@
/en-US/docs/DOM:window.blur /en-US/docs/Web/API/Window/blur
/en-US/docs/DOM:window.btoa /en-US/docs/Web/API/Window/btoa
/en-US/docs/DOM:window.captureEvents /en-US/docs/Web/API/Window/captureEvents
/en-US/docs/DOM:window.clearInterval /en-US/docs/Web/API/clearInterval
/en-US/docs/DOM:window.clearInterval /en-US/docs/Web/API/Window/clearInterval
/en-US/docs/DOM:window.clearTimeout /en-US/docs/Web/API/clearTimeout
/en-US/docs/DOM:window.close /en-US/docs/Web/API/Window/close
/en-US/docs/DOM:window.closed /en-US/docs/Web/API/Window/closed
Expand Down Expand Up @@ -2651,7 +2651,7 @@
/en-US/docs/DOM:window.scrollY /en-US/docs/Web/API/Window/scrollY
/en-US/docs/DOM:window.scrollbars /en-US/docs/Web/API/Window/scrollbars
/en-US/docs/DOM:window.self /en-US/docs/Web/API/Window/self
/en-US/docs/DOM:window.setInterval /en-US/docs/Web/API/setInterval
/en-US/docs/DOM:window.setInterval /en-US/docs/Web/API/Window/setInterval
/en-US/docs/DOM:window.setTimeout /en-US/docs/Web/API/setTimeout
/en-US/docs/DOM:window.showModalDialog /en-US/docs/Web/API/Window/showModalDialog
/en-US/docs/DOM:window.sidebar /en-US/docs/Web/API/Window/external
Expand Down Expand Up @@ -3253,7 +3253,7 @@
/en-US/docs/Document_Object_Model_(DOM)/window.URL.revokeObjectURL /en-US/docs/Web/API/URL/revokeObjectURL_static
/en-US/docs/Document_Object_Model_(DOM)/window.captureEvents /en-US/docs/Web/API/Window/captureEvents
/en-US/docs/Document_Object_Model_(DOM)/window.clearImmediate /en-US/docs/Web/API/Window/clearImmediate
/en-US/docs/Document_Object_Model_(DOM)/window.clearInterval /en-US/docs/Web/API/clearInterval
/en-US/docs/Document_Object_Model_(DOM)/window.clearInterval /en-US/docs/Web/API/Window/clearInterval
/en-US/docs/Document_Object_Model_(DOM)/window.clearTimeout /en-US/docs/Web/API/clearTimeout
/en-US/docs/Document_Object_Model_(DOM)/window.close /en-US/docs/Web/API/Window/close
/en-US/docs/Document_Object_Model_(DOM)/window.closed /en-US/docs/Web/API/Window/closed
Expand Down Expand Up @@ -3370,7 +3370,7 @@
/en-US/docs/Document_Object_Model_(DOM)/window.scrollY /en-US/docs/Web/API/Window/scrollY
/en-US/docs/Document_Object_Model_(DOM)/window.scrollbars /en-US/docs/Web/API/Window/scrollbars
/en-US/docs/Document_Object_Model_(DOM)/window.setImmediate /en-US/docs/Web/API/Window/setImmediate
/en-US/docs/Document_Object_Model_(DOM)/window.setInterval /en-US/docs/Web/API/setInterval
/en-US/docs/Document_Object_Model_(DOM)/window.setInterval /en-US/docs/Web/API/Window/setInterval
/en-US/docs/Document_Object_Model_(DOM)/window.setTimeout /en-US/docs/Web/API/setTimeout
/en-US/docs/Document_Object_Model_(DOM)/window.showModalDialog /en-US/docs/Web/API/Window/showModalDialog
/en-US/docs/Document_Object_Model_(DOM)/window.sidebar /en-US/docs/Web/API/Window/external
Expand Down Expand Up @@ -10148,7 +10148,6 @@
/en-US/docs/Web/API/Window/animationend_event /en-US/docs/Web/API/Element/animationend_event
/en-US/docs/Web/API/Window/animationiteration_event /en-US/docs/Web/API/Element/animationiteration_event
/en-US/docs/Web/API/Window/animationstart_event /en-US/docs/Web/API/Element/animationstart_event
/en-US/docs/Web/API/Window/clearInterval /en-US/docs/Web/API/clearInterval
/en-US/docs/Web/API/Window/clearTimeout /en-US/docs/Web/API/clearTimeout
/en-US/docs/Web/API/Window/content /en-US/docs/Web/API/Window
/en-US/docs/Web/API/Window/convertPointFromNodeToPage /en-US/docs/Web/API/Window/webkitConvertPointFromNodeToPage
Expand Down Expand Up @@ -10213,7 +10212,6 @@
/en-US/docs/Web/API/Window/removeEventListener /en-US/docs/Web/API/EventTarget/removeEventListener
/en-US/docs/Web/API/Window/resolveLocalFileSystemURL /en-US/docs/Web/API/File_and_Directory_Entries_API#resolvelocalfilesystemurl()
/en-US/docs/Web/API/Window/restore /en-US/docs/Web/API/Window/moveTo
/en-US/docs/Web/API/Window/setInterval /en-US/docs/Web/API/setInterval
/en-US/docs/Web/API/Window/setTimeout /en-US/docs/Web/API/setTimeout
/en-US/docs/Web/API/Window/sidebar /en-US/docs/Web/API/Window/external
/en-US/docs/Web/API/Window/sidebar/Adding_search_engines_from_Web_pages /en-US/docs/Web/OpenSearch
Expand Down Expand Up @@ -10254,7 +10252,7 @@
/en-US/docs/Web/API/WindowOrWorkerGlobalScope/atob /en-US/docs/Web/API/Window/atob
/en-US/docs/Web/API/WindowOrWorkerGlobalScope/btoa /en-US/docs/Web/API/Window/btoa
/en-US/docs/Web/API/WindowOrWorkerGlobalScope/caches /en-US/docs/Web/API/Window/caches
/en-US/docs/Web/API/WindowOrWorkerGlobalScope/clearInterval /en-US/docs/Web/API/clearInterval
/en-US/docs/Web/API/WindowOrWorkerGlobalScope/clearInterval /en-US/docs/Web/API/Window/clearInterval
/en-US/docs/Web/API/WindowOrWorkerGlobalScope/clearTimeout /en-US/docs/Web/API/clearTimeout
/en-US/docs/Web/API/WindowOrWorkerGlobalScope/createImageBitmap /en-US/docs/Web/API/Window/createImageBitmap
/en-US/docs/Web/API/WindowOrWorkerGlobalScope/crossOriginIsolated /en-US/docs/Web/API/Window/crossOriginIsolated
Expand All @@ -10264,19 +10262,19 @@
/en-US/docs/Web/API/WindowOrWorkerGlobalScope/origin /en-US/docs/Web/API/Window/origin
/en-US/docs/Web/API/WindowOrWorkerGlobalScope/queueMicrotask /en-US/docs/Web/API/Window/queueMicrotask
/en-US/docs/Web/API/WindowOrWorkerGlobalScope/rejectionhandled_event /en-US/docs/Web/API/Window/rejectionhandled_event
/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setInterval /en-US/docs/Web/API/setInterval
/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setInterval /en-US/docs/Web/API/Window/setInterval
/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout /en-US/docs/Web/API/setTimeout
/en-US/docs/Web/API/WindowOrWorkerGlobalScope/structuredClone /en-US/docs/Web/API/Window/structuredClone
/en-US/docs/Web/API/WindowOrWorkerGlobalScope/unhandledrejection_event /en-US/docs/Web/API/Window/unhandledrejection_event
/en-US/docs/Web/API/WindowSessionStorage /en-US/docs/Web/API/Window/sessionStorage
/en-US/docs/Web/API/WindowSessionStorage.sessionStorage /en-US/docs/Web/API/Window/sessionStorage
/en-US/docs/Web/API/WindowTimers.clearInterval /en-US/docs/Web/API/clearInterval
/en-US/docs/Web/API/WindowTimers.clearInterval /en-US/docs/Web/API/Window/clearInterval
/en-US/docs/Web/API/WindowTimers.clearTimeout /en-US/docs/Web/API/clearTimeout
/en-US/docs/Web/API/WindowTimers.setInterval /en-US/docs/Web/API/setInterval
/en-US/docs/Web/API/WindowTimers.setInterval /en-US/docs/Web/API/Window/setInterval
/en-US/docs/Web/API/WindowTimers.setTimeout /en-US/docs/Web/API/setTimeout
/en-US/docs/Web/API/WindowTimers/clearInterval /en-US/docs/Web/API/clearInterval
/en-US/docs/Web/API/WindowTimers/clearInterval /en-US/docs/Web/API/Window/clearInterval
/en-US/docs/Web/API/WindowTimers/clearTimeout /en-US/docs/Web/API/clearTimeout
/en-US/docs/Web/API/WindowTimers/setInterval /en-US/docs/Web/API/setInterval
/en-US/docs/Web/API/WindowTimers/setInterval /en-US/docs/Web/API/Window/setInterval
/en-US/docs/Web/API/WindowTimers/setTimeout /en-US/docs/Web/API/setTimeout
/en-US/docs/Web/API/Worker.Worker /en-US/docs/Web/API/Worker/Worker
/en-US/docs/Web/API/Worker.Worker() /en-US/docs/Web/API/Worker/Worker
Expand Down Expand Up @@ -10305,7 +10303,6 @@
/en-US/docs/Web/API/WorkerGlobalScope.performance /en-US/docs/Web/API/WorkerGlobalScope/performance
/en-US/docs/Web/API/WorkerGlobalScope.self /en-US/docs/Web/API/WorkerGlobalScope/self
/en-US/docs/Web/API/WorkerGlobalScope/WorkerGlobalScope.caches /en-US/docs/Web/API/WorkerGlobalScope/caches
/en-US/docs/Web/API/WorkerGlobalScope/clearInterval /en-US/docs/Web/API/clearInterval
/en-US/docs/Web/API/WorkerGlobalScope/clearTimeout /en-US/docs/Web/API/clearTimeout
/en-US/docs/Web/API/WorkerGlobalScope/close /en-US/docs/Web/API/DedicatedWorkerGlobalScope/close
/en-US/docs/Web/API/WorkerGlobalScope/console /en-US/docs/Web/API/console
Expand All @@ -10315,7 +10312,6 @@
/en-US/docs/Web/API/WorkerGlobalScope/onoffline /en-US/docs/Web/API/WorkerGlobalScope/offline_event
/en-US/docs/Web/API/WorkerGlobalScope/ononline /en-US/docs/Web/API/WorkerGlobalScope/online_event
/en-US/docs/Web/API/WorkerGlobalScope/requestFileSystemSync /en-US/docs/Web/API/File_and_Directory_Entries_API
/en-US/docs/Web/API/WorkerGlobalScope/setInterval /en-US/docs/Web/API/setInterval
/en-US/docs/Web/API/WorkerGlobalScope/setTimeout /en-US/docs/Web/API/setTimeout
/en-US/docs/Web/API/WorkerLocation.hash /en-US/docs/Web/API/WorkerLocation/hash
/en-US/docs/Web/API/WorkerNavigator/taintEnabled /en-US/docs/Web/API/Navigator/taintEnabled
Expand Down Expand Up @@ -10404,6 +10400,7 @@
/en-US/docs/Web/API/atob /en-US/docs/Web/API/Window/atob
/en-US/docs/Web/API/btoa /en-US/docs/Web/API/Window/btoa
/en-US/docs/Web/API/caches /en-US/docs/Web/API/Window/caches
/en-US/docs/Web/API/clearInterval /en-US/docs/Web/API/Window/clearInterval
/en-US/docs/Web/API/console.assert /en-US/docs/Web/API/console/assert_static
/en-US/docs/Web/API/console.dir /en-US/docs/Web/API/console/dir_static
/en-US/docs/Web/API/console.error /en-US/docs/Web/API/console/error_static
Expand Down Expand Up @@ -10746,6 +10743,7 @@
/en-US/docs/Web/API/scheduler_property /en-US/docs/Web/API/Window/scheduler
/en-US/docs/Web/API/select.type /en-US/docs/Web/API/HTMLSelectElement/type
/en-US/docs/Web/API/sessionStorage /en-US/docs/Web/API/Window/sessionStorage
/en-US/docs/Web/API/setInterval /en-US/docs/Web/API/Window/setInterval
/en-US/docs/Web/API/structuredClone /en-US/docs/Web/API/Window/structuredClone
/en-US/docs/Web/API/style.media /en-US/docs/Web/API/HTMLStyleElement/media
/en-US/docs/Web/API/style.type /en-US/docs/Web/API/HTMLStyleElement/type
Expand Down Expand Up @@ -10789,7 +10787,7 @@
/en-US/docs/Web/API/window.cancelAnimationFrame /en-US/docs/Web/API/Window/cancelAnimationFrame
/en-US/docs/Web/API/window.captureEvents /en-US/docs/Web/API/Window/captureEvents
/en-US/docs/Web/API/window.clearImmediate /en-US/docs/Web/API/Window/clearImmediate
/en-US/docs/Web/API/window.clearInterval /en-US/docs/Web/API/clearInterval
/en-US/docs/Web/API/window.clearInterval /en-US/docs/Web/API/Window/clearInterval
/en-US/docs/Web/API/window.clearTimeout /en-US/docs/Web/API/clearTimeout
/en-US/docs/Web/API/window.close /en-US/docs/Web/API/Window/close
/en-US/docs/Web/API/window.closed /en-US/docs/Web/API/Window/closed
Expand Down Expand Up @@ -10938,7 +10936,7 @@
/en-US/docs/Web/API/window.scrollbars /en-US/docs/Web/API/Window/scrollbars
/en-US/docs/Web/API/window.self /en-US/docs/Web/API/Window/self
/en-US/docs/Web/API/window.setImmediate /en-US/docs/Web/API/Window/setImmediate
/en-US/docs/Web/API/window.setInterval /en-US/docs/Web/API/setInterval
/en-US/docs/Web/API/window.setInterval /en-US/docs/Web/API/Window/setInterval
/en-US/docs/Web/API/window.setTimeout /en-US/docs/Web/API/setTimeout
/en-US/docs/Web/API/window.showModalDialog /en-US/docs/Web/API/Window/showModalDialog
/en-US/docs/Web/API/window.sidebar /en-US/docs/Web/API/Window/external
Expand Down Expand Up @@ -13756,7 +13754,7 @@
/en-US/docs/web/api/DOMPoint/fromPoint /en-US/docs/Web/API/DOMPoint/fromPoint_static
/en-US/docs/width /en-US/docs/Web/CSS/width
/en-US/docs/window.captureEvents /en-US/docs/Web/API/Window/captureEvents
/en-US/docs/window.clearInterval /en-US/docs/Web/API/clearInterval
/en-US/docs/window.clearInterval /en-US/docs/Web/API/Window/clearInterval
/en-US/docs/window.clearTimeout /en-US/docs/Web/API/clearTimeout
/en-US/docs/window.close /en-US/docs/Web/API/Window/close
/en-US/docs/window.closed /en-US/docs/Web/API/Window/closed
Expand Down Expand Up @@ -13799,7 +13797,7 @@
/en-US/docs/window.scrollX /en-US/docs/Web/API/Window/scrollX
/en-US/docs/window.scrollY /en-US/docs/Web/API/Window/scrollY
/en-US/docs/window.scrollbars /en-US/docs/Web/API/Window/scrollbars
/en-US/docs/window.setInterval /en-US/docs/Web/API/setInterval
/en-US/docs/window.setInterval /en-US/docs/Web/API/Window/setInterval
/en-US/docs/window.setTimeout /en-US/docs/Web/API/setTimeout
/en-US/docs/window.sidebar /en-US/docs/Web/API/Window/external
/en-US/docs/window.sizeToContent /en-US/docs/Web/API/Window/sizeToContent
Expand Down
178 changes: 89 additions & 89 deletions files/en-us/_wikihistory.json
Original file line number Diff line number Diff line change
Expand Up @@ -66504,6 +66504,30 @@
"McGurk"
]
},
"Web/API/Window/clearInterval": {
"modified": "2020-10-15T21:11:20.211Z",
"contributors": [
"mileskrell",
"fscholz",
"erikadoyle",
"chrisdavidmills",
"Sheppy",
"cvrebert",
"dyagmin",
"teoli",
"Mats.Palmgren",
"ethertank",
"ziyunfei",
"fusionchess",
"qfel13",
"Nickolay",
"Taken",
"Mgjbot",
"BenoitL",
"Maian",
"JesseW"
]
},
"Web/API/Window/close": {
"modified": "2020-10-15T21:06:33.895Z",
"contributors": [
Expand Down Expand Up @@ -68856,6 +68880,71 @@
"McGurk"
]
},
"Web/API/Window/setInterval": {
"modified": "2020-12-09T23:19:41.310Z",
"contributors": [
"uzair-ashraf",
"SpartaSixZero",
"albedoa",
"xgqfrms",
"ankit.sangwan1999",
"Soul",
"yuedou",
"mfuji09",
"Sheppy",
"a18wheeler",
"jabcreations",
"severo",
"GusGold",
"fscholz",
"leolavaur",
"livthomas",
"chrisdavidmills",
"Anto_Rich",
"telunc",
"erikadoyle",
"nmve",
"kdex",
"teatimesoft",
"fusionchess",
"mathiasvr",
"mikemsq",
"michals",
"Jorge.villalobos",
"maybe",
"rolfedh",
"bmwolfington",
"dreamweiver",
"Sebastianz",
"dyagmin",
"jeff_mangus",
"teoli",
"kertof",
"DDERRSS",
"jonathansampson",
"iamanupmenon",
"ethertank",
"m_gol",
"dancrumb",
"brunoais",
"BrianDiPalma",
"McGurk",
"wooptoo",
"jjoemb",
"Jesse",
"HarrisonM",
"ehynds",
"Nickolay",
"aeon",
"Ceth",
"1212jtraceur",
"Mgjbot",
"Jabez",
"BenoitL",
"Dria",
"JesseW"
]
},
"Web/API/Window/showDirectoryPicker": {
"modified": "2020-12-12T15:32:04.243Z",
"contributors": ["Rumyra"]
Expand Down Expand Up @@ -70977,30 +71066,6 @@
"modified": "2019-03-23T23:49:50.843Z",
"contributors": ["SphinxKnight", "teoli", "Mgjbot", "Sebuls", "JdeValk"]
},
"Web/API/clearInterval": {
"modified": "2020-10-15T21:11:20.211Z",
"contributors": [
"mileskrell",
"fscholz",
"erikadoyle",
"chrisdavidmills",
"Sheppy",
"cvrebert",
"dyagmin",
"teoli",
"Mats.Palmgren",
"ethertank",
"ziyunfei",
"fusionchess",
"qfel13",
"Nickolay",
"Taken",
"Mgjbot",
"BenoitL",
"Maian",
"JesseW"
]
},
"Web/API/clearTimeout": {
"modified": "2020-10-15T21:09:05.105Z",
"contributors": [
Expand Down Expand Up @@ -71528,71 +71593,6 @@
"myakura"
]
},
"Web/API/setInterval": {
"modified": "2020-12-09T23:19:41.310Z",
"contributors": [
"uzair-ashraf",
"SpartaSixZero",
"albedoa",
"xgqfrms",
"ankit.sangwan1999",
"Soul",
"yuedou",
"mfuji09",
"Sheppy",
"a18wheeler",
"jabcreations",
"severo",
"GusGold",
"fscholz",
"leolavaur",
"livthomas",
"chrisdavidmills",
"Anto_Rich",
"telunc",
"erikadoyle",
"nmve",
"kdex",
"teatimesoft",
"fusionchess",
"mathiasvr",
"mikemsq",
"michals",
"Jorge.villalobos",
"maybe",
"rolfedh",
"bmwolfington",
"dreamweiver",
"Sebastianz",
"dyagmin",
"jeff_mangus",
"teoli",
"kertof",
"DDERRSS",
"jonathansampson",
"iamanupmenon",
"ethertank",
"m_gol",
"dancrumb",
"brunoais",
"BrianDiPalma",
"McGurk",
"wooptoo",
"jjoemb",
"Jesse",
"HarrisonM",
"ehynds",
"Nickolay",
"aeon",
"Ceth",
"1212jtraceur",
"Mgjbot",
"Jabez",
"BenoitL",
"Dria",
"JesseW"
]
},
"Web/API/setTimeout": {
"modified": "2020-10-15T21:06:28.845Z",
"contributors": [
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/games/anatomy/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ Other methods of tackling the problem exist.

One common technique is to update the simulation at a constant frequency and then draw as much (or as little) of the actual frames as possible. The update method can continue looping without care about what the user sees. The draw method can view the last update and when it happened. Since draw knows when it represents, and the simulation time for the last update, it can predict a plausible frame to draw for the user. It does not matter whether this is more frequent than the official update loop (or even less frequent). The update method sets checkpoints and, as frequently as the system allows, the render method draws instants of time around them. There are many ways to separate the update method in web standards:

- Draw on `requestAnimationFrame` and update on a {{ domxref("setInterval()") }} or {{ domxref("setTimeout()") }}.
- Draw on `requestAnimationFrame()` and update on a {{domxref("Window.setInterval", "setInterval()")}} or {{domxref("setTimeout()")}}.

- This uses processor time even when unfocused or minimized, hogs the main thread, and is probably an artifact of traditional game loops (but it is simple.)

Expand Down
Loading