recursal/MDN huggingface dataset:
GainNode
========

The `GainNode` interface represents a change in volume. It is an `AudioNode` audio-processing module that causes a given gain to be applied to the input data before its propagation to the output. A `GainNode` always has exactly one input and one output, both with the same number of channels.

The gain is a unitless value, changing with time, that is multiplied to each corresponding sample of all input channels. If modified, the new gain is instantly applied, causing unaesthetic 'clicks' in the resulting audio. To prevent this from happening, never change the value directly but use the exponential interpolation methods on the `AudioParam` interface.

![The GainNode is increasing the gain of the output.](/en-US/docs/Web/API/GainNode/webaudiogainnode.png)

EventTarget

AudioNode

GainNode

|  |  |
| --- | --- |
| Number of inputs | `1` |
| Number of outputs | `1` |
| Channel count mode | `"max"` |
| Channel count | `2` (not used in the default count mode) |
| Channel interpretation | `"speakers"` |

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

`GainNode()`

Creates and returns a new `GainNode` object. As an alternative, you can use the `BaseAudioContext.createGain()` factory method; see Creating an AudioNode.

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

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

`GainNode.gain` Read only 

An a-rate `AudioParam` representing the amount of gain to apply. You have to set `AudioParam.value` or use the methods of `AudioParam` to change the effect of gain.

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

*No specific method; inherits methods from its parent, `AudioNode`*.

Example
-------

See `BaseAudioContext.createGain()` for example code showing how to use an `AudioContext` to create a `GainNode`.

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

| Specification |
| --- |
| Web Audio API # GainNode |

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

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

See also
--------

* Using the Web Audio API
SVGAnimateMotionElement
=======================

The **`SVGAnimateMotionElement`** interface corresponds to the `<animateMotion>` element.

EventTarget

Node

Element

SVGElement

SVGAnimationElement

SVGAnimateMotionElementInstance properties
-------------------

*This interface has no properties but inherits properties from its parent, `SVGAnimationElement`.*

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

*This interface has no methods but inherits methods from its parent, `SVGAnimationElement`.*

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

| Specification |
| --- |
| SVG Animations Level 2 # InterfaceSVGAnimateMotionElement |

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

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

The **`PushSubscriptionOptions`** interface of the Push API represents the options associated with a push subscription.

The read-only `PushSubscriptionOptions` object is returned by calling `PushSubscription.options` on a `PushSubscription`. This interface has no constructor of its own.

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

`PushSubscriptionOptions.userVisibleOnly` Read only 

 A boolean value indicating that the returned push
 subscription will only be used for messages whose effect is made visible to the user.


`PushSubscriptionOptions.applicationServerKey` Read only 

 A public key your push server will use to send
 messages to client apps via a push server.


Examples
--------

Calling `PushSubscription.options` on a `PushSubscription` returns a `PushSubscriptionOptions` object. In the example below this is printed to the console.


```js
navigator.serviceWorker.ready.then((reg) => {
  reg.pushManager.getSubscription().then((subscription) => {
    const options = subscription.options;
    console.log(options); // a PushSubscriptionOptions object
  });
});
```

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

| Specification |
| --- |
| Push API # dom-pushsubscriptionoptions |

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

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

The **`WebGLSync`** interface is part of the WebGL 2 API and is used to synchronize activities between the GPU and the application.

WebGLObject

WebGLSync
When working with `WebGLSync` objects, the following methods of the `WebGL2RenderingContext` are useful:

* `WebGL2RenderingContext.fenceSync()`
* `WebGL2RenderingContext.deleteSync()`
* `WebGL2RenderingContext.isSync()`
* `WebGL2RenderingContext.clientWaitSync()`
* `WebGL2RenderingContext.waitSync()`
* `WebGL2RenderingContext.getSyncParameter()`
Examples
--------

### Creating a `WebGLSync` object

in this example, `gl` must be a `WebGL2RenderingContext`. `WebGLSync` objects are not available in WebGL 1.


```js
const sync = gl.fenceSync(gl.SYNC\_GPU\_COMMANDS\_COMPLETE, 0);
```

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

| Specification |
| --- |
| WebGL 2.0 Specification # 3.4 |

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

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

See also
--------

* `WebGLRenderingContext.finish()`
DOMParser
=========

 The **`DOMParser`** interface provides
 the ability to parse XML or HTML source code from a
 string into a DOM `Document`.

 You can perform the opposite operation—converting a DOM tree into XML or HTML
 source—using the `XMLSerializer` interface.

 In the case of an HTML document, you can also replace portions of the DOM with new DOM
 trees built from HTML by setting the value of the `Element.innerHTML` and
 `outerHTML` properties. These properties can also be
 read to fetch HTML fragments corresponding to the corresponding DOM subtree.

 Note that `XMLHttpRequest` can parse XML and HTML directly
 from a URL-addressable resource, returning a `Document` in its
 `response` property.


**Note:** Be aware that block-level elements
 like `<p>` will be automatically closed if another
 block-level element is nested inside and therefore parsed before the closing `</p>` tag.


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

`DOMParser()`

Creates a new `DOMParser` object.

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

`DOMParser.parseFromString()`

Parses a string using either the HTML parser or the XML parser, returning an `HTMLDocument` or `XMLDocument`.

Examples
--------

The documentation for `DOMParser.parseFromString()`, this interface's only method, contains examples for parsing XML, SVG, and HTML strings.

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

| Specification |
| --- |
| HTML Standard # dom-parsing-and-serialization |

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

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

See also
--------

* Parsing and serializing XML
* `XMLHttpRequest`
* `XMLSerializer`
* `JSON.parse()` - counterpart for `JSON` documents.
SVGFEImageElement
=================

The **`SVGFEImageElement`** interface corresponds to the `<feImage>` element.

EventTarget

Node

Element

SVGElement

SVGFEImageElementInstance properties
-------------------

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

`SVGFEImageElement.crossOrigin` Read only 

An `SVGAnimatedString` reflects the `crossorigin` attribute of the given element, limited to only known values.

`SVGFEImageElement.height` Read only 

An `SVGAnimatedLength` corresponding to the `height` attribute of the given element.

`SVGFEImageElement.href` Read only 

An `SVGAnimatedString` that reflects the `href` or `xlink:href` 
Deprecated
 attribute of the given element.

`SVGFEImageElement.preserveAspectRatio` Read only 

An `SVGAnimatedPreserveAspectRatio` corresponding to the `preserveAspectRatio` attribute of the given element.

`SVGFEImageElement.result` Read only 

An `SVGAnimatedString` corresponding to the `result` attribute of the given element.

`SVGFEImageElement.width` Read only 

An `SVGAnimatedLength` corresponding to the `width` attribute of the given element.

`SVGFEImageElement.x` Read only 

An `SVGAnimatedLength` corresponding to the `x` attribute of the given element.

`SVGFEImageElement.y` Read only 

An `SVGAnimatedLength` corresponding to the `y` attribute of the given element.

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

*This interface does not provide any specific methods, but implements those of its parent, `SVGElement`.*

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

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

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

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

See also
--------

* `<feImage>`
SpeechGrammar
=============

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

The **`SpeechGrammar`** interface of the Web Speech API represents a set of words or patterns of words that we want the recognition service to recognize.

Grammar is defined using JSpeech Grammar Format (**JSGF**.) Other formats may also be supported in the future.

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

`SpeechGrammar()` 
Non-standard

Experimental

Creates a new `SpeechGrammar` object.

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

`SpeechGrammar.src` 
Experimental

Sets and returns a string containing the grammar from within in the `SpeechGrammar` object instance.

`SpeechGrammar.weight` Optional 
Experimental

Sets and returns the weight of the `SpeechGrammar` object.

Examples
--------


```js
const grammar =
  "#JSGF V1.0; grammar colors; public <color> = aqua | azure | beige | bisque | black | blue | brown | chocolate | coral | crimson | cyan | fuchsia | ghostwhite | gold | goldenrod | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;";
const recognition = new SpeechRecognition();
const speechRecognitionList = new SpeechGrammarList();
speechRecognitionList.addFromString(grammar, 1);
recognition.grammars = speechRecognitionList;

console.log(speechRecognitionList[0].src); // should return the same as the contents of the grammar variable
console.log(speechRecognitionList[0].weight); // should return 1 - the same as the weight set in line 4.
```

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

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

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

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

See also
--------

* Web Speech API
CSSValueList
============

**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 **`CSSValueList`** interface derives from the `CSSValue` interface and provides the abstraction of an ordered collection of CSS values.

**Note:** This interface was part of an attempt to create a typed CSS Object Model. This attempt has been abandoned, and most browsers do
 not implement it.


To achieve your purpose, you can use:

* the untyped CSS Object Model, widely supported, or
* the modern CSS Typed Object Model API, less supported and considered experimental.

Some properties allow an empty list in their syntax. In that case, these properties take the `none` identifier. So, an empty list means that the property has the value `none`.

The items in the `CSSValueList` are accessible via an integral index, starting from 0.

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

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

`CSSValueList.length` Read only  
Deprecated

An `unsigned long` representing the number of `CSSValues` in the list.

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

`CSSValueList.item()` 
Deprecated

This method is used to retrieve a `CSSValue` by ordinal index. The order in this collection represents the order of the values in the CSS style property. If index is greater than or equal to the number of values in the list, this returns `null`.

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

 This feature was originally defined in the DOM Style Level 2 specification, but has been dropped from any
 standardization effort since then.

It has been superseded by a modern, but incompatible, CSS Typed Object Model API that is now on the standard track.

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

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

See also
--------

* `CSSPrimitiveValue`
* `CSSValue`
NamedNodeMap
============

The **`NamedNodeMap`** interface represents a collection of `Attr` objects. Objects inside a `NamedNodeMap` are not in any particular order, unlike `NodeList`, although they may be accessed by an index as in an array.

A `NamedNodeMap` object is *live* and will thus be auto-updated if changes are made to its contents internally or elsewhere.

**Note:** Although called `NamedNodeMap`, this interface doesn't deal with `Node` objects but with `Attr` objects, which are a specialized class of `Node` objects.

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

*This interface doesn't inherit any property.*

`NamedNodeMap.length` Read only 

Returns the amount of objects in the map.

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

*This interface doesn't inherit any method.*

`NamedNodeMap.getNamedItem()`

Returns an `Attr`, corresponding to the given name.

`NamedNodeMap.setNamedItem()`

Replaces, or adds, the `Attr` identified in the map by the given name.

`NamedNodeMap.removeNamedItem()`

Removes the `Attr` identified by the given map.

`NamedNodeMap.item()`

Returns the `Attr` at the given index, or `null` if the index is higher or equal to the number of nodes.

`NamedNodeMap.getNamedItemNS()`

Returns an `Attr` identified by a namespace and related local name.

`NamedNodeMap.setNamedItemNS()`

Replaces, or adds, the `Attr` identified in the map by the given namespace and related local name.

`NamedNodeMap.removeNamedItemNS()`

Removes the `Attr` identified by the given namespace and related local name.

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

| Specification |
| --- |
| DOM Standard # interface-namednodemap |

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

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

See also
--------

* `Element.attributes`
OES\_vertex\_array\_object extension
====================================

The **OES\_vertex\_array\_object** extension is part of the WebGL API and provides vertex array objects (VAOs) which encapsulate vertex array states. These objects keep pointers to vertex data and provide names for different sets of vertex data.

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 and the constants and methods are available without the "`OES`" suffix.

Constants
---------

This extension exposes one new constant, which can be used in the `gl.getParameter()` method:

`ext.VERTEX_ARRAY_BINDING_OES`

Returns a `WebGLVertexArrayObject` object when used in the `gl.getParameter()` method as the `pname` parameter.

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

This extension exposes four new methods.

`ext.createVertexArrayOES()`

Creates a new `WebGLVertexArrayObject`.

`ext.deleteVertexArrayOES()`

Deletes a given `WebGLVertexArrayObject`.

`ext.isVertexArrayOES()`

Returns `true` if a given object is a `WebGLVertexArrayObject`.

`ext.bindVertexArrayOES()`

Binds a given `WebGLVertexArrayObject` to the buffer.

Examples
--------


```js
const oes_vao_ext = gl.getExtension("OES\_vertex\_array\_object");
const vao = oes_vao_ext.createVertexArrayOES();
oes_vao_ext.bindVertexArrayOES(vao);

// …
// calls to bindBuffer or vertexAttribPointer
// which will be "recorded" in the VAO
// …
```

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

