recursal/MDN huggingface dataset:
TaskPriorityChangeEvent
=======================

Limited availability
--------------------

This feature is not Baseline because it does not work in some of the most widely-used browsers.

* Learn more
* See full compatibility
* Report feedback
The **`TaskPriorityChangeEvent`** is the interface for the `prioritychange` event.

Event

TaskPriorityChangeEventConstructor
-----------

`TaskPriorityChangeEvent()`

Creates a new `TaskPriorityChangeEvent` object, setting an event name and previous priority.

Instance properties
-------------------

*This interface also inherits the properties of its parent, `Event`.*

`TaskPriorityChangeEvent.previousPriority` Read only 

Returns the priority of the corresponding `TaskSignal` *before* this `prioritychange` event.

Instance methods
----------------

*This interface has no methods of its own, but inherits the methods of its parent, `Event`.*

Examples
--------

 An object of this type is returned in the handler for a `prioritychange` event.
 The code below shows a handler in which the `newPriority` and `previousPriority` are logged.


```js
// Listen for 'prioritychange' events on the controller's signal.
controller.signal.addEventListener("prioritychange", (event) => {
  const previousPriority = event.previousPriority;
  const newPriority = event.target.priority;
  console.log(`Priority changed from ${previousPriority} to ${newPriority}.`);
});
```


A more complete live example can be found in `prioritychange` event > Examples.

Specifications
--------------

| Specification |
| --- |
| Prioritized Task Scheduling # sec-task-priority-change-event |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `prioritychange` event
AudioParamDescriptor
====================

The **`AudioParamDescriptor`** dictionary of the Web Audio API specifies properties for `AudioParam` objects.

It is used to create custom `AudioParam`s on an `AudioWorkletNode`. If the underlying `AudioWorkletProcessor` has a `parameterDescriptors` static getter, then the returned array of objects based on this dictionary is used internally by `AudioWorkletNode` constructor to populate its `parameters` property accordingly.

Instance properties
-------------------

`name`

The string which represents the name of the `AudioParam`. Under this name the `AudioParam` will be available in the `parameters` property of the node, and under this name the `AudioWorkletProcessor.process` method will acquire the calculated values of this `AudioParam`.

`automationRate` Optional

Either `"a-rate"`, or `"k-rate"` string which represents an automation rate of this `AudioParam`. Defaults to `"a-rate"`.

`minValue` Optional

A `float` which represents minimum value of the `AudioParam`. Defaults to `-3.4028235e38`.

`maxValue` Optional

A `float` which represents maximum value of the `AudioParam`. Defaults to `3.4028235e38`.

`defaultValue` Optional

A `float` which represents initial value of the `AudioParam`. Defaults to `0`.

Examples
--------

The code fragment below shows a descriptor of this type being returned by a static `parameterDescriptors` method defined in a custom `AudioWorkletProcessor` (this is part of the more complete example in AudioWorkletNode.parameters).


```js
// white-noise-processor.js
class WhiteNoiseProcessor extends AudioWorkletProcessor {
  static get parameterDescriptors() {
    return [
      {
        name: "customGain",
        defaultValue: 1,
        minValue: 0,
        maxValue: 1,
        automationRate: "a-rate",
      },
    ];
  }

  // …
}
```

Specifications
--------------

#### No specification found

No specification data found for `api.AudioParamDescriptor`.  
Check for problems with this page or contribute a missing `spec_url` to mdn/browser-compat-data. Also make sure the specification is included in w3c/browser-specs.

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Web Audio API
* Using the Web Audio API
Remote Playback API
===================

The Remote Playback API extends the `HTMLMediaElement` to enable the control of media played on a remote device.

Concepts and Usage
------------------

Remote playback devices are connected devices such as TVs, projectors, or speakers. The API takes into account wired devices connected via HDMI or DVI, and wireless devices, for example Chromecast or AirPlay.

The API enables a page, which has an media element such as a video or audio file, to initiate and control playback of that media on a connected remote device. For example, playing a video on a connected TV.

**Note:** Safari for iOS has some APIs which enable remote playback on AirPlay. Details of these can be found in the Safari 9.0 release notes.

Android versions of Firefox and Chrome also contain some remote playback features. These devices will show a Cast button if there is a Cast device available in the local network.

Interfaces
----------

`RemotePlayback`

Allows the page to detect availability of remote playback devices, then connect to and control playing on these devices.

### Extensions to other interfaces

`HTMLMediaElement.disableRemotePlayback`

A boolean that sets or returns the remote playback state, indicating whether the media element is allowed to have a remote playback UI.

`HTMLMediaElement.remote` Read only 

Return a `RemotePlayback` object instance associated with the media element.

Examples
--------

The following example demonstrates a player with custom controls that supports remote playback. Initially the button used to select a device is hidden.


```html
<video id="videoElement" src="https://example.org/media.ext">
  <button id="deviceBtn" style="display: none;">Pick device</button>
</video>
```


The `RemotePlayback.watchAvailability()` method watches for available remote playback devices. If a device is available, use the callback to show the button.


```js
const deviceBtn = document.getElementById("deviceBtn");
const videoElem = document.getElementById("videoElement");

function availabilityCallback(available) {
  // Show or hide the device picker button depending on device availability.
  deviceBtn.style.display = available ? "inline" : "none";
}

videoElem.remote.watchAvailability(availabilityCallback).catch(() => {
  /\* If the device cannot continuously watch available,
 show the button to allow the user to try to prompt for a connection.\*/
  deviceBtn.style.display = "inline";
});
```

Specifications
--------------

| Specification |
| --- |
| Remote Playback API  |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
SpeechRecognitionEvent
======================

The **`SpeechRecognitionEvent`** interface of the Web Speech API represents the event object for the `result` and `nomatch` events, and contains all the data associated with an interim or final speech recognition result.

Event

SpeechRecognitionEventInstance properties
-------------------

*`SpeechRecognitionEvent` also inherits properties from its parent interface, `Event`.*

`SpeechRecognitionEvent.emma` Read only  
Deprecated

Non-standard

Returns an Extensible MultiModal Annotation markup language (EMMA) — XML — representation of the result.

`SpeechRecognitionEvent.interpretation` Read only  
Deprecated

Non-standard

Returns the semantic meaning of what the user said.

`SpeechRecognitionEvent.resultIndex` Read only 

Returns the lowest index value result in the `SpeechRecognitionResultList` "array" that has actually changed.

`SpeechRecognitionEvent.results` Read only 

Returns a `SpeechRecognitionResultList` object representing all the speech recognition results for the current session.

Examples
--------

This code is excerpted from our Speech color changer example.


```js
recognition.onresult = (event) => {
  // The SpeechRecognitionEvent results property returns a SpeechRecognitionResultList object
  // The SpeechRecognitionResultList object contains SpeechRecognitionResult objects.
  // It has a getter so it can be accessed like an array
  // The first [0] returns the SpeechRecognitionResult at position 0.
  // Each SpeechRecognitionResult object contains SpeechRecognitionAlternative objects that contain
  // individual results.
  // These also have getters so they can be accessed like arrays.
  // The second [0] returns the SpeechRecognitionAlternative at position 0.
  // We then return the transcript property of the SpeechRecognitionAlternative object
  const color = event.results[0][0].transcript;
  diagnostic.textContent = `Result received: ${color}.`;
  bg.style.backgroundColor = color;
};
```

Specifications
--------------

| Specification |
| --- |
| Web Speech API # speechreco-event |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Web Speech API
CountQueuingStrategy
====================

The **`CountQueuingStrategy`** interface of the Streams API provides a built-in chunk counting queuing strategy that can be used when constructing streams.

Constructor
-----------

`CountQueuingStrategy()`

Creates a new `CountQueuingStrategy` object instance.

Instance properties
-------------------

`CountQueuingStrategy.highWaterMark` Read only 

