recursal/MDN huggingface dataset:
ContactsManager
===============

**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 **`ContactsManager`** interface of the `Contact Picker API` allows users to select entries from their contact list and share limited details of the selected entries with a website or application.

The `ContactsManager` is available through the global `navigator.contacts` property.

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

`select()` 
Experimental

Returns a `Promise` which, when resolved, presents the user with a contact picker which allows them to select contact(s) they wish to share.

`getProperties()` 
Experimental

Returns a `Promise` which resolves with an `Array` of `strings` indicating which contact properties are available.

Examples
--------

### Feature Detection

The following code checks whether the Contact Picker API is supported.


```js
const supported = "contacts" in navigator && "ContactsManager" in window;
```

### Checking for Supported Properties

The following asynchronous function uses the `getProperties` method to check for supported properties.


```js
async function checkProperties() {
  const supportedProperties = await navigator.contacts.getProperties();
  if (supportedProperties.includes("name")) {
    // run code for name support
  }
  if (supportedProperties.includes("email")) {
    // run code for email support
  }
  if (supportedProperties.includes("tel")) {
    // run code for telephone number support
  }
  if (supportedProperties.includes("address")) {
    // run code for address support
  }
  if (supportedProperties.includes("icon")) {
    // run code for avatar support
  }
}
```

### Selecting Contacts

The following example sets an array of properties to be retrieved for each contact, as well as setting an options object to allow for multiple contacts to be selected.

An asynchronous function is then defined which uses the `select()` method to present the user with a contact picker interface and handle the chosen results.


```js
const props = ["name", "email", "tel", "address", "icon"];
const opts = { multiple: true };

async function getContacts() {
  try {
    const contacts = await navigator.contacts.select(props, opts);
    handleResults(contacts);
  } catch (ex) {
    // Handle any errors here.
  }
}
```


`handleResults()` is a developer defined function.

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

| Specification |
| --- |
| Contact Picker API # contacts-manager |

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

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

See also
--------

* A Contact Picker for the Web
* A Contact Picker demo on glitch
XPathExpression
===============

This interface is a compiled XPath expression that can be evaluated on a document or specific node to return information from its DOM tree.

This is useful when an expression will be reused in an application, because it is just compiled once and all namespace prefixes which occur within the expression are preresolved.

Objects of this type are created by calling `XPathEvaluator.createExpression()`.

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

`XPathExpression.evaluate()`

Evaluates the XPath expression on the given node or document.

Example
-------

The following example shows the use of the `XPathExpression` interface.

### HTML


```html
<div>XPath example</div>
<div>Number of &lt;div&gt;s: <output></output></div>
```

### JavaScript


```js
const xpath = "//div";
const evaluator = new XPathEvaluator();
const expression = evaluator.createExpression(xpath);
const result = expression.evaluate(
  document,
  XPathResult.ORDERED\_NODE\_SNAPSHOT\_TYPE,
);
document.querySelector("output").textContent = result.snapshotLength;
```

### Result

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

| Specification |
| --- |
| DOM Standard # interface-xpathexpression |

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

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

See also
--------

* `document.createExpression()`
* `XPathResult`
CSSImageValue
=============

The **`CSSImageValue`** interface of the CSS Typed Object Model API represents values for properties that take an image, for example `background-image`, `list-style-image`, or `border-image-source`.

The CSSImageValue object represents an `<image>` that involves a URL, such as `url()` or `image()`, but not `linear-gradient()` or `element()`.

CSSStyleValue

CSSImageValueInstance properties
-------------------

None.

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

*Inherits methods from `CSSStyleValue`.*

Examples
--------

We create an element


```html
<button>Magic Wand</button>
```


We add some CSS, including a background image requesting a binary file:


```css
button {
  display: inline-block;
  min-height: 100px;
  min-width: 100px;
  background: no-repeat 5% center url(magicwand.png) aqua;
}
```


We get the element's style map. We then get() the background-image from the stylemap and stringify it:


```js
// get the element
const button = document.querySelector("button");

// Retrieve all computed styles with computedStyleMap()
const allComputedStyles = button.computedStyleMap();

// Return the CSSImageValue Example
console.log(allComputedStyles.get("background-image"));
console.log(allComputedStyles.get("background-image").toString());
```

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

| Specification |
| --- |
| CSS Typed OM Level 1 # imagevalue-objects |

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

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

See also
--------

