recursal/MDN huggingface dataset:
Credential
==========

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

The **`Credential`** interface of the Credential Management API provides information about an entity (usually a user) normally as a prerequisite to a trust decision.

`Credential` objects may be of four different types:

* `FederatedCredential`
* `IdentityCredential`
* `PasswordCredential`
* `PublicKeyCredential`
Instance properties
-------------------

`Credential.id` Read only 

Returns a string containing the credential's identifier. This might be any one of a GUID, username, or email address.

`Credential.type` Read only 

Returns a string containing the credential's type. Valid values are `password`, `federated` and `public-key`. (For `PasswordCredential`, `FederatedCredential` and `PublicKeyCredential`)

### Event handlers

None.

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

None.

Examples
--------


```js
let pwdCredential = new PasswordCredential({
  id: "example-username", // Username/ID
  name: "Carina Anand", // Display name
  password: "correct horse battery staple", // Password
});

console.assert(pwdCredential.type === "password");
```

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

| Specification |
| --- |
| Credential Management Level 1 # the-credential-interface |

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

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

The **`SVGFilterElement`** interface provides access to the properties of `<filter>` elements, as well as methods to manipulate them.

EventTarget

Node

Element

SVGElement

SVGFilterElementInstance properties
-------------------

`SVGFilterElement.href` Read only 

An `SVGAnimatedString` that corresponds to the `href` or `xlink:href` 
Deprecated
 attribute of the given `<filter>` element.

`SVGFilterElement.filterUnits` Read only 

An `SVGAnimatedEnumeration` that corresponds to the `filterUnits` attribute of the given `<filter>` element. Takes one of the constants defined in `SVGUnitTypes`.

`SVGFilterElement.primitiveUnits` Read only 

An `SVGAnimatedEnumeration` that corresponds to the `primitiveUnits` attribute of the given `<filter>` element. Takes one of the constants defined in `SVGUnitTypes`.

`SVGFilterElement.x` Read only 

An `SVGAnimatedLength` that corresponds to the `x` attribute on the given `<filter>` element.

`SVGFilterElement.y` Read only 

An `SVGAnimatedLength` that corresponds to the `y` attribute of the given `<filter>` element.

`SVGFilterElement.width` Read only 

An `SVGAnimatedLength` that corresponds to the `width` attribute of the given `<filter>` element.

`SVGFilterElement.height` Read only 

An `SVGAnimatedLength` that corresponds to the `height` attribute of the given `<filter>` element.

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

| Specification |
| --- |
| Filter Effects Module Level 1 # InterfaceSVGFilterElement |

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

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

See also
--------

* `<filter>`
indexedDB global property
=========================

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

 The global **`indexedDB`** read-only property provides a mechanism for applications to
 asynchronously access the capabilities of indexed databases.

Value
-----

An `IDBFactory` object.

Examples
--------

 The following code creates a request for a database to be opened asynchronously, after
 which the database is opened when the request's `onsuccess` handler is fired:


```js
let db;
function openDB() {
  const DBOpenRequest = window.indexedDB.open("toDoList");
  DBOpenRequest.onsuccess = (e) => {
    db = DBOpenRequest.result;
  };
}
```

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

| Specification |
| --- |
| Indexed Database API 3.0 # dom-windoworworkerglobalscope-indexeddb |

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

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

See also
--------

* Using IndexedDB
* Starting transactions: `IDBDatabase`
* Using transactions: `IDBTransaction`
* Setting a range of keys: `IDBKeyRange`
* Retrieving and making changes to your data: `IDBObjectStore`
* Using cursors: `IDBCursor`
* Reference example: To-do Notifications (View the example live).
DOMRectReadOnly
===============

The **`DOMRectReadOnly`** interface specifies the standard properties (also used by `DOMRect`) to define a rectangle whose properties are immutable.

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

`DOMRectReadOnly()`

Defined to create a new `DOMRectReadOnly` object.

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

`DOMRectReadOnly.x` Read only 

Returns the x coordinate of the `DOMRectReadOnly`'s origin.

`DOMRectReadOnly.y` Read only 

Returns the y coordinate of the `DOMRectReadOnly`'s origin.

`DOMRectReadOnly.width` Read only 

Returns the width of the `DOMRectReadOnly`.

`DOMRectReadOnly.height` Read only 

Returns the height of the `DOMRectReadOnly`.

`DOMRectReadOnly.top` Read only 

Returns the top coordinate value of the `DOMRectReadOnly` (usually the same as `y`).

`DOMRectReadOnly.right` Read only 

Returns the right coordinate value of the `DOMRectReadOnly` (usually the same as `x + width`).

`DOMRectReadOnly.bottom` Read only 

