recursal/MDN huggingface dataset:
SVGRect
=======

The **`SVGRect`** represents a rectangle. Rectangles consist of an `x` and `y` coordinate pair identifying a minimum `x` value, a minimum `y` value, and a `width` and `height`, which are constrained to be non-negative.

An **`SVGRect`** object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown.

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

`SVGRect.x`

The exact effect of this coordinate depends on each element. If the attribute is not specified, the effect is as if a value of `0` were specified.

`SVGRect.y`

The exact effect of this coordinate depends on each element. If the attribute is not specified, the effect is as if a value of `0` were specified.

`SVGRect.width`

This represents the width of the rectangle. A value that is negative results to an error. A value of `0` disables rendering of the element

`SVGRect.height`

This represents the height of the rectangle. A value that is negative results to an error. A value of `0` disables rendering of the element.

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

None.

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.
SVGPolygonElement
=================

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

EventTarget

Node

Element

SVGElement

SVGGraphicsElement

SVGGeometryElement

SVGPolygonElementInstance properties
-------------------

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

`SVGPolygonElement.animatedPoints` Read only 

A `SVGPointList` representing the animated value of the element's `points` attribute. If the `points` attribute is not being animated, it contains the same value as the `points` property.

`SVGPolygonElement.points`

A `SVGPointList` representing the base (i.e., static) value of the element's `points` attribute. Modifications via the `SVGPointList` object are reflected in the `points` attribute, and vice versa.

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

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

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

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

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

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

See also
--------

* `<polygon>`
XRQuadLayer
===========

**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 **`XRQuadLayer`** interface of the WebXR Device API is a layer that takes up a flat rectangular space in the virtual environment. An `XRQuadLayer` has no thickness. It is a two-dimensional object positioned and oriented in 3D space. The position of a quad refers to the center of the quad. Only the front of the layer is visible.

`XRQuadLayer` requires the `layers` feature to be enabled for the `XRSession`. You can request it in `XRSystem.requestSession()`.

To create a new `XRQuadLayer`, call either:

* `XRWebGLBinding.createQuadLayer()` for a WebGL opaque texture quad layer, or
* `XRMediaBinding.createQuadLayer()` for an HTML `<video>` playback quad layer.

To present layers to the XR device, add them to the `layers` render state using `XRSession.updateRenderState()`.

EventTarget

XRLayer

XRCompositionLayer

XRQuadLayerInstance properties
-------------------

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

`XRQuadLayer.height` 
Experimental

Represents the height of the layer in meters.

`XRQuadLayer.space` 
Experimental

An `XRSpace` representing the layer's spatial relationship with the user's physical environment.

`XRQuadLayer.transform` 
Experimental

An `XRRigidTransform` representing the offset and orientation relative to `space`.

`XRQuadLayer.width` 
Experimental

Represents the width of the layer in meters.

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

*Inherits methods from its parents, `XRCompositionLayer` and `EventTarget`*.

Events
------

`redraw` 
Experimental

Sent to the `XRQuadLayer` object when the underlying resources of the layer are lost or when the XR Compositor can no longer reproject the layer. If this event is sent, authors should redraw the content of the layer in the next XR animation frame.

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

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

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

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

See also
--------

* `XRLayer`
* `EventTarget`
* `XRCompositionLayer`
* `XREquirectLayer`
* `XRCubeLayer`
* `XRCylinderLayer`
* `XRProjectionLayer`
HTMLAudioElement
================

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

This element is based on, and inherits properties and methods from, the `HTMLMediaElement` interface.

EventTarget

Node

Element

HTMLElement

HTMLMediaElement

HTMLAudioElementConstructor
-----------

`Audio()`

Creates and returns a new `HTMLAudioElement` object, optionally starting the process of loading an audio file into it if the file URL is given.

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

*No specific properties; inherits properties from its parent, `HTMLMediaElement`, and from `HTMLElement`.*

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

*Inherits methods from its parent, `HTMLMediaElement`, and from `HTMLElement`. It offers no methods of its own.*

Examples
--------

### Basic usage

You can create a `HTMLAudioElement` entirely with JavaScript using the `Audio()` constructor:


```js
const audioElement = new Audio("car\_horn.wav");
```


then you can invoke the `play()` method on the element


```js
audioElement.play();
```


**Note:** A common gotcha is trying to play an audio element immediately on page load. Modern browser's default autoplay policy will block that from happening. Refer to Firefox and chrome for best practices and work arounds.

Some of the more commonly used properties of the audio element include `src`, `currentTime`, `duration`, `paused`, `muted`, and `volume`. This snippet copies the audio file's duration to a variable:


```js
const audioElement = new Audio("car\_horn.wav");
audioElement.addEventListener("loadeddata", () => {
  let duration = audioElement.duration;
  // The duration variable now holds the duration (in seconds) of the audio clip
});
```

Events
------

*Inherits methods from its parent, `HTMLMediaElement`, and from its ancestor `HTMLElement`.* Listen to events using `addEventListener()` or by assigning an event listener to the `oneventname` property of this interface.

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

| Specification |
| --- |
| HTML Standard # htmlaudioelement |

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

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

See also
--------

* Web media technologies
* Using audio and video in HTML
* HTML element implementing this interface: `<audio>`.
CSSPropertyRule
===============

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 **`CSSPropertyRule`** interface of the CSS Properties and Values API represents a single CSS `@property` rule.

CSSRule

CSSPropertyRuleInstance properties
-------------------

*Inherits properties from its ancestor `CSSRule`.*

`CSSPropertyRule.inherits` Read only 

Returns the inherit flag of the custom property.

`CSSPropertyRule.initialvalue` Read only 

Returns the initial value of the custom property.

`CSSPropertyRule.name` Read only 

Returns the name of the custom property.

`CSSPropertyRule.syntax` Read only 

Returns the literal syntax of the custom property.

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

*No specific methods; inherits methods from its ancestor `CSSRule`.*

Examples
--------

This stylesheet contains a single `@property` rule. The first `CSSRule` returned will be a `CSSPropertyRule` with the properties and values as defined by the rule in CSS.


```css
@property --property-name {
  syntax: "<color>";
  inherits: false;
  initial-value: #c0ffee;
}
```



```js
let myRules = document.styleSheets[0].cssRules;
console.log(myRules[0]); //a CSSPropertyRule
```

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

| Specification |
| --- |
| CSS Properties and Values API Level 1 # the-css-property-rule-interface |

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

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

**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 **`VRLayerInit`** dictionary of the WebVR API represents a content layer (an `HTMLCanvasElement` or `OffscreenCanvas`) that you want to present in a VR display.

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

You can retrieve `VRLayerInit` objects using `VRDisplay.getLayers()`, and present them using the `VRDisplay.requestPresent()` method.

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

`VRLayerInit.leftBounds` 
Deprecated

Defines the left texture bounds of the canvas whose contents will be presented by the `VRDisplay`.

`VRLayerInit.rightBounds` 
Deprecated

Defines the right texture bounds of the canvas whose contents will be presented by the `VRDisplay`.

`VRLayerInit.source` 
Deprecated

Defines the canvas whose contents will be presented by the `VRDisplay` when `VRDisplay.submitFrame()` is called.

Examples
--------


```js
// currently returns an empty array
let layers = vrDisplay.getLayers();

if (navigator.getVRDisplays) {
  console.log("WebVR 1.1 supported");
  // Then get the displays attached to the computer
  navigator.getVRDisplays().then((displays) => {
    // If a display is available, use it to present the scene
    if (displays.length > 0) {
      vrDisplay = displays[0];
      console.log("Display found");
      // Starting the presentation when the button is clicked: It can only be called in response to a user gesture
      btn.addEventListener("click", () => {
        vrDisplay.requestPresent([{ source: canvas }]).then(() => {
          console.log("Presenting to WebVR display");

          // Here it returns an array of VRLayerInit objects
          layers = vrDisplay.getLayers();

          // …
        });
      });
    }
  });
}
```