* `CSSKeywordValue`
* `CSSNumericValue`
* `CSSPositionValue`
* `CSSTransformValue`
* `CSSUnparsedValue`
SVGStopElement
==============

The **`SVGStopElement`** interface corresponds to the `<stop>` element.

EventTarget

Node

Element

SVGElement

SVGStopElementInstance properties
-------------------

*This interface also inherits properties from its parent interface, `SVGElement`.*

`SVGStopElement.offset` Read only 

An `SVGAnimatedNumber` corresponding to the `offset` of the given element.

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

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

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

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

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

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

The **`HTMLTableSectionElement`** interface provides special properties and methods (beyond the `HTMLElement` interface it also has available to it by inheritance) for manipulating the layout and presentation of sections, that is headers, footers and bodies (`<thead>`, `<tfoot>`, and `<tbody>`, respectively) in an HTML table.

EventTarget

Node

Element

HTMLElement

HTMLTableSectionElementInstance properties
-------------------

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

`HTMLTableSectionElement.align` 
Deprecated

A string containing an enumerated value reflecting the `align` attribute. It indicates the alignment of the element's contents with respect to the surrounding context. The possible values are `"left"`, `"right"`, and `"center"`.

`HTMLTableSectionElement.rows` Read only 

Returns a live `HTMLCollection` containing the rows in the section. The `HTMLCollection` is live and is automatically updated when rows are added or removed.

`HTMLTableSectionElement.ch` 
Deprecated

A string containing one single character. This character is the one to align all the cell of a column on. It reflects the `char` and default to the decimal points associated with the language, e.g. `'.'` for English, or `','` for French. This property was optional and was not very well supported.

`HTMLTableSectionElement.chOff` 
Deprecated

A string containing an integer indicating how many characters must be left at the right (for left-to-right scripts; or at the left for right-to-left scripts) of the character defined by `HTMLTableRowElement.ch`. This property was optional and was not very well supported.

`HTMLTableSectionElement.vAlign` 
Deprecated

A string representing an enumerated value indicating how the content of the cell must be vertically aligned. It reflects the `valign` attribute and can have one of the following values: `"top"`, `"middle"`, `"bottom"`, or `"baseline"`.

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

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

`HTMLTableSectionElement.deleteRow()`

Removes the row, corresponding to the `index` given in parameter, in the section. If the `index` value is `-1` the last row is removed; if it smaller than `-1` or greater than the amount of rows in the collection, a `DOMException` with the value `IndexSizeError` is raised.

`HTMLTableSectionElement.insertRow()`

Returns an `HTMLTableRowElement` representing a new row of the section. It inserts it in the rows collection immediately before the `<tr>` element at the given `index` position. If the `index` is `-1`, the new row is appended to the collection. If the `index` is smaller than `-1` or greater than the number of rows in the collection, a `DOMException` with the value `IndexSizeError` is raised.

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

| Specification |
| --- |
| HTML Standard # htmltablesectionelement |

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

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

See also
--------

* The HTML elements implementing this interface: `<tfoot>`, `<thead>`, and `<tbody>`.
GPUAdapterInfo
==============

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

The **`GPUAdapterInfo`** interface of the WebGPU API contains identifying information about a `GPUAdapter`.

A `GPUAdapterInfo` object instance is requested using the `GPUAdapter.requestAdapterInfo()` method.

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

`architecture` 
Experimental
 Read only 

The name of the family or class of GPUs the adapter belongs to. Returns an empty string if it is not available.

`description` 
Experimental
 Read only 

A human-readable string describing the adapter. Returns an empty string if it is not available.

`device` 
Experimental
 Read only 

A vendor-specific identifier for the adapter. Returns an empty string if it is not available.

`vendor` 
Experimental
 Read only 

The name of the adapter vendor. Returns an empty string if it is not available.

Examples
--------


```js
async function init() {
  if (!navigator.gpu) {
    throw Error("WebGPU not supported.");
  }

  const adapter = await navigator.gpu.requestAdapter();
  if (!adapter) {
    throw Error("Couldn't request WebGPU adapter.");
  }

  const adapterInfo = await adapter.requestAdapterInfo();
  console.log(adapterInfo.architecture);
  console.log(adapterInfo.vendor);

  // ...
}
```

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

| Specification |
| --- |
| WebGPU # gpu-adapterinfo |

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

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

See also
--------

* The WebGPU API
WebGLBuffer
===========

The **WebGLBuffer** interface is part of the WebGL API and represents an opaque buffer object storing data such as vertices or colors.