Returns the bottom coordinate value of the `DOMRectReadOnly` (usually the same as `y + height`).

`DOMRectReadOnly.left` Read only 

Returns the left coordinate value of the `DOMRectReadOnly` (usually the same as `x`).

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

`DOMRectReadOnly.fromRect()`

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

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`
PermissionStatus
================

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

The **`PermissionStatus`** interface of the Permissions API provides the state of an object and an event handler for monitoring changes to said state.

EventTarget

PermissionStatusInstance properties
-------------------

`PermissionStatus.name` Read only 

Returns the name of a requested permission, identical to the `name` passed to `Permissions.query`.

`PermissionStatus.state` Read only 

Returns the state of a requested permission; one of `'granted'`, `'denied'`, or `'prompt'`.

`PermissionStatus.status` Read only  
Deprecated

Returns the state of a requested permission; one of `'granted'`, `'denied'`, or `'prompt'`. Later versions of the specification replace this with `PermissionStatus.state`.

### Events

`change`

Invoked upon changes to `PermissionStatus.state`, or the deprecated `PermissionStatus.status` in the case of older browsers.

Example
-------


```js
navigator.permissions
  .query({ name: "geolocation" })
  .then((permissionStatus) => {
    console.log(`geolocation permission status is ${permissionStatus.state}`);
    permissionStatus.onchange = () => {
      console.log(
        `geolocation permission status has changed to ${permissionStatus.state}`,
      );
    };
  });
```

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

| Specification |
| --- |
| Permissions # permissionstatus-interface |

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

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

**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 **`XRSubImage`** interface of the WebXR Device API represents what viewport of the GPU texture to use for rendering.

Interfaces based on `XRSubImage`
--------------------------------

Below is a list of interfaces based on the `XRSubImage` interface.

* `XRWebGLSubImage`: used during rendering of WebGL layers.
Instance properties
-------------------

`XRSubImage.viewport` Read only  
Experimental

The `XRViewport` used when rendering the sub image.

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

| Specification |
| --- |
| WebXR Layers API Level 1 # xrsubimagetype |

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

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

See also
--------

* `XRWebGLSubImage`
AesCtrParams
============

The **`AesCtrParams`** dictionary of the Web Crypto API represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.encrypt()`, `SubtleCrypto.decrypt()`, `SubtleCrypto.wrapKey()`, or `SubtleCrypto.unwrapKey()`, when using the AES-CTR algorithm.

AES is a block cipher, meaning that it splits the message into blocks and encrypts it a block at a time. In CTR mode, every time a block of the message is encrypted, an extra block of data is mixed in. This extra block is called the "counter block".

A given counter block value must never be used more than once with the same key:

* Given a message *n* blocks long, a different counter block must be used for every block.
* If the same key is used to encrypt more than one message, a different counter block must be used for all blocks across all messages.

Typically this is achieved by splitting the initial counter block value into two concatenated parts:

* A nonce (that is, a number that may only be used once). The nonce part of the block stays the same for every block in the message. Each time a new message is to be encrypted, a new nonce is chosen. Nonces don't have to be secret, but they must not be reused with the same key.
* A counter. This part of the block gets incremented each time a block is encrypted.

Essentially: the nonce should ensure that counter blocks are not reused from one message to the next, while the counter should ensure that counter blocks are not reused within a single message.

**Note:** See Appendix B of the NIST SP800-38A standard for more information.

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

`name`

A string. This should be set to `AES-CTR`.

`counter`

An `ArrayBuffer`, a `TypedArray`, or a `DataView` — the initial value of the counter block. This must be 16 bytes long (the AES block size). The rightmost `length` bits of this block are used for the counter, and the rest is used for the nonce. For example, if `length` is set to 64, then the first half of `counter` is the nonce and the second half is used for the counter.

`length`

A `Number` — the number of bits in the counter block that are used for the actual counter. The counter must be big enough that it doesn't wrap: if the message is `n` blocks and the counter is `m` bits long, then the following must be true: `n <= 2^m`. The NIST SP800-38A standard, which defines CTR, suggests that the counter should occupy half of the counter block (see Appendix B.2), so for AES it would be 64.

Examples
--------

See the examples for `SubtleCrypto.encrypt()` and `SubtleCrypto.decrypt()`.

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

| Specification |
| --- |
| Web Cryptography API # dfn-AesCtrParams |

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

Browsers that support the "AES-CTR" algorithm for the `SubtleCrypto.encrypt()`, `SubtleCrypto.decrypt()`, `SubtleCrypto.wrapKey()`, or `SubtleCrypto.unwrapKey()` methods will support this type.

See also
--------