`VRLayerInit` objects look something like this:


```js
{
  leftBounds : [/\* … \*/],
  rightBounds: [/\* … \*/],
  source: canvasReference
}
```


**Note:** The `canvasReference` refers to the `<canvas>` element itself, not the WebGL context associated with the canvas. The other two members are arrays

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

This dictionary 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].

See also
--------

* WebVR API
WebGLContextEvent
=================

The **WebContextEvent** interface is part of the WebGL API and is an interface for an event that is generated in response to a status change to the WebGL rendering context.

Event

WebGLContextEventConstructor
-----------

`WebGLContextEvent()`

Creates a new `WebGLContextEvent` object.

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

*This interface inherits properties from its parent interface, `Event`.*

`WebGLContextEvent.statusMessage`

A read-only property containing additional information about the event.

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

*This interface doesn't define any own methods, but inherits methods from its parent interface, `Event`.*

Examples
--------

With the help of the `WEBGL_lose_context` extension, you can simulate the `webglcontextlost` and `webglcontextrestored` events:


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

canvas.addEventListener(
  "webglcontextlost",
  (e) => {
    console.log(e);
  },
  false,
);

gl.getExtension("WEBGL\_lose\_context").loseContext();

// WebGLContextEvent event with type "webglcontextlost" is logged.
```

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

| Specification |
| --- |
| WebGL Specification # 5.15 |

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

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

See also
--------

* `WebGLRenderingContext.isContextLost()`
* `WEBGL_lose_context`, `WEBGL_lose_context.loseContext()`, `WEBGL_lose_context.restoreContext()`
* Events: webglcontextlost, webglcontextrestored, webglcontextcreationerror
CSSMathNegate
=============

The **`CSSMathNegate`** interface of the CSS\_Object\_Model#css\_typed\_object\_model negates the value passed into it. It inherits properties and methods from its parent `CSSNumericValue`.

CSSStyleValue

CSSNumericValue

CSSMathValue

CSSMathNegateConstructor
-----------

`CSSMathNegate()`

Creates a new `CSSMathNegate` object.

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

`CSSMathNegate.value` Read only 

Returns a `CSSNumericValue` object.

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

*The interface may also inherit methods from its parent interface, `CSSMathValue`.*

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

*The interface may also inherit methods from its parent interface, `CSSMathValue`.*

Examples
--------

To do

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

| Specification |
| --- |
| CSS Typed OM Level 1 # cssmathnegate |

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

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

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

The **`GPUAdapter`** interface of the WebGPU API represents a GPU adapter. From this you can request a `GPUDevice`, adapter info, features, and limits.

A `GPUAdapter` object is requested using the `GPU.requestAdapter()` method.

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

`features` 
Experimental
 Read only 

A `GPUSupportedFeatures` object that describes additional functionality supported by the adapter.

`isFallbackAdapter` 
Experimental
 Read only 

A boolean value. Returns `true` if the adapter is a fallback adapter, and `false` if not.

`limits` 
Experimental
 Read only 

A `GPUSupportedLimits` object that describes the limits supported by the adapter.

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

`requestAdapterInfo()` 
Experimental

Returns a `Promise` that fulfills with a `GPUAdapterInfo` object containing identifying information about an adapter.

`requestDevice()` 
Experimental

Returns a `Promise` that fulfills with a `GPUDevice` object, which is the primary interface for communicating with the GPU.

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 device = await adapter.requestDevice();

  //...
}
```

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

| Specification |
| --- |
| WebGPU # gpu-adapter |

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

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

See also
--------

* The WebGPU API
OverconstrainedError
====================

The **`OverconstrainedError`** interface of the Media Capture and Streams API indicates that the set of desired capabilities for the current `MediaStreamTrack` cannot currently be met. When this event is thrown on a MediaStreamTrack, it is muted until either the current constraints can be established or until satisfiable constraints are applied.

DOMException

OverconstrainedErrorConstructor
-----------

`OverconstrainedError()`

Creates a new `OverconstrainedError` object.

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

*Also inherits properties from its parent interface, `DOMException`.*

`OverconstrainedError.constraint` Read only 

Returns the constraint that was supplied in the constructor, meaning the constraint that was not satisfied.

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

*Also inherits methods from its parent interface, `DOMException`.*

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

| Specification |
| --- |
| Media Capture and Streams # overconstrainederror-interface |

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

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

**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 interface of the Credential Management API provides information about a username/password pair. In supporting browsers an instance of this class may be passed in the `credential` member of the `init` object for global `fetch()`.

**Note:** This interface is restricted to top-level contexts and cannot be used from an `<iframe>`.

Credential

PasswordCredentialConstructor
-----------

`PasswordCredential()` 
Experimental

Creates a new `PasswordCredential` object.

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

*Inherits properties from its ancestor, `Credential`.*

`PasswordCredential.iconURL` Read only  
Experimental

A string containing a URL pointing to an image for an icon. This image is intended for display in a credential chooser. The URL must be accessible without authentication.

`PasswordCredential.name` Read only  
Experimental

A human-readable string that provides public name for display in a credential chooser.

`PasswordCredential.password` Read only  
Experimental

A string containing the password of the credential.

### Event handlers

None.

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

None.

Examples
--------


```js
const cred = new PasswordCredential({
  id,
  password,
  name,
  iconURL,
});

navigator.credentials.store(cred).then(() => {
  // Do something else.
});
```

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

| Specification |
| --- |
| Credential Management Level 1 # passwordcredential-interface |

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

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

The **`MediaKeys`** interface of Encrypted Media Extensions API represents a set of keys that an associated `HTMLMediaElement` can use for decryption of media data during playback.

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

None.

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

`MediaKeys.createSession()`

Returns a new `MediaKeySession` object, which represents a context for message exchange with a content decryption module (CDM).

`MediaKeys.setServerCertificate()`

Returns a `Promise` to a server certificate to be used to encrypt messages to the license server.

Examples
--------


```js
//TBD
```

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

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

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

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

**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 **`XRRay`** interface of the WebXR Device API is a geometric ray described by an origin point and a direction vector.

`XRRay` objects can be passed to `XRSession.requestHitTestSource()` or `XRSession.requestHitTestSourceForTransientInput()` to perform hit testing.

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

`XRRay()` 
Experimental

Creates a new `XRRay` object.

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

`XRRay.direction` Read only  
Experimental

A `DOMPointReadOnly` representing the ray's 3-dimensional directional vector.

`XRRay.matrix` Read only  
Experimental

A transform that can be used to position objects along the `XRRay`. This is a 4 by 4 matrix given as a 16 element `Float32Array` in column major order.

`XRRay.origin` Read only  
Experimental

A `DOMPointReadOnly` representing the 3-dimensional point in space that the ray originates from, in meters.

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

None.

Examples
--------

### Using `XRRay` to request a hit test source

The `XRSession.requestHitTestSource()` method takes an `XRRay` object for its `offsetRay` option. In this example, the hit test source is positioned slightly above the viewer as the application has some UI elements at the bottom while wanting to maintain the perception of a centered cursor.


```js
const xrSession = navigator.xr.requestSession("immersive-ar", {
  requiredFeatures: ["local", "hit-test"],
});

let hitTestSource = null;

xrSession
  .requestHitTestSource({
    space: viewerSpace, // obtained from xrSession.requestReferenceSpace("viewer");
    offsetRay: new XRRay({ y: 0.5 }),
  })
  .then((viewerHitTestSource) => {
    hitTestSource = viewerHitTestSource;
  });
```

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

| Specification |
| --- |
| WebXR Hit Test Module # xrray-interface |

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

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

See also
--------

* `XRSession.requestHitTestSource()`
* `XRHitTestResult`