| Specification |
| --- |
| WebGL OES\_vertex\_array\_object 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.vertexAttribPointer()`
* WebGL2 equivalent methods:
    + `WebGL2RenderingContext.createVertexArray()`
    + `WebGL2RenderingContext.deleteVertexArray()`
    + `WebGL2RenderingContext.isVertexArray()`
    + `WebGL2RenderingContext.bindVertexArray()`
VRDisplayEvent
==============

**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.

**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.

The **`VRDisplayEvent`** interface of the WebVR API represents the event object of WebVR-related events (see the list of WebVR window extensions).

**Note:** This interface was part of the old WebVR API. It has been superseded by the WebXR Device API.

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

`VRDisplayEvent()` 
Deprecated

Non-standard

Creates a `VRDisplayEvent` object instance.

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

*`VRDisplayEvent` also inherits properties from its parent object, `Event`.*

`VRDisplayEvent.display` 
Deprecated
 Read only  
Non-standard

The `VRDisplay` associated with this event.

`VRDisplayEvent.reason` 
Deprecated
 Read only  
Non-standard

A human-readable reason why the event was fired.

Examples
--------


```js
window.addEventListener("vrdisplaypresentchange", (e) => {
  console.log(
    `Display ${e.display.displayId} presentation has changed. Reason given: ${e.reason}.`,
  );
});
```

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

This interface was part of the old WebVR API that has been superseded by the WebXR Device API. It is no longer on track to becoming a standard.

Until all browsers have implemented the new WebXR APIs, it is recommended to rely on frameworks, like A-Frame, Babylon.js, or Three.js, or a polyfill, to develop WebXR applications that will work across all browsers [1].

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

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

See also
--------

* WebVR API
RsaOaepParams
=============

The **`RsaOaepParams`** 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 RSA\_OAEP algorithm.

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

`name`

A string. This should be set to `RSA-OAEP`.

`label` Optional

An `ArrayBuffer`, a `TypedArray`, or a `DataView` — an array of bytes that does not itself need to be encrypted but which should be bound to the ciphertext. A digest of the label is part of the input to the encryption operation.

Unless your application calls for a label, you can just omit this argument and it will not affect the security of the encryption operation.

Examples
--------

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

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

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

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

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

See also
--------

* `SubtleCrypto.encrypt()`.
* `SubtleCrypto.decrypt()`.
* `SubtleCrypto.wrapKey()`.
* `SubtleCrypto.unwrapKey()`.
GPUTexture
==========

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

The **`GPUTexture`** interface of the WebGPU API represents a container used to store 1D, 2D, or 3D arrays of data, such as images, to use in GPU rendering operations.

A `GPUTexture` object instance is created using the `GPUDevice.createTexture()` method.

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

`depthOrArrayLayers` 
Experimental
 Read only 

A number representing the depth or layer count of the `GPUTexture` (pixels, or number of layers).

`dimension` 
Experimental
 Read only 

An enumerated value representing the dimension of the set of texels for each `GPUTexture` subresource.

`format` 
Experimental
 Read only 

An enumerated value representing the format of the `GPUTexture`.

`height` 
Experimental
 Read only 

A number representing the height of the `GPUTexture` in pixels.

`label` 
Experimental

A string providing a label that can be used to identify the object, for example in `GPUError` messages or console warnings.

`mipLevelCount` 
Experimental
 Read only 

A number representing the number of mip levels of the `GPUTexture`.

`sampleCount` 
Experimental
 Read only 

A number representing the sample count of the `GPUTexture`.

`usage` 
Experimental
 Read only 

The bitwise flags representing the allowed usages of the `GPUTexture`.

`width` 
Experimental
 Read only 

A number representing the width of the `GPUTexture` in pixels.

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

`createView()` 
Experimental

Creates a `GPUTextureView` representing a specific view of the `GPUTexture`.

`destroy()` 
Experimental

Destroys the `GPUTexture`.

Examples
--------

In the WebGPU samples Textured Cube sample, a texture to use on the faces of a cube is created by:

* Loading the image into an `HTMLImageElement` and creating an image bitmap using `createImageBitmap()`.
* Creating a new `GPUTexture` using `createTexture()`.
* Copying the image bitmap into the texture using `GPUQueue.copyExternalImageToTexture()`.


```js
//...
let cubeTexture: GPUTexture; // Sample is written in TypeScript
{
  const img = document.createElement("img");

  img.src = new URL(
    "../../../assets/img/Di-3d.png",
    import.meta.url
  ).toString();

  await img.decode();

  const imageBitmap = await createImageBitmap(img);

  cubeTexture = device.createTexture({
    size: [imageBitmap.width, imageBitmap.height, 1],
    format: "rgba8unorm",
    usage:
      GPUTextureUsage.TEXTURE\_BINDING |
      GPUTextureUsage.COPY\_DST |
      GPUTextureUsage.RENDER\_ATTACHMENT,
  });

  device.queue.copyExternalImageToTexture(
    { source: imageBitmap },
    { texture: cubeTexture },
    [imageBitmap.width, imageBitmap.height]
  );
}
//...
```

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

| Specification |
| --- |
| WebGPU # texture-interface |

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

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

See also
--------

* The WebGPU API