* CTR mode is defined in section 6.5 of the NIST SP800-38A standard.
* `SubtleCrypto.encrypt()`.
* `SubtleCrypto.decrypt()`.
* `SubtleCrypto.wrapKey()`.
* `SubtleCrypto.unwrapKey()`.
FileEntrySync
=============

**Non-standard:** This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

**Deprecated:** This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

The `FileEntrySync` interface represents a file in a file system. It lets you write content to a file.

**Warning:** This interface is deprecated and is no more on the standard track.
 *Do not use it anymore.* Use the File and Directory Entries API instead.


Basic concepts
--------------

To write content to file, create a FileWriter object by calling `createWriter()`.

Method overview
---------------

|  |
| --- |
| `FileWriterSync
createWriter ());` |
| `File file ());` |

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

### createWriter()

Creates a new `FileWriter` associated with the file that the `FileEntry` represents.


```webidl
void createWriter();
```


#### Parameter

None.

#### Returns

A `FileWriterSync` object.

#### Exceptions

This method can raise a DOMException with the following codes:

| Exception | Description |
| --- | --- |
| `NOT_FOUND_ERR` | The file does not exist. |
| `INVALID_STATE_ERR` | The file is no longer valid for some reason other than it having been deleted. |

### file()

Returns a File that represents the current state of the file that this `FileEntry` represents.


```webidl
void file();
```


#### Parameter

None.

#### Returns

A `File` object.

#### Exceptions

This method can raise a DOMException with the following codes:

| Exception | Description |
| --- | --- |
| `NOT_FOUND_ERR` | The file does not exist. |
| `INVALID_STATE_ERR` | The file is no longer valid for some reason other than it having been deleted. |

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

This feature is not part of any specification anymore. It is no longer on track to become a standard.

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

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

See also
--------

* File and Directory Entries API
* Basic Concepts About the File and Directory Entries API
OES\_texture\_half\_float extension
===================================

The **`OES_texture_half_float`** extension is part of the WebGL API and adds texture formats with 16- (aka half float) and 32-bit floating-point components.

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.HALF_FLOAT`.

Constants
---------

`ext.HALF_FLOAT_OES`

Half floating-point type (16-bit).

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

This extension extends `WebGLRenderingContext.texImage2D()` and `WebGLRenderingContext.texSubImage2D()`:

* The `type` parameter now accepts `ext.HALF_FLOAT_OES`.
Limitation: Linear filtering
----------------------------

Linear filtering on half floating-point textures is not allowed with this extension. If you set the magnification or minification filter in the `WebGLRenderingContext.texParameter()` method to one of `gl.LINEAR`, `gl.LINEAR_MIPMAP_NEAREST`, `gl.NEAREST_MIPMAP_LINEAR`, or `gl.LINEAR_MIPMAP_LINEAR`, and use half floating-point textures, the texture will be marked as incomplete.

To use linear filtering on half floating-point textures, enable the `OES_texture_half_float_linear` extension in addition to this extension.

Half floating-point color buffers
---------------------------------

This extension implicitly enables the `EXT_color_buffer_half_float` extension (if supported), which allows rendering to 16-bit floating point formats.

Examples
--------


```js
const ext = gl.getExtension("OES\_texture\_half\_float");

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

gl.texImage2D(gl.TEXTURE\_2D, 0, gl.RGBA, gl.RGBA, ext.HALF\_FLOAT\_OES, image);
```

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

| Specification |
| --- |
| WebGL OES\_texture\_half\_float 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.texSubImage2D()`
* `OES_texture_float`
* `OES_texture_float_linear`
* `OES_texture_half_float_linear`
MIDIConnectionEvent
===================

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

The **`MIDIConnectionEvent`** interface of the Web MIDI API is the event passed to the `statechange` event of the `MIDIAccess` interface and the `statechange` event of the `MIDIPort` interface. This occurs any time a new port becomes available, or when a previously available port becomes unavailable. For example, this event is fired whenever a MIDI device is either plugged in to or unplugged from a computer.

Event

MIDIConnectionEventConstructor
-----------

`MIDIConnectionEvent()`

Creates a new `MIDIConnectionEvent` object.

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

`MIDIConnectionEvent.port` Read only 

Returns a reference to a `MIDIPort` instance for a port that has been connected or disconnected.

Examples
--------

The `Navigator.requestMIDIAccess()` method returns a promise that resolves with a `MIDIAccess` object. When a port changes state, a `MIDIConnectionEvent` is passed to `statechange` event. Information about the port can then be printed to the console.


```js
navigator.requestMIDIAccess().then((access) => {
  access.onstatechange = (event) => {
    console.log(event.port.name, event.port.manufacturer, event.port.state);
  };
});
```

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

| Specification |
| --- |
| Web MIDI API # midiconnectionevent-interface |

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

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