WebGLObject

WebGLBufferDescription
-----------

The `WebGLBuffer` object does not define any methods or properties of its own and its content is not directly accessible. When working with `WebGLBuffer` objects, the following methods of the `WebGLRenderingContext` are useful:

* `WebGLRenderingContext.bindBuffer()`
* `WebGLRenderingContext.createBuffer()`
* `WebGLRenderingContext.deleteBuffer()`
* `WebGLRenderingContext.isBuffer()`
Examples
--------

### Creating a buffer


```js
const canvas = document.getElementById("canvas");
const gl = canvas.getContext("webgl");
const buffer = gl.createBuffer();
```

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

| Specification |
| --- |
| WebGL Specification # 5.4 |

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

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

See also
--------

* `WebGLRenderingContext.bindBuffer()`
* `WebGLRenderingContext.createBuffer()`
* `WebGLRenderingContext.deleteBuffer()`
* `WebGLRenderingContext.isBuffer()`
* Other buffers: `WebGLFramebuffer`, `WebGLRenderbuffer`
Battery Status API
==================

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

The **Battery Status API**, more often referred to as the **Battery API**, provides information about the system's battery charge level and lets you be notified by events that are sent when the battery level or charging status change. This can be used to adjust your app's resource usage to reduce battery drain when the battery is low, or to save changes before the battery runs out in order to prevent data loss.

**Note:** This API is *not available* in Web Workers (not exposed via `WorkerNavigator`).

Interfaces
----------

`BatteryManager`

Provides information about the system's battery charge level.

### Extensions to other interfaces

`Navigator.getBattery()`

Returns a `Promise` that resolves with a `BatteryManager` object.

Example
-------

In this example, we watch for changes both to the charging status (whether or not we're plugged in and charging) and for changes to the battery level and timing. This is done by listening for the `chargingchange`, `levelchange`, `chargingtimechange`, `dischargingtimechange` events.


```js
navigator.getBattery().then((battery) => {
  function updateAllBatteryInfo() {
    updateChargeInfo();
    updateLevelInfo();
    updateChargingInfo();
    updateDischargingInfo();
  }
  updateAllBatteryInfo();

  battery.addEventListener("chargingchange", () => {
    updateChargeInfo();
  });
  function updateChargeInfo() {
    console.log(`Battery charging? ${battery.charging ? "Yes" : "No"}`);
  }

  battery.addEventListener("levelchange", () => {
    updateLevelInfo();
  });
  function updateLevelInfo() {
    console.log(`Battery level: ${battery.level \* 100}%`);
  }

  battery.addEventListener("chargingtimechange", () => {
    updateChargingInfo();
  });
  function updateChargingInfo() {
    console.log(`Battery charging time: ${battery.chargingTime} seconds`);
  }

  battery.addEventListener("dischargingtimechange", () => {
    updateDischargingInfo();
  });
  function updateDischargingInfo() {
    console.log(`Battery discharging time: ${battery.dischargingTime} seconds`);
  }
});
```


See also the example in the specification.

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

| Specification |
| --- |
| Battery Status API  |

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

### api.BatteryManager

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

### api.Navigator.getBattery

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

See also
--------

* Hacks blog post - Using the Battery API
TaskAttributionTiming
=====================

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

The **`TaskAttributionTiming`** interface returns information about the work involved in a long task and its associate frame context. The frame context, also called the container, is the iframe, embed or object that is being implicated, on the whole, for a long task.

You usually work with `TaskAttributionTiming` objects when observing long tasks.

`TaskAttributionTiming` inherits from `PerformanceEntry`.

PerformanceEntry

TaskAttributionTimingInstance properties
-------------------

This interface extends the following `PerformanceEntry` properties for event timing performance entry types by qualifying them as follows:

`PerformanceEntry.duration` Read only  
Experimental

Always returns `0`, as `duration` is not applicable for this interface.

`PerformanceEntry.entryType` Read only  
Experimental

Always returns `taskattribution`.

`PerformanceEntry.name` Read only  
Experimental

Always returns `"unknown"`.

`PerformanceEntry.startTime` Read only  
Experimental

Always returns `0`.

This interface also supports the following properties:

`TaskAttributionTiming.containerType` Read only  
Experimental

Returns the type of frame container, one of `iframe`, `embed`, or `object`.

`TaskAttributionTiming.containerSrc` Read only  
Experimental

Returns the container's `src` attribute.

`TaskAttributionTiming.containerId` Read only  
Experimental

Returns the container's `id` attribute.

`TaskAttributionTiming.containerName` Read only  
Experimental

Returns the container's `name` attribute.

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

`TaskAttributionTiming.toJSON()` 
Experimental

Returns a JSON representation of the `TaskAttributionTiming` object.

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

| Specification |
| --- |
| Long Tasks API # sec-TaskAttributionTiming |

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

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

See also
--------

* `PerformanceLongTaskTiming`
Presentation
============

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

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

The **`Presentation`** can be defined as two possible user agents in the context: *Controlling user agent* and *Receiving user agent*.

In controlling browsing context, the `Presentation` interface provides a mechanism to override the browser default behavior of launching presentation to external screen. In receiving browsing context, `Presentation` interface provides the access to the available presentation connections.

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

`Presentation.defaultRequest` 
Experimental

In a controlling user agent, the `defaultRequest` attribute *MUST* return the default presentation request if any, `null` otherwise. In a receiving browsing context, it *MUST* return `null`.

`Presentation.receiver` 
Experimental

In a receiving user agent, the `receiver` attribute *MUST* return the `PresentationReceiver` instance associated with the receiving browsing context and created by the receiving user agent when the receiving browsing context is created.

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

None.

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

| Specification |
| --- |
| Presentation API # interface-presentation |

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

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

The `RTCRtpCodecParameters` dictionary, part of the WebRTC API, is used to describe the configuration parameters for a single media codec.

 It's used in `RTCRtpSender.getParameters()`, `RTCRtpSender.setParameters()` and `RTCRtpReceiver.getParameters()`.
 Its also use used when calling `RTCRtpTransceiver.setCodecPreferences()` to configure a transceiver's codecs before beginning the offer/answer process to establish a WebRTC peer connection.

Most of the fields in this property take values which are defined and maintained by the Internet Assigned Numbers Authority (IANA). References to relevant IANA documents are provided in the see also section at the end of this article.

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

`payloadType` Optional

The RTP payload type used to identify this codec.

`mimeType` Optional

The codec's MIME media type and subtype specified as a string of the form `"type/subtype"`. IANA maintains a registry of valid MIME types.

`clockRate` Optional

An unsigned long integer value specifying the codec's clock rate in hertz (Hz). The clock rate is the rate at which the codec's RTP timestamp advances. Most codecs have specific values or ranges of values they permit; see the IANA payload format media type registry for details.

`channels` Optional

An unsigned short integer indicating the number of channels the codec should support. For example, for audio codecs, a value of 1 specifies monaural sound while 2 indicates stereo.

`sdpFmtpLine` Optional

A string containing the format-specific parameters field from the `"a=fmtp"` line in the codec's SDP, if one is present; see section 5.8 of the IETF specification for JSEP.

**Note:** On an `RTCRtpReceiver`, the format-specific parameters come from the SDP sent by the remote peer, while for `RTCRtpSender`, they're provided by the local description.

See also
--------

Real-Time Transport Protocol (RTP) Parameters

The IANA document providing registries of permitted values for the RTP parameters used by this dictionary.
VideoEncoder
============

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 **`VideoEncoder`** interface of the WebCodecs API encodes `VideoFrame` objects into `EncodedVideoChunk`s.

EventTarget

VideoEncoderConstructor
-----------

`VideoEncoder()`

Creates a new `VideoEncoder` object.

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

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

`VideoEncoder.encodeQueueSize` Read only 

An integer representing the number of encode queue requests.

`VideoEncoder.state` Read only 

Represents the state of the underlying codec and whether it is configured for encoding.

### Events

`dequeue`

Fires to signal a decrease in `VideoEncoder.encodeQueueSize`.

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

`VideoEncoder.isConfigSupported()`

Returns a promise indicating whether the provided `VideoEncoderConfig` is supported.

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

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

`VideoEncoder.configure()`

Asynchronously prepares the encoder to accept video frames for encoding with the specified parameters.

`VideoEncoder.encode()`

Asynchronously encodes a `VideoFrame`.

`VideoEncoder.flush()`

Returns a promise that resolves once all pending encodes have been completed.

`VideoEncoder.reset()`

Cancels all pending encodes and callbacks.

`VideoEncoder.close()`

Ends all pending work and releases system resources.

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

| Specification |
| --- |
| WebCodecs # videoencoder-interface |

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

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

See also
--------

Video processing with WebCodecs