The total number of chunks that can be contained in the internal queue before backpressure is applied.

Instance methods
----------------

`CountQueuingStrategy.size()`

Always returns `1`.

Examples
--------


```js
const queueingStrategy = new CountQueuingStrategy({ highWaterMark: 1 });

const writableStream = new WritableStream(
  {
    // Implement the sink
    write(chunk) {
      // …
    },
    close() {
      // …
    },
    abort(err) {
      console.log("Sink error:", err);
    },
  },
  queueingStrategy,
);

const size = queueingStrategy.size();
```

Specifications
--------------

| Specification |
| --- |
| Streams Standard # cqs-class |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Streams API
* `CountQueuingStrategy()` constructor
* Internal queues and queuing strategies
SVGTextElement
==============

The **`SVGTextElement`** interface corresponds to the `<text>` elements.

EventTarget

Node

Element

SVGElement

SVGGraphicsElement

SVGTextContentElement

SVGTextPositioningElement

SVGTextElementInstance properties
-------------------

*This interface doesn't implement any specific properties, but inherits properties from its parent interface, `SVGTextPositioningElement`.*

Instance methods
----------------

*This interface doesn't implement any specific methods, but inherits methods from its parent interface, `SVGTextPositioningElement`.*

Specifications
--------------

| Specification |
| --- |
| Scalable Vector Graphics (SVG) 2 # InterfaceSVGTextElement |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `<text>`
RTCRtpTransceiver
=================

The WebRTC interface **`RTCRtpTransceiver`** describes a permanent pairing of an `RTCRtpSender` and an `RTCRtpReceiver`, along with some shared state.

 Each SDP media section describes one bidirectional SRTP ("Secure Real Time Protocol") stream (excepting the media section for `RTCDataChannel`, if present).
 This pairing of send and receive SRTP streams is significant for some applications, so `RTCRtpTransceiver` is used to represent this pairing, along with other important state from the media section.
 Each non-disabled SRTP media section is always represented by exactly one transceiver.

A transceiver is uniquely identified using its `mid` property, which is the same as the media ID (`mid`) of its corresponding m-line. An `RTCRtpTransceiver` is **associated** with an m-line if its `mid` is non-null; otherwise it's considered disassociated.

Instance properties
-------------------

`currentDirection` Read only 

 A read-only string which indicates the transceiver's current negotiated directionality, or `null` if the transceiver has never participated in an exchange of offers and answers.
 To change the transceiver's directionality, set the value of the `direction` property.


`direction`

A string which is used to set the transceiver's desired direction.

`mid` Read only 

The media ID of the m-line associated with this transceiver. This association is established, when possible, whenever either a local or remote description is applied. This field is `null` if neither a local or remote description has been applied, or if its associated m-line is rejected by either a remote offer or any answer.

`receiver` Read only 

The `RTCRtpReceiver` object that handles receiving and decoding incoming media.

`sender` Read only 

The `RTCRtpSender` object responsible for encoding and sending data to the remote peer.

`stopped` 
Deprecated

Indicates whether or not sending and receiving using the paired `RTCRtpSender` and `RTCRtpReceiver` has been permanently disabled, either due to SDP offer/answer, or due to a call to `stop()`.

Instance methods
----------------

`setCodecPreferences()`

A list of `RTCRtpCodecParameters` objects which override the default preferences used by the user agent for the transceiver's codecs.

`stop()`

 Permanently stops the `RTCRtpTransceiver`.
 The associated sender stops sending data, and the associated receiver likewise stops receiving and decoding incoming data.


Specifications
--------------

| Specification |
| --- |
| WebRTC: Real-Time Communication in Browsers # rtcrtptransceiver-interface |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* WebRTC API
* Introduction to the Real-time Transport Protocol (RTP)
* `RTCPeerConnection.addTrack()` and `RTCPeerConnection.addTransceiver()` both create transceivers
* `RTCRtpReceiver` and `RTCRtpSender`
AbsoluteOrientationSensor
=========================

The **`AbsoluteOrientationSensor`** interface of the Sensor APIs describes the device's physical orientation in relation to the Earth's reference coordinate system.

To use this sensor, the user must grant permission to the `'accelerometer'`, `'gyroscope'`, and `'magnetometer'` device sensors through the Permissions API.

This feature may be blocked by a Permissions Policy set on your server.

EventTarget

Sensor

OrientationSensor

AbsoluteOrientationSensorConstructor
-----------

`AbsoluteOrientationSensor()`

Creates a new `AbsoluteOrientationSensor` object.

Instance properties
-------------------

*No specific properties; inherits properties from its ancestors `OrientationSensor` and `Sensor`.*

Instance methods
----------------

*No specific methods; inherits methods from its ancestors `OrientationSensor` and `Sensor`.*

Events
------

*No specific events; inherits methods from its ancestor, `Sensor`.*

Examples
--------

### Basic Example

The following example, which is loosely based on Intel's Orientation Phone demo, instantiates an `AbsoluteOrientationSensor` with a frequency of 60 times a second. On each reading it uses `OrientationSensor.quaternion` to rotate a visual model of a phone.


```js
const options = { frequency: 60, referenceFrame: "device" };
const sensor = new AbsoluteOrientationSensor(options);

sensor.addEventListener("reading", () => {
  // model is a Three.js object instantiated elsewhere.
  model.quaternion.fromArray(sensor.quaternion).inverse();
});
sensor.addEventListener("error", (error) => {
  if (event.error.name === "NotReadableError") {
    console.log("Sensor is not available.");
  }
});
sensor.start();
```

### Permissions Example

Using orientation sensors requires requesting permissions for multiple device sensors. Because the `Permissions` interface uses promises, a good way to request permissions is to use `Promise.all`.


```js
const sensor = new AbsoluteOrientationSensor();
Promise.all([
  navigator.permissions.query({ name: "accelerometer" }),
  navigator.permissions.query({ name: "magnetometer" }),
  navigator.permissions.query({ name: "gyroscope" }),
]).then((results) => {
  if (results.every((result) => result.state === "granted")) {
    sensor.start();
    // …
  } else {
    console.log("No permissions to use AbsoluteOrientationSensor.");
  }
});
```

Specifications
--------------

| Specification |
| --- |
| Orientation Sensor # absoluteorientationsensor-interface |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
AnimationTimeline
=================

Baseline 2022
-------------

Newly availableSince September 2022, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

* Learn more
* See full compatibility
* Report feedback
The `AnimationTimeline` interface of the Web Animations API represents the timeline of an animation. This interface exists to define timeline features, inherited by other timeline types:

* `DocumentTimeline`
* `ScrollTimeline`
* `ViewTimeline`
Instance properties
-------------------

`currentTime` Read only 

Returns the time value in milliseconds for this timeline or `null` if this timeline is inactive.

Specifications
--------------

| Specification |
| --- |
| Web Animations # the-animationtimeline-interface |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `DocumentTimeline`, `ScrollTimeline`, `ViewTimeline`
* `Document.timeline`
* Web Animations API
* CSS scroll-driven animations
GeolocationPosition
===================

**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The **`GeolocationPosition`** interface represents the position of the concerned device at a given time. The position, represented by a `GeolocationCoordinates` object, comprehends the 2D position of the device, on a spheroid representing the Earth, but also its altitude and its speed.

Instance properties
-------------------

*The `GeolocationPosition` interface doesn't inherit any properties.*

`GeolocationPosition.coords` Read only 

Returns a `GeolocationCoordinates` object defining the current location.

`GeolocationPosition.timestamp` Read only 

Returns a timestamp, given as Unix time in milliseconds, representing the time at which the location was retrieved.

Instance methods
----------------

*The `GeolocationPosition` interface neither implements, nor inherits any methods.*

Specifications
--------------

| Specification |
| --- |
| Geolocation API # position\_interface |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Using the Geolocation API
* `Geolocation`
DOMRect
=======