The **`XRRigidTransform`** is a WebXR API interface that represents the 3D geometric transform described by a position and orientation.

`XRRigidTransform` is used to specify transforms throughout the WebXR APIs, including:

* The offset and orientation relative to the parent reference space to use when creating a new reference space with `getOffsetReferenceSpace()`.
* The `transform` of an `XRView`.
* The `transform` of an `XRPose`.
* The `XRReferenceSpaceEvent` event's `transform` property, as found in the `reset` event received by an `XRReferenceSpace`.

Using `XRRigidTransform` in these places rather than bare arrays that provide the matrix data has an advantage. It automatically computes the inverse of the transform and even caches it making subsequent requests significantly faster.

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

`new XRRigidTransform()`

Creates a new `XRRigidTransform` object which represents a transform that applies a specified position and/or orientation.

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

`XRRigidTransform.position` Read only 

A `DOMPointReadOnly` specifying a 3-dimensional point, expressed in meters, describing the translation component of the transform. The `w` property is always `1.0`.

`XRRigidTransform.orientation` Read only 

A `DOMPointReadOnly` which contains a unit quaternion describing the rotational component of the transform. As a unit quaternion, its length is always normalized to `1.0`.

`XRRigidTransform.matrix` Read only 

Returns the transform matrix in the form of a 16-member `Float32Array`. See the section Matrix format for how the array is used to represent a matrix.

`XRRigidTransform.inverse` Read only 

Returns a `XRRigidTransform` which is the inverse of this transform. That is, if applied to an object that had been previously transformed by the original transform, it will undo the transform and return the original object.

Usage notes
-----------

When an `XRRigidTransform` is interpreted, the orientation is always applied to the affected object before the position is applied.

Example
-------

This code snippet creates an `XRRigidTransform` to specify the offset and orientation in relation to the current reference space to use when creating a new reference space. It then requests the first animation frame callback by calling the session's `requestAnimationFrame()` method.


```js
xrSession.requestReferenceSpace(refSpaceType).then((refSpace) => {
  xrReferenceSpace = refSpace;
  xrReferenceSpace = xrReferenceSpace.getOffsetReferenceSpace(
    new XRRigidTransform(viewerStartPosition, cubeOrientation),
  );
  animationFrameRequestID = xrSession.requestAnimationFrame(drawFrame);
});
```

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

| Specification |
| --- |
| WebXR Device API # xrrigidtransform-interface |

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

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

The **`PeriodicWave`** interface defines a periodic waveform that can be used to shape the output of an `OscillatorNode`.

`PeriodicWave` has no inputs or outputs; it is used to define custom oscillators when calling `OscillatorNode.setPeriodicWave()`. The `PeriodicWave` itself is created/returned by `BaseAudioContext.createPeriodicWave`.

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

`PeriodicWave()`

Creates a new `PeriodicWave` object instance using the default values for all properties. If you wish to establish custom property values at the outset, use the `BaseAudioContext.createPeriodicWave` factory method instead.

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

None; also, `PeriodicWave` doesn't inherit any properties.

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

None; also, `PeriodicWave` doesn't inherit any methods.

Example
-------

See `BaseAudioContext.createPeriodicWave` for simple example code that shows how to create a `PeriodicWave` object containing a simple sine wave.

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

| Specification |
| --- |
| Web Audio API # PeriodicWave |

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

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

See also
--------

* Using the Web Audio API
ResizeObserverSize
==================

The **`ResizeObserverSize`** interface of the `Resize Observer API` is used by the `ResizeObserverEntry` interface to access the box sizing properties of the element being observed.

**Note:** In multi-column layout, which is a fragmented context, the sizing returned by `ResizeObserverSize` will be the size of the first column.

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

`ResizeObserverSize.blockSize` Read only 

The length of the observed element's border box in the block dimension. For boxes with a horizontal `writing-mode`, this is the vertical dimension, or height; if the writing-mode is vertical, this is the horizontal dimension, or width.

`ResizeObserverSize.inlineSize` Read only 

The length of the observed element's border box in the inline dimension. For boxes with a horizontal `writing-mode`, this is the horizontal dimension, or width; if the writing-mode is vertical, this is the vertical dimension, or height.


**Note:** For more explanation of writing modes and block and inline dimensions, read Handling different text directions.

Examples
--------

In this example the `ResizeObserverEntry.contentBoxSize` property returns a `ResizeObserverSize` object. This is an array containing the sizing information for the content box of the observed element.


```js
const resizeObserver = new ResizeObserver((entries) => {
  for (const entry of entries) {
    console.log(entry.contentBoxSize[0]); // a ResizeObserverSize
  }
});

resizeObserver.observe(divElem);
```

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

| Specification |
| --- |
| Resize Observer # resizeobserversize |

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

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