recursal/MDN huggingface dataset:
PaymentRequest
==============

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

The Payment Request API's **`PaymentRequest`** interface is the primary access point into the API, and lets web content and apps accept payments from the end user on behalf of the operator of the site or the publisher of the app.

EventTarget

PaymentRequestConstructor
-----------

`PaymentRequest()`

Creates a new `PaymentRequest` object.

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

`PaymentRequest.id` Read only 

A unique identifier for a particular `PaymentRequest`, which can be set via `details.id`. When none is set, it defaults to a UUID.

`PaymentRequest.shippingAddress` Read only  
Deprecated

Non-standard

If requested via payment options, returns the shipping address chosen by the user for the purposes of calculating shipping. This property is only populated if the constructor is called with the `requestShipping` flag set to true. Additionally, in some browsers, the parts of the address will be redacted for privacy until the user indicates they are ready to complete the transaction (i.e., they hit "Pay").

`PaymentRequest.shippingOption` Read only  
Deprecated

Non-standard

Returns the identifier of the selected shipping option. This property is only populated if the constructor is called with the `requestShipping` flag set to true.

`PaymentRequest.shippingType` Read only  
Deprecated

Non-standard

Returns the type of shipping used to fulfill the transaction. This will be one of `shipping`, `delivery`, `pickup`, or `null` if a value was not provided in the constructor.

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

`PaymentRequest.canMakePayment()`

Indicates whether the `PaymentRequest` object can make a payment before calling `show()`.

`PaymentRequest.show()`

Causes the user agent to begin the user interaction for the payment request.

`PaymentRequest.abort()`

Causes the user agent to end the payment request and to remove any user interface that might be shown.

Events
------

`merchantvalidation` 
Deprecated

With some payment handlers (e.g., Apple Pay), this event handler is called to handle the `merchantvalidation` event, which is dispatched when the user agent requires that the merchant validate that the merchant or vendor requesting payment is legitimate.

`paymentmethodchange`

With some payment handlers (e.g., Apple Pay), dispatched whenever the user changes payment instrument, like switching from a credit card to a debit card.

`shippingaddresschange`
Deprecated

Non-standard

Dispatched whenever the user changes their shipping address.

`shippingoptionchange` 
Deprecated

Non-standard

Dispatched whenever the user changes a shipping option.

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

| Specification |
| --- |
| Payment Request API 1.1 # paymentrequest-interface |

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

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

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

The **`PerformanceObserver`** interface is used to observe performance measurement events and be notified of new performance entries as they are recorded in the browser's *performance timeline*.

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

`PerformanceObserver()`

Creates and returns a new `PerformanceObserver` object.

Static properties
-----------------

`PerformanceObserver.supportedEntryTypes` Read only 

Returns an array of the `entryType` values supported by the user agent.

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

`PerformanceObserver.observe()`

Specifies the set of entry types to observe. The performance observer's callback function will be invoked when performance entry is recorded for one of the specified `entryTypes`.

`PerformanceObserver.disconnect()`

Stops the performance observer callback from receiving performance entries.

`PerformanceObserver.takeRecords()`

Returns the current list of performance entries stored in the performance observer, emptying it out.

Examples
--------

### Creating a PerformanceObserver

 The following example creates a `PerformanceObserver` watching for "mark" (`PerformanceMark`) and "measure" (`PerformanceMeasure`) events.
 The `perfObserver` callback provides a `list` (`PerformanceObserverEntryList`) which allows you to get observed performance entries.


```js
function perfObserver(list, observer) {
  list.getEntries().forEach((entry) => {
    if (entry.entryType === "mark") {
      console.log(`${entry.name}'s startTime: ${entry.startTime}`);
    }
    if (entry.entryType === "measure") {
      console.log(`${entry.name}'s duration: ${entry.duration}`);
    }
  });
}
const observer = new PerformanceObserver(perfObserver);
observer.observe({ entryTypes: ["measure", "mark"] });
```

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

| Specification |
| --- |
| Performance Timeline # dom-performanceobserver |

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

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

See also
--------

* `MutationObserver`
* `ResizeObserver`
* `IntersectionObserver`
WEBGL\_depth\_texture extension
===============================

The **`WEBGL_depth_texture`** extension is part of the WebGL API and defines 2D depth and depth-stencil textures.

WebGL extensions are available using the `WebGLRenderingContext.getExtension()` method. For more information, see also Using Extensions in the WebGL tutorial.

**Note:** This extension is only available to WebGL1 contexts. In WebGL2, the functionality of this extension is available on the WebGL2 context by default. The constant in WebGL2 is `gl.UNSIGNED_INT_24_8`.

Constants
---------

This extension adds a new constant:

`ext.UNSIGNED_INT_24_8_WEBGL`

Unsigned integer type for 24-bit depth texture data.

Extended methods
----------------

This extension extends `WebGLRenderingContext.texImage2D()`:

* The `format` and `internalformat` parameters now accept `gl.DEPTH_COMPONENT` and `gl.DEPTH_STENCIL`.
* The `type` parameter now accepts `gl.UNSIGNED_SHORT`, `gl.UNSIGNED_INT`, and `ext.UNSIGNED_INT_24_8_WEBGL`.
* The `pixels` parameter now accepts a `Uint16Array` or a `Uint32Array` object.

This extension extends `WebGLRenderingContext.framebufferTexture2D()`:

* The `attachment` parameter now accepts `gl.DEPTH_STENCIL_ATTACHMENT`.

**Note:** Incorrectly stated as the `target` parameter in the specification, see https://www.khronos.org/bugzilla/show\_bug.cgi?id=674.

Examples
--------


```js
const ext = gl.getExtension("WEBGL\_depth\_texture");

gl.texImage2D(
  gl.TEXTURE\_2D,
  0,
  gl.DEPTH\_COMPONENT,
  512,
  512,
  0,
  gl.DEPTH\_COMPONENT,
  gl.UNSIGNED\_SHORT,
  null,
);
```

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

| Specification |
| --- |
| WebGL WEBGL\_depth\_texture Khronos Ratified Extension Specification  |

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

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

See also
--------

* `WebGLRenderingContext.getExtension()`
* `WebGLRenderingContext.texImage2D()`
* `WebGLRenderingContext.framebufferTexture2D()`
FormDataEvent
=============

The **`FormDataEvent`** interface represents a `formdata` event — such an event is fired on an `HTMLFormElement` object after the entry list representing the form's data is constructed. This happens when the form is submitted, but can also be triggered by the invocation of a `FormData()` constructor.

This allows a `FormData` object to be quickly obtained in response to a `formdata` event firing, rather than needing to put it together yourself when you wish to submit form data via a method like `fetch()` (see Using FormData objects).

Event

FormDataEventConstructor
-----------

`FormDataEvent()`

Creates a new `FormDataEvent` object instance.

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

*Inherits properties from its parent interface, `Event`.*

`FormDataEvent.formData`

Contains the `FormData` object representing the data contained in the form when the event was fired.

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

*Inherits methods from its parent interface, `Event`.*

Examples
--------


```js
// grab reference to form

const formElem = document.querySelector("form");

// submit handler

formElem.addEventListener("submit", (e) => {
  // on form submission, prevent default
  e.preventDefault();

  console.log(form.querySelector('input[name="field1"]')); // FOO
  console.log(form.querySelector('input[name="field2"]')); // BAR

  // construct a FormData object, which fires the formdata event
  const formData = new FormData(formElem);
  // formdata gets modified by the formdata event
  console.log(formData.get("field1")); // foo
  console.log(formData.get("field2")); // bar
});

// formdata handler to retrieve data

formElem.addEventListener("formdata", (e) => {
  console.log("formdata fired");

  // modifies the form data
  const formData = e.formData;
  formData.set("field1", formData.get("field1").toLowerCase());
  formData.set("field2", formData.get("field2").toLowerCase());
});
```

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

| Specification |
| --- |
| HTML Standard # the-formdataevent-interface |

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

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

See also
--------

* `fetch()`
* `FormData`
* Using FormData objects
* `<form>`
MIDIOutput
==========

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

The **`MIDIOutput`** interface of the Web MIDI API provides methods to add messages to the queue of an output device, and to clear the queue of messages.

EventTarget

MIDIPort

MIDIOutputInstance properties
-------------------

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

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

*This interface also inherits methods from `MIDIPort`.*

`MIDIoutput.send()`

Queues a message to be sent to the MIDI port.

`MIDIOutput.clear()`

Clears any pending send data from the queue.

Examples
--------

The following example sends a middle C immediately on MIDI channel 1.


```js
function sendMiddleC(midiAccess, portID) {
  const noteOnMessage = [0x90, 60, 0x7f]; // note on, middle C, full velocity
  const output = midiAccess.outputs.get(portID);
  output.send(noteOnMessage); // sends the message.
}
```

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

| Specification |
| --- |
| Web MIDI API # MIDIOutput |

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

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

The **`RTCPeerConnectionIceErrorEvent`** interface—based upon the `Event` interface—provides details pertaining to an ICE error announced by sending an `icecandidateerror` event to the `RTCPeerConnection` object.

Event

RTCPeerConnectionIceErrorEventConstructor
-----------

`RTCPeerConnectionIceErrorEvent()`

Creates and returns a new `RTCPeerConnectionIceErrorEvent` object, with its `type` and other properties initialized as specified in the parameters. You will not normally create an object of this type yourself.

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

*The `RTCPeerConnectionIceErrorEvent` interface includes the properties found on the `Event` interface, as well as the following properties:*

`address` Read only 

A string providing the local IP address used to communicate with the STUN or TURN server being used to negotiate the connection, or `null` if the local IP address has not yet been exposed as part of a local ICE candidate.

`errorCode` Read only 

An unsigned integer value stating the numeric STUN error code returned by the STUN or TURN server. If no host candidate can reach the server, this property is set to the number 701, which is outside the range of valid STUN error codes. The 701 error is fired only once per server URL, and only while the `icegatheringstate` is `gathering`.

`errorText` Read only 

A string containing the STUN reason text returned by the STUN or TURN server. If communication with the STUN or TURN server couldn't be established at all, this string will be a browser-specific string explaining the error.

`port` Read only 

An unsigned integer value giving the port number over which communication with the STUN or TURN server is taking place, using the IP address given in `address`. `null` if the connection hasn't been established (that is, if `address` is `null`).

`url` Read only 

A string indicating the URL of the STUN or TURN server with which the error occurred.

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

*`RTCPeerConnectionIceErrorEvent` has no methods other than any provided by the parent interface, `Event`.*

Examples
--------

TBD

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

| Specification |
| --- |
| WebRTC: Real-Time Communication in Browsers # rtcpeerconnectioniceerrorevent |

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

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

The **`AudioParamMap`** interface of the Web Audio API represents an iterable and read-only set of multiple audio parameters.

An `AudioParamMap` instance is a read-only `Map`-like object, in which each key is the name string for a parameter, and the corresponding value is an `AudioParam` containing the value of that parameter.

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

`size`

?

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

`entries()`

?

`forEach()`

?

`has()`

?

`keys()`

?

`values()`

?

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

| Specification |
| --- |
| Web Audio API # audioparammap |

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

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

The **`MediaKeyStatusMap`** interface of the Encrypted Media Extensions API is a read-only map of media key statuses by key IDs.

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

`MediaKeyStatusMap.size` Read only 

Returns the number of key/value pairs in the status map.

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

`MediaKeyStatusMap.entries()` Read only 

Returns a new `Iterator` object containing an array of `[key, value]` for each element in the status map, in insertion order.

`MediaKeyStatusMap.forEach(callback[, argument])` Read only 

Calls `callback` once for each key-value pair in the status map, in insertion order. If `argument` is present it will be passed to the callback.

`MediaKeyStatusMap.get()` Read only 

Returns the value associated with the given key, or `undefined` if there is none.

`MediaKeyStatusMap.has()` Read only 

Returns a boolean asserting whether a value has been associated with the given key.

`MediaKeyStatusMap.keys()` Read only 

Returns a new `Iterator` object containing keys for each element in the status map, in insertion order.

`MediaKeyStatusMap.values()` Read only 

Returns a new `Iterator` object containing values for each element in the status map, in insertion order.

`MediaKeyStatusMap.[@@iterator]()` Read only 

Returns a new `Iterator` object containing an array of `[key, value]` for each element in the status map, in insertion order.

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

| Specification |
| --- |
| Encrypted Media Extensions # mediakeystatusmap-interface |

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

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

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

**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

The **`NDEFReadingEvent`** interface of the Web NFC API represents events dispatched on new NFC readings obtained by `NDEFReader`.

Event

NDEFReadingEventConstructor
-----------

`NDEFReadingEvent.NDEFReadingEvent()` 
Experimental

Creates a new `NDEFReadingEvent`.

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

*Inherits properties from its parent, `Event`*.

`NDEFReadingEvent.message` Read only  
Experimental

Returns an `NDEFMessage` object containing the received message.

`NDEFReadingEvent.serialNumber` Read only  
Experimental

Returns the serial number of the device, which is used for anti-collision and identification, or an empty string if no serial number is available.

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

*Inherits methods from its parent, `Event`*.

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

| Specification |
| --- |
| Web NFC API # dom-ndefreadingevent |

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

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

The `MediaStreamAudioDestinationNode` interface represents an audio destination consisting of a WebRTC `MediaStream` with a single `AudioMediaStreamTrack`, which can be used in a similar way to a `MediaStream` obtained from `navigator.mediaDevices.getUserMedia()`.

It is an `AudioNode` that acts as an audio destination, created using the `AudioContext.createMediaStreamDestination()` method.

EventTarget

AudioNode

MediaStreamAudioDestinationNode

|  |  |
| --- | --- |
| Number of inputs | `1` |
| Number of outputs | `0` |
| Channel count | `2` |
| Channel count mode | `"explicit"` |
| Channel count interpretation | `"speakers"` |

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

`MediaStreamAudioDestinationNode()`

Creates a new `MediaStreamAudioDestinationNode` object instance.

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

*Inherits properties from its parent, `AudioNode`*.

`MediaStreamAudioDestinationNode.stream`

A `MediaStream` containing a single `MediaStreamTrack` whose `kind` is `audio` and with the same number of channels as the node. You can use this property to get a stream out of the audio graph and feed it into another construct, such as a Media Recorder.

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

*Inherits methods from its parent, `AudioNode`*.

Example
-------

See `AudioContext.createMediaStreamDestination()` for example code that creates a `MediaStreamAudioDestinationNode` and uses it as a source for audio to be recorded.

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

| Specification |
| --- |
| Web Audio API # MediaStreamAudioDestinationNode |

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

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

See also
--------

* Using the Web Audio API
HTMLTemplateElement
===================

The **`HTMLTemplateElement`** interface enables access to the contents of an HTML `<template>` element.

EventTarget

Node

Element

HTMLElement

HTMLTemplateElementInstance properties
-------------------

*This interface inherits the properties of `HTMLElement`.*

`content` Read only 

A read-only `DocumentFragment` which contains the DOM subtree representing the `<template>` element's template contents.

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

*This interface inherits the methods of `HTMLElement`.*

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

| Specification |
| --- |
| HTML Standard # htmltemplateelement |

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

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

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

**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

The **`PresentationReceiver`** interface of the Presentation API provides a means for a receiving browsing context to access controlling browsing contexts and communicate with them.

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

`PresentationReceiver.connectionList` Read only  
Experimental

Returns a `Promise` that resolves with a `PresentationConnectionList` object containing a list of *incoming presentation connections.*

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

| Specification |
| --- |
| Presentation API # interface-presentationreceiver |

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

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
EXT\_texture\_compression\_bptc extension
=========================================

The `EXT_texture_compression_bptc` extension is part of the WebGL API and exposes 4 BPTC compressed texture formats. These compression formats are called BC7 and BC6H in Microsoft's DirectX API.

WebGL extensions are available using the `WebGLRenderingContext.getExtension()` method. For more information, see also Using Extensions in the WebGL tutorial.

**Note:** Support depends on the system's graphics driver. There is no support on Windows.

This extension is available to both, WebGL1 and WebGL2 contexts.

Constants
---------

The compressed texture formats are exposed by 4 constants and can be used in two functions: `compressedTexImage2D()` and `compressedTexSubImage2D()`.

`ext.COMPRESSED_RGBA_BPTC_UNORM_EXT`

Compresses 8-bit fixed-point data. Each 4x4 block of texels consists of 128 bits of RGBA or image data. See also BC7 format.

`ext.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT`

Compresses 8-bit fixed-point data. Each 4x4 block of texels consists of 128 bits of SRGB\_ALPHA or image data. See also BC7 format.

`ext.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT`

Compresses high dynamic range signed floating point values. Each 4x4 block of texels consists of 128 bits of RGB data. It only contains RGB data, so the returned alpha value is 1.0. See also BC6H format.

`ext.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT`

Compresses high dynamic range unsigned floating point values. Each 4x4 block of texels consists of 128 bits of RGB data. It only contains RGB data, so the returned alpha value is 1.0. See also BC6H format.

Examples
--------


```js
const ext = gl.getExtension("EXT\_texture\_compression\_bptc");

