diff --git a/files/en-us/mozilla/firefox/releases/18/index.md b/files/en-us/mozilla/firefox/releases/18/index.md index 06c72fd93599e6a..796b1036efc2ab3 100644 --- a/files/en-us/mozilla/firefox/releases/18/index.md +++ b/files/en-us/mozilla/firefox/releases/18/index.md @@ -30,7 +30,7 @@ Firefox 18 was released on January 8, 2013. This article lists key changes that - `window.devicePixelRatio` has been landed. ({{bug("564815")}}) - The MacOS X backend for `window.navigator.battery` has been implemented. ({{bug("696045")}}) - {{domxref("BlobBuilder", "MozBlobBuilder")}} is removed. Developers need to use {{domxref("Blob")}} constructor for creating a `Blob` object. ({{bug("744907")}}) -- The {{event("visibilitychange")}} event and the [Page Visibility API](/en-US/docs/Web/API/Page_Visibility_API) has been unprefixed ({{bug("812086")}}). +- The {{domxref("document.visibilitychange_event", "visibilitychange")}} event and the [Page Visibility API](/en-US/docs/Web/API/Page_Visibility_API) has been unprefixed ({{bug("812086")}}). - {{domxref("TextDecoder")}} and {{domxref("TextEncoder")}} have been added. Note that the implementation and spec of these evolved and have been changed in Firefox 19 ({{bug("764234")}}). - `HTMLMediaElement.src` has been separate in two properties: the standard `src` property, dealing with {{domxref("DOMString")}}, and the prefixed `mozSrcObject` property, dealing with [media streams](/en-US/docs/Web/API/Media_Streams_API) ({{bug("792665")}}). - Support for [transferable objects.](/en-US/docs/Web/API/Web_Workers_API/Using_web_workers#passing_data_by_transferring_.c2.a0ownership_%28transferable_objects%29) diff --git a/files/en-us/mozilla/firefox/releases/59/index.md b/files/en-us/mozilla/firefox/releases/59/index.md index ad357a648cd9b59..67c7d019400218a 100644 --- a/files/en-us/mozilla/firefox/releases/59/index.md +++ b/files/en-us/mozilla/firefox/releases/59/index.md @@ -66,7 +66,7 @@ _No changes._ #### Media and WebRTC -- The {{domxref("MediaStreamTrack")}} property {{domxref("MediaStreamTrack.muted")}}, along with the events {{event("mute")}} and {{event("unmute")}} and the corresponding event handlers, {{domxref("MediaStreamTrack.mute_event", "onmute")}} and {{domxref("MediaStreamTrack.unmute_event", "onunmute")}}, have been implemented. A track's `muted` state indicates that the track is not currently able to provide media data. +- The {{domxref("MediaStreamTrack")}} property {{domxref("MediaStreamTrack.muted")}}, along with the events {{domxref("MediaStreamTrack.mute_event", "mute")}} and {{domxref("MediaStreamTrack.unmute_event", "unmute")}} and the corresponding event handlers, {{domxref("MediaStreamTrack.mute_event", "onmute")}} and {{domxref("MediaStreamTrack.unmute_event", "onunmute")}}, have been implemented. A track's `muted` state indicates that the track is not currently able to provide media data. > **Note:** The `muted` state of a track isn't useful for what's typically thought of as muting and unmuting a track. Instead, use the {{domxref("MediaStreamTrack.enabled", "enabled")}} property; setting `enabled` to `false` causes the track to output only empty frames. diff --git a/files/en-us/web/api/idbversionchangeevent/index.md b/files/en-us/web/api/idbversionchangeevent/index.md index 966fb6072d6bcd8..122f607940f07c5 100644 --- a/files/en-us/web/api/idbversionchangeevent/index.md +++ b/files/en-us/web/api/idbversionchangeevent/index.md @@ -39,7 +39,7 @@ _Also inherits properties from its parent, {{domxref("Event")}} interface._ - {{ domxref("IDBVersionChangeEvent.version") }} {{readonlyInline}} {{deprecated_inline}} - - : The new version of the database in a {{event("versionchange")}} transaction. + - : The new version of the database in a {{domxref("IDBDatabase.versionchange_event", "versionchange")}} transaction. > **Warning:** While this property is still implemented in older browsers, the latest specification replaces it with the `oldVersion` and `newVersion` attributes. See the compatibility table to know what browsers support them. diff --git a/files/en-us/web/api/intersection_observer_api/timing_element_visibility/index.md b/files/en-us/web/api/intersection_observer_api/timing_element_visibility/index.md index dab98a60ac34dd9..07df79e88a52dfd 100644 --- a/files/en-us/web/api/intersection_observer_api/timing_element_visibility/index.md +++ b/files/en-us/web/api/intersection_observer_api/timing_element_visibility/index.md @@ -253,7 +253,7 @@ function startup() { } ``` -First, a reference to the content wrapping {{HTMLElement("main")}} element is obtained, so we can insert our content into it. Then we set up an event listener for the {{event("visibilitychange")}} event. This event is sent when the document becomes hidden or visible, such as when the user switches tabs in their browser. The Intersection Observer API doesn't take this into account when detecting intersection, since intersection isn't affected by page visibility. Therefore, we need to pause our timers while the page is tabbed out; hence this event listener. +First, a reference to the content wrapping {{HTMLElement("main")}} element is obtained, so we can insert our content into it. Then we set up an event listener for the {{domxref("document.visibilitychange_event", "visibilitychange")}} event. This event is sent when the document becomes hidden or visible, such as when the user switches tabs in their browser. The Intersection Observer API doesn't take this into account when detecting intersection, since intersection isn't affected by page visibility. Therefore, we need to pause our timers while the page is tabbed out; hence this event listener. Next we set up the options for the {{domxref("IntersectionObserver")}} which will monitor target elements (ads, in our case) for intersection changes relative to the document. The options are configured to watch for intersections with the document's viewport (by setting `root` to `null`). We have no margins to extend or contract the intersection root's rectangle; we want to match the boundaries of the document's viewport exactly for intersection purposes. And the `threshold` is set to an array containing the values 0.0 and 0.75; this will cause our callback to execute whenever a targeted element becomes completely obscured or first starts to become unobscured (intersection ratio 0.0) or passes through 75% visible in either direction (intersection ratio 0.75). @@ -265,7 +265,7 @@ Finally, we set up an interval which triggers once a second to handle any necess #### Handling document visibility changes -Let's take a look at the handler for the {{event("visibilitychange")}} event. Our script receives this event when the document itself becomes visible or invisible. The most important scenario here is when the user switches tabs. Since Intersection Observer only cares about the intersection between the targeted elements and the intersection root, and not the tab's visibility (which is a different issue entirely), we need to use the [Page Visibility API](/en-US/docs/Web/API/Page_Visibility_API) to detect these tab switches and disable our timers for the duration. +Let's take a look at the handler for the {{domxref("document.visibilitychange_event", "visibilitychange")}} event. Our script receives this event when the document itself becomes visible or invisible. The most important scenario here is when the user switches tabs. Since Intersection Observer only cares about the intersection between the targeted elements and the intersection root, and not the tab's visibility (which is a different issue entirely), we need to use the [Page Visibility API](/en-US/docs/Web/API/Page_Visibility_API) to detect these tab switches and disable our timers for the duration. ```js function handleVisibilityChange() { diff --git a/files/en-us/web/api/media_streams_api/index.md b/files/en-us/web/api/media_streams_api/index.md index 771f9204e0e4fd0..573a78d2f64320b 100644 --- a/files/en-us/web/api/media_streams_api/index.md +++ b/files/en-us/web/api/media_streams_api/index.md @@ -56,7 +56,7 @@ Early versions of the Media Capture and Streams API specification included separ - {{event("addtrack")}} - {{event("ended")}} - {{event("muted")}} -- {{event("overconstrained")}} +- {{domxref("MediaStreamTrack.overconstrained_event", "overconstrained")}} - {{event("removetrack")}} - {{event("started")}} - {{event("unmuted")}} diff --git a/files/en-us/web/api/mediarecorder/dataavailable_event/index.md b/files/en-us/web/api/mediarecorder/dataavailable_event/index.md index 786154688f094a7..f21b22dcdede751 100644 --- a/files/en-us/web/api/mediarecorder/dataavailable_event/index.md +++ b/files/en-us/web/api/mediarecorder/dataavailable_event/index.md @@ -42,7 +42,7 @@ object that contains the data. This occurs in four situations: produce multiple same-length blobs plus other shorter blobs as well. > **Note:** The {{domxref("Blob")}} containing the media data is available in the -> {{event("dataavailable")}} event's `data` property. +> {{domxref("MediaRecorder.dataavailable_event", "dataavailable")}} event's `data` property. ## Syntax diff --git a/files/en-us/web/api/mediarecorder/error_event/index.md b/files/en-us/web/api/mediarecorder/error_event/index.md index e607ea50b4267dc..d7edfe204c0cf9a 100644 --- a/files/en-us/web/api/mediarecorder/error_event/index.md +++ b/files/en-us/web/api/mediarecorder/error_event/index.md @@ -60,7 +60,7 @@ the value of {{domxref("DOMException.name", "MediaRecorderErrorEvent.error.name" - `UnknownError` - : An non-security related error occurred that cannot otherwise be categorized. Recording stops, the `MediaRecorder`'s {{domxref("MediaRecorder.state", - "state")}} becomes `inactive`, one last {{event("dataavailable")}} event is + "state")}} becomes `inactive`, one last {{domxref("MediaRecorder.dataavailable_event", "dataavailable")}} event is sent to the `MediaRecorder` with the remaining received data, and finally a {{event("stop")}} event is sent. diff --git a/files/en-us/web/api/mediarecorder/index.md b/files/en-us/web/api/mediarecorder/index.md index f6593c4e8091c61..2894e2a374fd562 100644 --- a/files/en-us/web/api/mediarecorder/index.md +++ b/files/en-us/web/api/mediarecorder/index.md @@ -49,7 +49,7 @@ The **`MediaRecorder`** interface of the [MediaStream Recording API](/en-US/docs - {{domxref("MediaRecorder.start()")}} - : Begins recording media; this method can optionally be passed a `timeslice` argument with a value in milliseconds. If this is specified, the media will be captured in separate chunks of that duration, rather than the default behavior of recording the media in a single large chunk. - {{domxref("MediaRecorder.stop()")}} - - : Stops recording, at which point a {{event("dataavailable")}} event containing the final `Blob` of saved data is fired. No more recording occurs. + - : Stops recording, at which point a {{domxref("MediaRecorder.dataavailable_event", "dataavailable")}} event containing the final `Blob` of saved data is fired. No more recording occurs. ## Static methods diff --git a/files/en-us/web/api/mediarecorder/requestdata/index.md b/files/en-us/web/api/mediarecorder/requestdata/index.md index 87f2750feba1e28..aaa39eb23bfb8da 100644 --- a/files/en-us/web/api/mediarecorder/requestdata/index.md +++ b/files/en-us/web/api/mediarecorder/requestdata/index.md @@ -29,7 +29,7 @@ runs the following steps: 1. If {{domxref("MediaRecorder.state")}} is "inactive", raise a DOM `InvalidState` error and terminate these steps. If {{domxref("MediaRecorder.state")}} is not "inactive", continue to the next step. -2. Raise a {{event("dataavailable")}} event containing a {{domxref("Blob")}} of the +2. Raise a {{domxref("MediaRecorder.dataavailable_event", "dataavailable")}} event containing a {{domxref("Blob")}} of the currently captured data (the Blob is available under the event's `data` attribute.) 3. Create a new Blob and place subsequently captured data into it. diff --git a/files/en-us/web/api/mediarecorder/start/index.md b/files/en-us/web/api/mediarecorder/start/index.md index ef0b2a613abeeef..381a320e60cab8c 100644 --- a/files/en-us/web/api/mediarecorder/start/index.md +++ b/files/en-us/web/api/mediarecorder/start/index.md @@ -36,12 +36,12 @@ is `inactive`, `start()` sets the `state` to `Blob` is created and the data is collected in it until the time slice period elapses or the source media ends. Each time a `Blob` is filled up to that point (the timeslice duration or the end-of-media, if no slice duration was provided), a -{{event("dataavailable")}} event is sent to the `MediaRecorder` with the +{{domxref("MediaRecorder.dataavailable_event", "dataavailable")}} event is sent to the `MediaRecorder` with the recorded data. If the source is still playing, a new `Blob` is created and recording continues into that, and so forth. When the source stream ends, `state` is set to `inactive` and -data gathering stops. A final {{event("dataavailable")}} event is sent to the +data gathering stops. A final {{domxref("MediaRecorder.dataavailable_event", "dataavailable")}} event is sent to the `MediaRecorder`, followed by a {{event("stop")}} event. > **Note:** If the browser is unable to start recording or continue diff --git a/files/en-us/web/api/mediarecordererrorevent/error/index.md b/files/en-us/web/api/mediarecordererrorevent/error/index.md index 2ca739825fc0d42..635bf6f9e6e659d 100644 --- a/files/en-us/web/api/mediarecordererrorevent/error/index.md +++ b/files/en-us/web/api/mediarecordererrorevent/error/index.md @@ -50,7 +50,7 @@ method references. - `UnknownError` - : A non-security related error occurred that cannot otherwise be categorized. Recording stops, the `MediaRecorder`'s {{domxref("MediaRecorder.state", - "state")}} becomes `inactive`, one last {{event("dataavailable")}} event is + "state")}} becomes `inactive`, one last {{domxref("MediaRecorder.dataavailable_event", "dataavailable")}} event is sent to the `MediaRecorder` with the remaining received data, and finally a {{event("stop")}} event is sent. diff --git a/files/en-us/web/api/mediastream_recording_api/index.md b/files/en-us/web/api/mediastream_recording_api/index.md index 775b9378f6263dd..5e5aa32ba4e5fbe 100644 --- a/files/en-us/web/api/mediastream_recording_api/index.md +++ b/files/en-us/web/api/mediastream_recording_api/index.md @@ -18,7 +18,7 @@ The **MediaStream Recording API**, sometimes referred to as the _Media Recording ## Basic concepts -The MediaStream Recording API is comprised of a single major interface, {{domxref("MediaRecorder")}}, which does all the work of taking the data from a {{domxref("MediaStream")}} and delivering it to you for processing. The data is delivered by a series of {{event("dataavailable")}} events, already in the format you specify when creating the `MediaRecorder`. You can then process the data further or write it to file as desired. +The MediaStream Recording API is comprised of a single major interface, {{domxref("MediaRecorder")}}, which does all the work of taking the data from a {{domxref("MediaStream")}} and delivering it to you for processing. The data is delivered by a series of {{domxref("MediaRecorder.dataavailable_event", "dataavailable")}} events, already in the format you specify when creating the `MediaRecorder`. You can then process the data further or write it to file as desired. ### Overview of the recording process @@ -26,9 +26,9 @@ The process of recording a stream is simple: 1. Set up a {{domxref("MediaStream")}} or {{domxref("HTMLMediaElement")}} (in the form of an {{HTMLElement("audio")}} or {{HTMLElement("video")}} element) to serve as the source of the media data. 2. Create a {{domxref("MediaRecorder")}} object, specifying the source stream and any desired options (such as the container's MIME type or the desired bit rates of its tracks). -3. Set {{domxref("MediaRecorder.dataavailable_event", "ondataavailable")}} to an event handler for the {{event("dataavailable")}} event; this will be called whenever data is available for you. +3. Set {{domxref("MediaRecorder.dataavailable_event", "ondataavailable")}} to an event handler for the {{domxref("MediaRecorder.dataavailable_event", "dataavailable")}} event; this will be called whenever data is available for you. 4. Once the source media is playing and you've reached the point where you're ready to record video, call {{domxref("MediaRecorder.start()")}} to begin recording. -5. Your {{event("dataavailable")}} event handler gets called every time there's data ready for you to do with as you will; the event has a `data` attribute whose value is a {{domxref("Blob")}} that contains the media data. You can force a `dataavailable` event to occur, thereby delivering the latest sound to you so you can filter it, save it, or whatever. +5. Your {{domxref("MediaRecorder.dataavailable_event", "dataavailable")}} event handler gets called every time there's data ready for you to do with as you will; the event has a `data` attribute whose value is a {{domxref("Blob")}} that contains the media data. You can force a `dataavailable` event to occur, thereby delivering the latest sound to you so you can filter it, save it, or whatever. 6. Recording stops automatically when the source media stops playing. 7. You can stop recording at any time by calling {{domxref("MediaRecorder.stop()")}}. diff --git a/files/en-us/web/api/mediastream_recording_api/recording_a_media_element/index.md b/files/en-us/web/api/mediastream_recording_api/recording_a_media_element/index.md index c17b6b67d925ca4..dda49b6043b2424 100644 --- a/files/en-us/web/api/mediastream_recording_api/recording_a_media_element/index.md +++ b/files/en-us/web/api/mediastream_recording_api/recording_a_media_element/index.md @@ -190,7 +190,7 @@ function startRecording(stream, lengthInMS) { - Line 3 - : Creates an empty array, `data`, which will be used to hold the {{domxref("Blob")}}s of media data provided to our {{domxref("MediaRecorder.dataavailable_event", "ondataavailable")}} event handler. - Line 5 - - : Sets up the handler for the {{event("dataavailable")}} event. The received event's `data` property is a {{domxref("Blob")}} that contains the media data. The event handler pushes the `Blob` onto the `data` array. + - : Sets up the handler for the {{domxref("MediaRecorder.dataavailable_event", "dataavailable")}} event. The received event's `data` property is a {{domxref("Blob")}} that contains the media data. The event handler pushes the `Blob` onto the `data` array. - Lines 6-7 - : Starts the recording process by calling {{domxref("MediaRecorder.start", "recorder.start()")}}, and outputs a message to the log with the updated state of the recorder and the number of seconds it will be recording. - Lines 9-12 diff --git a/files/en-us/web/api/mediastreamtrack/muted/index.md b/files/en-us/web/api/mediastreamtrack/muted/index.md index 5b6f561cc3b273b..e0b30b9d3316ed2 100644 --- a/files/en-us/web/api/mediastreamtrack/muted/index.md +++ b/files/en-us/web/api/mediastreamtrack/muted/index.md @@ -29,7 +29,7 @@ A {{jsxref('Boolean')}} which is `true` if the track is currently muted, or `false` if the track is currently unmuted. > **Note:** When possible, avoid polling `muted` to monitor the track's muting status. -> Instead, add event listeners for the {{event("mute")}} and {{event("unmute")}} events. +> Instead, add event listeners for the {{domxref("MediaStreamTrack.mute_event", "mute")}} and {{domxref("MediaStreamTrack.unmute_event", "unmute")}} events. ## Examples diff --git a/files/en-us/web/api/merchantvalidationevent/complete/index.md b/files/en-us/web/api/merchantvalidationevent/complete/index.md index b942929c9daade2..eb40b8b6da6d69f 100644 --- a/files/en-us/web/api/merchantvalidationevent/complete/index.md +++ b/files/en-us/web/api/merchantvalidationevent/complete/index.md @@ -19,7 +19,7 @@ browser-compat: api.MerchantValidationEvent.complete The {{domxref("MerchantValidationEvent")}} method **`complete()`** takes merchant-specific information previously received from the {{domxref("MerchantValidationEvent.validationURL", "validationURL")}} and uses it to validate the merchant. -All you have to do is call `complete()` from your handler for the {{event("merchantvalidation")}} event, passing in the data fetched from the `validationURL`. +All you have to do is call `complete()` from your handler for the {{domxref("PaymentRequest.merchantvalidation_event", "merchantvalidation")}} event, passing in the data fetched from the `validationURL`. ## Syntax @@ -59,7 +59,7 @@ function getValidationData(url) { } ``` -This code sets up a handler for the {{event("merchantvalidation")}} event. The event handler calls a function, `getValidationData()`, which retrieves the data from the validation URL, then passes that data (or a promise to deliver the data) into `complete()`. +This code sets up a handler for the {{domxref("PaymentRequest.merchantvalidation_event", "merchantvalidation")}} event. The event handler calls a function, `getValidationData()`, which retrieves the data from the validation URL, then passes that data (or a promise to deliver the data) into `complete()`. ## Browser compatibility diff --git a/files/en-us/web/api/merchantvalidationevent/index.md b/files/en-us/web/api/merchantvalidationevent/index.md index 6b59f872178899c..10913b153dc04fb 100644 --- a/files/en-us/web/api/merchantvalidationevent/index.md +++ b/files/en-us/web/api/merchantvalidationevent/index.md @@ -25,7 +25,7 @@ To learn more about merchant validation, see {{SectionOnPage("/en-US/docs/Web/AP ## Constructor - {{domxref("MerchantValidationEvent.MerchantValidationEvent()","MerchantValidationEvent()")}} {{securecontext_inline}} - - : Creates a new `MerchantValidationEvent` object describing a {{event("merchantvalidation")}} event that will be sent to the payment handler to request that it validate the merchant. + - : Creates a new `MerchantValidationEvent` object describing a {{domxref("PaymentRequest.merchantvalidation_event", "merchantvalidation")}} event that will be sent to the payment handler to request that it validate the merchant. ## Properties diff --git a/files/en-us/web/api/merchantvalidationevent/merchantvalidationevent/index.md b/files/en-us/web/api/merchantvalidationevent/merchantvalidationevent/index.md index d83366938721dc9..a64d6bdc32396d4 100644 --- a/files/en-us/web/api/merchantvalidationevent/merchantvalidationevent/index.md +++ b/files/en-us/web/api/merchantvalidationevent/merchantvalidationevent/index.md @@ -16,7 +16,7 @@ browser-compat: api.MerchantValidationEvent.MerchantValidationEvent --- {{deprecated_header}}{{non-standard_header}}{{securecontext_header}} -The **`MerchantValidationEvent()`** constructor creates a new {{domxref("MerchantValidationEvent")}} object. You should not have to create these events yourself; instead, just handle the {{event("merchantvalidation")}} event. +The **`MerchantValidationEvent()`** constructor creates a new {{domxref("MerchantValidationEvent")}} object. You should not have to create these events yourself; instead, just handle the {{domxref("PaymentRequest.merchantvalidation_event", "merchantvalidation")}} event. ## Syntax diff --git a/files/en-us/web/api/navigator/sendbeacon/index.md b/files/en-us/web/api/navigator/sendbeacon/index.md index dd3572546bc884f..a6fdcc35baf232e 100644 --- a/files/en-us/web/api/navigator/sendbeacon/index.md +++ b/files/en-us/web/api/navigator/sendbeacon/index.md @@ -113,7 +113,7 @@ Like `beforeunload` and `unload`, this event is not reliably fired, especially o ## Examples -The following example specifies a handler for the {{event("visibilitychange")}} event. The handler calls `sendBeacon()` to send analytics. +The following example specifies a handler for the {{domxref("document.visibilitychange_event", "visibilitychange")}} event. The handler calls `sendBeacon()` to send analytics. ```js document.addEventListener('visibilitychange', function logData() { diff --git a/files/en-us/web/api/page_visibility_api/index.md b/files/en-us/web/api/page_visibility_api/index.md index 78c5a13aade6428..4582cf381796c0d 100644 --- a/files/en-us/web/api/page_visibility_api/index.md +++ b/files/en-us/web/api/page_visibility_api/index.md @@ -21,7 +21,7 @@ The Page Visibility API provides events you can watch for to know when a documen > **Note:** The Page Visibility API is especially useful for saving resources and improving performance by letting a page avoid performing unnecessary tasks when the document isn't visible. -When the user minimizes the window or switches to another tab, the API sends a {{event("visibilitychange")}} event to let listeners know the state of the page has changed. You can detect the event and perform some actions or behave differently. For example, if your web app is playing a video, it can pause the video when the user puts the tab into the background, and resume playback when the user returns to the tab. The user doesn't lose their place in the video, the video's soundtrack doesn't interfere with audio in the new foreground tab, and the user doesn't miss any of the video in the meantime. +When the user minimizes the window or switches to another tab, the API sends a {{domxref("document.visibilitychange_event", "visibilitychange")}} event to let listeners know the state of the page has changed. You can detect the event and perform some actions or behave differently. For example, if your web app is playing a video, it can pause the video when the user puts the tab into the background, and resume playback when the user returns to the tab. The user doesn't lose their place in the video, the video's soundtrack doesn't interfere with audio in the new foreground tab, and the user doesn't miss any of the video in the meantime. Visibility states of an {{HTMLElement("iframe")}} are the same as the parent document. Hiding an `