A **`DOMRect`** describes the size and position of a rectangle.

The type of box represented by the `DOMRect` is specified by the method or property that returned it. For example, `Range.getBoundingClientRect()` specifies the rectangle that bounds the content of the range using such objects.

It inherits from its parent, `DOMRectReadOnly`.

DOMRectReadOnly

DOMRectConstructor
-----------

`DOMRect()`

Creates a new `DOMRect` object.

Instance properties
-------------------

*`DOMRect` inherits properties from its parent, `DOMRectReadOnly`. The difference is that they are not read-only anymore.*

`DOMRectReadOnly.x`

The x coordinate of the `DOMRect`'s origin (typically the top-left corner of the rectangle).

`DOMRectReadOnly.y`

The y coordinate of the `DOMRect`'s origin (typically the top-left corner of the rectangle).

`DOMRectReadOnly.width`

The width of the `DOMRect`.

`DOMRectReadOnly.height`

The height of the `DOMRect`.

`DOMRectReadOnly.top`

Returns the top coordinate value of the `DOMRect` (has the same value as `y`, or `y + height` if `height` is negative).

`DOMRectReadOnly.right`

Returns the right coordinate value of the `DOMRect` (has the same value as `x + width`, or `x` if `width` is negative).

`DOMRectReadOnly.bottom`

Returns the bottom coordinate value of the `DOMRect` (has the same value as `y + height`, or `y` if `height` is negative).

`DOMRectReadOnly.left`

Returns the left coordinate value of the `DOMRect` (has the same value as `x`, or `x + width` if `width` is negative).

Static methods
--------------

*`DOMRect` may also inherit static methods from its parent, `DOMRectReadOnly`.*

`DOMRect.fromRect()`

Creates a new `DOMRect` object with a given location and dimensions.

Instance methods
----------------

*`DOMRect` may inherit methods from its parent, `DOMRectReadOnly`.*

Specifications
--------------

| Specification |
| --- |
| Geometry Interfaces Module Level 1 # DOMRect |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `DOMPoint`
WebSocket
=========

The `WebSocket` object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.

To construct a `WebSocket`, use the `WebSocket()` constructor.

**Note:** This feature is available in Web Workers

EventTarget

WebSocketConstructor
-----------

`WebSocket()`

Returns a newly created `WebSocket` object.

Instance properties
-------------------

`WebSocket.binaryType`

The binary data type used by the connection.

`WebSocket.bufferedAmount` Read only 

The number of bytes of queued data.

`WebSocket.extensions` Read only 

The extensions selected by the server.

`WebSocket.protocol` Read only 

The sub-protocol selected by the server.

`WebSocket.readyState` Read only 

The current state of the connection.

`WebSocket.url` Read only 

The absolute URL of the WebSocket.

Instance methods
----------------

`WebSocket.close()`

Closes the connection.

`WebSocket.send()`

Enqueues data to be transmitted.

Events
------

Listen to these events using `addEventListener()` or by assigning an event listener to the `oneventname` property of this interface.

`close`

 Fired when a connection with a `WebSocket` is closed.
 Also available via the `onclose` property


`error`

 Fired when a connection with a `WebSocket` has been closed because of an error, such as when some data couldn't be sent.
 Also available via the `onerror` property.


`message`

 Fired when data is received through a `WebSocket`.
 Also available via the `onmessage` property.


`open`

 Fired when a connection with a `WebSocket` is opened.
 Also available via the `onopen` property.


Examples
--------


```js
// Create WebSocket connection.
const socket = new WebSocket("ws://localhost:8080");

// Connection opened
socket.addEventListener("open", (event) => {
  socket.send("Hello Server!");
});

// Listen for messages
socket.addEventListener("message", (event) => {
  console.log("Message from server ", event.data);
});
```

Specifications
--------------

| Specification |
| --- |
| WebSockets Standard # the-websocket-interface |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Writing WebSocket client applications