const texture = gl.createTexture();
gl.bindTexture(gl.TEXTURE\_2D, texture);

gl.compressedTexImage2D(
  gl.TEXTURE\_2D,
  0,
  ext.COMPRESSED\_RGBA\_BPTC\_UNORM\_EXT,
  128,
  128,
  0,
  textureData,
);
```

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

| Specification |
| --- |
| WebGL EXT\_texture\_compression\_bptc Extension Specification  |

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

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

See also
--------

* `WebGLRenderingContext.getExtension()`
* `WebGLRenderingContext.compressedTexImage2D()`
* `WebGLRenderingContext.compressedTexSubImage2D()`
* `WebGLRenderingContext.getParameter()`
CanvasPattern
=============

The **`CanvasPattern`** interface represents an opaque object describing a pattern, based on an image, a canvas, or a video, created by the `CanvasRenderingContext2D.createPattern()` method.

It can be used as a `fillStyle` or `strokeStyle`.

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

*As an opaque object, this has no exposed property.*

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

*There are no inherited method.*

`CanvasPattern.setTransform()`

Applies a `DOMMatrix` representing a linear transform to the pattern.

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

| Specification |
| --- |
| HTML Standard # canvaspattern |

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

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

See also
--------

* `CanvasRenderingContext2D.createPattern()`
* The `<canvas>` element and its associated interface, `HTMLCanvasElement`