From e3f4fd5dce17edbfa633512791a6fba302183e76 Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Sat, 23 Jul 2022 16:43:50 -0700 Subject: [PATCH] Demix onplay(ing)/pause from GlobalEventHandlers mixin --- files/en-us/_redirects.txt | 7 ++- files/en-us/_wikihistory.json | 28 --------- .../web/api/globaleventhandlers/index.md | 6 -- .../api/globaleventhandlers/onpause/index.md | 42 ------------- .../api/globaleventhandlers/onplay/index.md | 60 ------------------- .../globaleventhandlers/onplaying/index.md | 43 ------------- .../api/htmlmediaelement/pause_event/index.md | 45 +++++--------- .../api/htmlmediaelement/play_event/index.md | 43 +++++-------- .../htmlmediaelement/playing_event/index.md | 43 +++++-------- files/en-us/web/media/autoplay_guide/index.md | 2 +- 10 files changed, 51 insertions(+), 268 deletions(-) delete mode 100644 files/en-us/web/api/globaleventhandlers/onpause/index.md delete mode 100644 files/en-us/web/api/globaleventhandlers/onplay/index.md delete mode 100644 files/en-us/web/api/globaleventhandlers/onplaying/index.md diff --git a/files/en-us/_redirects.txt b/files/en-us/_redirects.txt index cac8b914ddc27af..5e216145e0afab3 100644 --- a/files/en-us/_redirects.txt +++ b/files/en-us/_redirects.txt @@ -8131,8 +8131,8 @@ /en-US/docs/Web/API/GlobalEventHandlers/GlobalEventHandlers.onmouseenter /en-US/docs/Web/API/Element/mouseenter_event /en-US/docs/Web/API/GlobalEventHandlers/GlobalEventHandlers.onmouseleave /en-US/docs/Web/API/Element/mouseleave_event /en-US/docs/Web/API/GlobalEventHandlers/GlobalEventHandlers.onmousewheel /en-US/docs/Web/API/Element/mousewheel_event -/en-US/docs/Web/API/GlobalEventHandlers/GlobalEventHandlers.onpause /en-US/docs/Web/API/GlobalEventHandlers/onpause -/en-US/docs/Web/API/GlobalEventHandlers/GlobalEventHandlers.onplay /en-US/docs/Web/API/GlobalEventHandlers/onplay +/en-US/docs/Web/API/GlobalEventHandlers/GlobalEventHandlers.onpause /en-US/docs/Web/API/HTMLMediaElement/pause_event +/en-US/docs/Web/API/GlobalEventHandlers/GlobalEventHandlers.onplay /en-US/docs/Web/API/HTMLMediaElement/play_event /en-US/docs/Web/API/GlobalEventHandlers/GlobalEventHandlers.ontouchend /en-US/docs/Web/API/Element/touchend_event /en-US/docs/Web/API/GlobalEventHandlers/dragexit_event /en-US/docs/Web/API/Document/dragleave_event /en-US/docs/Web/API/GlobalEventHandlers/onabort /en-US/docs/Web/API/HTMLMediaElement/abort_event @@ -8184,6 +8184,9 @@ /en-US/docs/Web/API/GlobalEventHandlers/onmousewheel /en-US/docs/Web/API/Element/mousewheel_event /en-US/docs/Web/API/GlobalEventHandlers/onmozfullscreenchange /en-US/docs/Web/API/Document/fullscreenchange_event /en-US/docs/Web/API/GlobalEventHandlers/onmozfullscreenerror /en-US/docs/Web/API/Document/fullscreenerror_event +/en-US/docs/Web/API/GlobalEventHandlers/onpause /en-US/docs/Web/API/HTMLMediaElement/pause_event +/en-US/docs/Web/API/GlobalEventHandlers/onplay /en-US/docs/Web/API/HTMLMediaElement/play_event +/en-US/docs/Web/API/GlobalEventHandlers/onplaying /en-US/docs/Web/API/HTMLMediaElement/playing_event /en-US/docs/Web/API/GlobalEventHandlers/onpointercancel /en-US/docs/Web/API/Element/pointercancel_event /en-US/docs/Web/API/GlobalEventHandlers/onpointerdown /en-US/docs/Web/API/Element/pointerdown_event /en-US/docs/Web/API/GlobalEventHandlers/onpointerdown/drag /en-US/docs/Web/API/HTMLElement/drag_event diff --git a/files/en-us/_wikihistory.json b/files/en-us/_wikihistory.json index 43ae84b347bedd0..a8ef0fab38ac233 100644 --- a/files/en-us/_wikihistory.json +++ b/files/en-us/_wikihistory.json @@ -44335,34 +44335,6 @@ "alecananian" ] }, - "Web/API/GlobalEventHandlers/onpause": { - "modified": "2020-10-15T21:44:06.725Z", - "contributors": [ - "mfluehr", - "fscholz", - "sideshowbarker", - "wbamberg", - "rolfedh", - "Guillaume-Heras" - ] - }, - "Web/API/GlobalEventHandlers/onplay": { - "modified": "2020-10-15T21:44:07.349Z", - "contributors": [ - "mfluehr", - "fscholz", - "wbamberg", - "Guillaume-Heras", - "rolfedh" - ] - }, - "Web/API/GlobalEventHandlers/onplaying": { - "modified": "2020-10-15T22:31:14.016Z", - "contributors": [ - "mfuji09", - "bershanskiy" - ] - }, "Web/API/Gyroscope": { "modified": "2020-10-15T22:08:47.425Z", "contributors": [ diff --git a/files/en-us/web/api/globaleventhandlers/index.md b/files/en-us/web/api/globaleventhandlers/index.md index f1c776e7c31a046..4d05764d393085d 100644 --- a/files/en-us/web/api/globaleventhandlers/index.md +++ b/files/en-us/web/api/globaleventhandlers/index.md @@ -35,12 +35,6 @@ These event handlers are defined on the {{domxref("GlobalEventHandlers")}} mixin - : An [event handler](/en-US/docs/Web/Events/Event_handlers) for processing {{domxref("HTMLFormElement/formdata_event", "formdata")}} events, fired after the entry list representing the form's data is constructed. - {{domxref("GlobalEventHandlers.onload")}} - : An [event handler](/en-US/docs/Web/Events/Event_handlers) representing the code to be called when the {{domxref("Window/load_event", "load")}} event is raised. -- {{domxref("GlobalEventHandlers.onpause")}} - - : An [event handler](/en-US/docs/Web/Events/Event_handlers) representing the code to be called when the {{domxref("HTMLMediaElement/pause_event", "pause")}} event is raised. -- {{domxref("GlobalEventHandlers.onplay")}} - - : An [event handler](/en-US/docs/Web/Events/Event_handlers) representing the code to be called when the {{domxref("HTMLMediaElement/play_event", "play")}} event is raised. -- {{domxref("GlobalEventHandlers.onplaying")}} - - : An [event handler](/en-US/docs/Web/Events/Event_handlers) representing the code to be called when the {{domxref("HTMLMediaElement/playing_event", "playing")}} event is raised. - {{domxref("GlobalEventHandlers.onprogress")}} - : An [event handler](/en-US/docs/Web/Events/Event_handlers) representing the code to be called when the {{domxref("HTMLMediaElement/progress_event", "progress")}} event is raised. - {{domxref("GlobalEventHandlers.onratechange")}} diff --git a/files/en-us/web/api/globaleventhandlers/onpause/index.md b/files/en-us/web/api/globaleventhandlers/onpause/index.md deleted file mode 100644 index 5c416773a752e46..000000000000000 --- a/files/en-us/web/api/globaleventhandlers/onpause/index.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: GlobalEventHandlers.onpause -slug: Web/API/GlobalEventHandlers/onpause -page-type: web-api-instance-property -tags: - - API - - Event Handler - - GlobalEventHandlers - - Property - - Reference -browser-compat: api.GlobalEventHandlers.onpause ---- -{{ ApiRef("HTML DOM") }} - -The **`onpause`** property of the -{{domxref("GlobalEventHandlers")}} mixin is the [event handler](/en-US/docs/Web/Events/Event_handlers) for -processing {{domxref("HTMLMediaElement/pause_event", "pause")}} events. - -The `pause` event is fired when media playback has been paused. - -## Syntax - -```js -element.onpause = handlerFunction; -var handlerFunction = element.onpause; -``` - -`handlerFunction` should be either `null` or a [JavaScript function](/en-US/docs/Web/JavaScript/Reference/Functions) -specifying the handler for the event. - -## Specifications - -{{Specifications}} - -## Browser compatibility - -{{Compat}} - -## See also - -- {{domxref("HTMLMediaElement/pause_event", "pause")}} -- [DOM event handlers](/en-US/docs/Web/Events/Event_handlers) diff --git a/files/en-us/web/api/globaleventhandlers/onplay/index.md b/files/en-us/web/api/globaleventhandlers/onplay/index.md deleted file mode 100644 index 7e7bde419b96be6..000000000000000 --- a/files/en-us/web/api/globaleventhandlers/onplay/index.md +++ /dev/null @@ -1,60 +0,0 @@ ---- -title: GlobalEventHandlers.onplay -slug: Web/API/GlobalEventHandlers/onplay -page-type: web-api-instance-property -tags: - - API - - Event Handler - - GlobalEventHandlers - - Property - - Reference -browser-compat: api.GlobalEventHandlers.onplay ---- -{{ ApiRef("HTML DOM") }} - -The **`onplay`** property of the -{{domxref("GlobalEventHandlers")}} mixin is the [event handler](/en-US/docs/Web/Events/Event_handlers) for -processing {{domxref("HTMLMediaElement/play_event", "play")}} events. - -## Syntax - -```js -element.onplay = handlerFunction; -var handlerFunction = element.onplay; -``` - -`handlerFunction` should be either `null` or a [JavaScript function](/en-US/docs/Web/JavaScript/Reference/Functions) -specifying the handler for the event. - -## Example - -```html -

This example demonstrates how to assign an "onplay" event to a video element.

- - - -

Video courtesy of Big Buck Bunny.

- - -``` - -## Specifications - -{{Specifications}} - -## Browser compatibility - -{{Compat}} - -## See also - -- {{domxref("HTMLMediaElement/play_event", "play")}} -- [Information on working with event handlers](/en-US/docs/Web/Events/Event_handlers) diff --git a/files/en-us/web/api/globaleventhandlers/onplaying/index.md b/files/en-us/web/api/globaleventhandlers/onplaying/index.md deleted file mode 100644 index 67f8126e1b5d7bc..000000000000000 --- a/files/en-us/web/api/globaleventhandlers/onplaying/index.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -title: GlobalEventHandlers.onplaying -slug: Web/API/GlobalEventHandlers/onplaying -page-type: web-api-instance-property -tags: - - API - - Event Handler - - GlobalEventHandlers - - Property - - Reference -browser-compat: api.GlobalEventHandlers.onplaying ---- -{{ApiRef("HTML DOM")}} - -The **`onplaying`** property of the -{{domxref("GlobalEventHandlers")}} mixin is the [event handler](/en-US/docs/Web/Events/Event_handlers) for -processing {{domxref("HTMLMediaElement/playing_event", "playing")}} events. - -The `playing` event is fired when playback is ready to start after having -been paused or delayed due to lack of media data. - -## Syntax - -```js -element.onplaying = handlerFunction; -var handlerFunction = element.onplaying; -``` - -`handlerFunction` is either `null` or a [JavaScript function](/en-US/docs/Web/JavaScript/Reference/Functions) -specifying the handler for the event. - -## Specifications - -{{Specifications}} - -## Browser compatibility - -{{Compat}} - -## See also - -- {{domxref("HTMLMediaElement/playing_event", "playing")}} -- [DOM event handlers](/en-US/docs/Web/Events/Event_handlers) diff --git a/files/en-us/web/api/htmlmediaelement/pause_event/index.md b/files/en-us/web/api/htmlmediaelement/pause_event/index.md index f7c7fba98507804..d32012f7eceebb3 100644 --- a/files/en-us/web/api/htmlmediaelement/pause_event/index.md +++ b/files/en-us/web/api/htmlmediaelement/pause_event/index.md @@ -26,36 +26,21 @@ The `pause` event is sent when a request to pause an activity is handled and the The event is sent once the `pause()` method returns and after the media element's {{domxref("HTMLMediaElement.paused", "paused")}} property has been changed to `true`. -## General info - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
BubblesNo
CancelableNo
Interface{{DOMxRef("Event")}}
TargetElement
Default ActionNone
Event handler property{{domxref("GlobalEventHandlers.onpause")}}
+This event is not cancelable and does not bubble. + +## Syntax + +Use the event name in methods like {{domxref("EventTarget.addEventListener", "addEventListener()")}}, or set an event handler property. + +```js +addEventListener('pause', (event) => {}); + +onpause = (event) => { }; +``` + +## Event type + +A generic {{domxref("Event")}}. ## Examples diff --git a/files/en-us/web/api/htmlmediaelement/play_event/index.md b/files/en-us/web/api/htmlmediaelement/play_event/index.md index 4770ef1ecf13b18..d2dbf94fddd1ccb 100644 --- a/files/en-us/web/api/htmlmediaelement/play_event/index.md +++ b/files/en-us/web/api/htmlmediaelement/play_event/index.md @@ -14,34 +14,21 @@ browser-compat: api.HTMLMediaElement.play_event The `play` event is fired when the `paused` property is changed from `true` to `false`, as a result of the `play` method, or the `autoplay` attribute. - - - - - - - - - - - - - - - - - - - - - - - - - - - -
BubblesNo
CancelableNo
Interface{{DOMxRef("Event")}}
TargetElement
Default ActionNone
Event handler property{{domxref("GlobalEventHandlers.onplay")}}
+This event is not cancelable and does not bubble. + +## Syntax + +Use the event name in methods like {{domxref("EventTarget.addEventListener", "addEventListener()")}}, or set an event handler property. + +```js +addEventListener('play', (event) => {}); + +onplay = (event) => { }; +``` + +## Event type + +A generic {{domxref("Event")}}. ## Examples diff --git a/files/en-us/web/api/htmlmediaelement/playing_event/index.md b/files/en-us/web/api/htmlmediaelement/playing_event/index.md index 0539cf425813c7e..f2c54919e686d81 100644 --- a/files/en-us/web/api/htmlmediaelement/playing_event/index.md +++ b/files/en-us/web/api/htmlmediaelement/playing_event/index.md @@ -14,34 +14,21 @@ browser-compat: api.HTMLMediaElement.playing_event The `playing` event is fired after playback is first started, and whenever it is restarted. For example it is fired when playback resumes after having been paused or delayed due to lack of data. - - - - - - - - - - - - - - - - - - - - - - - - - - - -
BubblesNo
CancelableNo
Interface{{DOMxRef("Event")}}
TargetElement
Default ActionNone
Event handler property{{domxref("GlobalEventHandlers.onplaying")}}
+This event is not cancelable and does not bubble. + +## Syntax + +Use the event name in methods like {{domxref("EventTarget.addEventListener", "addEventListener()")}}, or set an event handler property. + +```js +addEventListener('playing', (event) => {}); + +onplaying = (event) => { }; +``` + +## Event type + +A generic {{domxref("Event")}}. ## Examples diff --git a/files/en-us/web/media/autoplay_guide/index.md b/files/en-us/web/media/autoplay_guide/index.md index d26255964ecadf1..68b59dcfc18e03d 100644 --- a/files/en-us/web/media/autoplay_guide/index.md +++ b/files/en-us/web/media/autoplay_guide/index.md @@ -97,7 +97,7 @@ Consider this HTML for a media element: