recursal/MDN huggingface dataset:
FileSystemEntry: fullPath property
==================================

 The read-only **`fullPath`** property
 of the `FileSystemEntry` interface returns a string
 specifying the full, absolute path from the file system's root to the file represented
 by the entry.

 This can also be thought of as a path which is relative to the root directory, with a
 "/" prepended to it to make it absolute.

Value
-----

A string indicating the entry's full path.

Examples
--------

 This example shows a function which is called with a file system; it then gets a
 `FileSystemFileEntry` for a file named `data.json` and returns
 its full path.


```js
function gotFileSystem(fs) {
  let path = "";

  fs.root.getFile(
    "data.json",
    { create: true, exclusive: true },
    (entry) => {
      path = fullPath;
    },
    handleError(error),
  );

  return path;
}
```


 Obviously, this is somewhat contrived, since we know that the file's full path is
 `"/data.json"`, having just looked it up ourselves, but the concept holds up
 for scenarios in which you don't know it.

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

| Specification |
| --- |
| File and Directory Entries API # dom-filesystementry-fullpath |

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

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

See also
--------

* File and Directory Entries API
* Introduction to the File and Directory Entries API
* `FileSystemEntry`
GPUQuerySet: destroy() method
=============================

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

 The **`destroy()`** method of the
 `GPUQuerySet` interface destroys the `GPUQuerySet`.

Syntax
------


```js
destroy()
```

### Parameters

None.

### Return value

None (`Undefined`).

Examples
--------


```js
const querySet = device.createQuerySet({
  type: "occlusion",
  count: 32,
});

// Some time later

querySet.destroy();
```

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

| Specification |
| --- |
| WebGPU # dom-gpuqueryset-destroy |

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

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

See also
--------

* The WebGPU API
GPUQuerySet: type property
==========================

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

 The **`type`** read-only property of the
 `GPUQuerySet` interface is an enumerated value specifying the type of queries managed by the `GPUQuerySet`.

Value
-----

An enumerated value. Possible values are:

`"occlusion"`

The `GPUQuerySet` manages occlusion queries.

`"timestamp"`

The `GPUQuerySet` manages timestamp queries.

Examples
--------

See the main `GPUQuerySet` page for an example.

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

| Specification |
| --- |
| WebGPU # dom-gpuqueryset-type |

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

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

See also
--------

* The WebGPU API
GPUQuerySet: label property
===========================

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

 The **`label`** property of the
 `GPUQuerySet` interface is a string providing a label that can be used to identify the object, for example in `GPUError` messages or console warnings.

This can be set by providing a `label` property in the descriptor object passed into the originating `GPUDevice.createQuerySet()` call, or you can get and set it directly on the `GPUQuerySet` object.

Value
-----

A string. If this has not been previously set as described above, it will be an empty string.

Examples
--------

Setting and getting a label via `GPUQuerySet.label`:


```js
const querySet = device.createQuerySet({
  type: "occlusion",
  count: 32,
});

querySet.label = "myqueryset";

console.log(querySet.label); // "myqueryset"
```


Setting a label via the originating `GPUDevice.createQuerySet()` call, and then getting it via `GPUQuerySet.label`:


```js
const querySet = device.createQuerySet({
  type: "occlusion",
  count: 32,
  label: "myqueryset",
});

console.log(querySet.label); // "myqueryset"
```

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

| Specification |
| --- |
| WebGPU # dom-gpuobjectbase-label |

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

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

See also
--------

* The WebGPU API
GPUQuerySet: count property
===========================

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

 The **`count`** read-only property of the
 `GPUQuerySet` interface is a number specifying the number of queries managed by the `GPUQuerySet`.

Value
-----

A number.

Examples
--------

See the main `GPUQuerySet` page for an example.

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

| Specification |
| --- |
| WebGPU # dom-gpuqueryset-count |

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

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

See also
--------

* The WebGPU API
DOMPointReadOnly: z property
============================

 The **`DOMPointReadOnly`** interface's
 **`z`** property holds the depth coordinate, z, for a
 read-only point in space.

 If your script needs to be able to change the value
 of this property, you should instead use the `DOMPoint` object.

 In general, positive values of `z` mean toward the user (out from the
 screen), and negative values of `z` mean away from the user (into the
 screen), assuming no transforms have resulted in a reversal.

Value
-----

 A double-precision floating-point value indicating the z coordinate's value for the
 point. This value is **unrestricted**, meaning that it is allowed to be
 infinite or invalid (that is, its value may be `NaN` or `±Infinity`).

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

| Specification |
| --- |
| Geometry Interfaces Module Level 1 # dom-dompointreadonly-z |

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

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

See also
--------

* The other coordinate properties: `x`,
 `y`, and the perspective value,
 `w`.
DOMPointReadOnly: w property
============================

 The **`DOMPointReadOnly`** interface's
 **`w`** property holds the point's perspective value,
 `w`, for a read-only point in space.

 If your script needs to be able
 to change the value of this property, you should instead use the `DOMPoint`
 object.

Value
-----

 A double-precision floating-point value indicating the `w` perspective value
 for the point. This value is **unrestricted**, meaning that it is allowed
 to be infinite or invalid (that is, its value may be `NaN` or
 `±Infinity`). The default is `1.0`.

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

| Specification |
| --- |
| Geometry Interfaces Module Level 1 # dom-dompointreadonly-w |

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

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

See also
--------

* The other coordinate properties: `x`,
 `y`, and `z`.
DOMPointReadOnly: y property
============================

 The **`DOMPointReadOnly`** interface's
 **`y`** property holds the vertical coordinate, y, for a
 read-only point in space.

 If your script needs to be able to change the value
 of this property, you should instead use the `DOMPoint` object.

 In general, positive values of `y` mean downward, and negative values of
 `y` mean upward, assuming no transforms have resulted in a reversal.

Value
-----

 A double-precision floating-point value indicating the y coordinate's value for the
 point. This value is **unrestricted**, meaning that it is allowed to be
 infinite or invalid (that is, its value may be `NaN` or `±Infinity`).

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

| Specification |
| --- |
| Geometry Interfaces Module Level 1 # dom-dompointreadonly-y |

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

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

See also
--------

* The other coordinate properties: `x`,
 `z`, and the perspective value,
 `w`.
DOMPointReadOnly: x property
============================

 The **`DOMPointReadOnly`** interface's
 **`x`** property holds the horizontal coordinate, x, for a
 read-only point in space. This property cannot be changed by JavaScript code in this
 read-only version of the `DOMPoint` object.

 In general, positive values `x` mean to the right, and negative values of
 `x` means to the left, assuming no transforms have resulted in a reversal.

Value
-----

 A double-precision floating-point value indicating the x coordinate's value for the
 point. This value is **unrestricted**, meaning that it is allowed to be
 infinite or invalid (that is, its value may be `NaN` or `±Infinity`).

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

| Specification |
| --- |
| Geometry Interfaces Module Level 1 # dom-dompointreadonly-x |

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

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

See also
--------

* The other coordinate properties: `y`,
 `z`, and the perspective value,
 `w`.
DOMPointReadOnly: DOMPointReadOnly() constructor
================================================

 The **`DOMPointReadOnly()`**
 constructor returns a new `DOMPointReadOnly` object representing a point
 in 2D or 3D space, optionally with perspective, whose values cannot be altered by
 script code.

Syntax
------


```js
new DOMPointReadOnly()
new DOMPointReadOnly(x)
new DOMPointReadOnly(x, y)
new DOMPointReadOnly(x, y, z)
new DOMPointReadOnly(x, y, z, w)
```

### Parameters

`x` Optional

 The value of the horizontal coordinate, x, as a floating point number. The default
 value is 0.


`y` Optional

 The value of the vertical coordinate, y, as a floating point number. The default
 value is 0.


`z` Optional

 The value of the depth coordinate, z, as a floating point number. The default value
 is 0.


`w` Optional

The value of the perspective, w, as a floating point number. The default is 1.



**Note:** Each of these values is what's called an *unrestricted*
 number. In addition to any finite floating-point value, you may use special values
 such as ±`Infinity` and `NaN`.


### Return value

 A new `DOMPointReadOnly` object representing the specified location in
 space.

Examples
--------

The following code demonstrates creating both 2D and 3D points.


```js
const point2D = new DOMPointReadOnly(50, 25);
const point3D = new DOMPointReadOnly(50, 0, 10);
const perspectivePoint3D = new DOMPointReadOnly(50, 50, 25, 0.5);
```

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

| Specification |
| --- |
| Geometry Interfaces Module Level 1 # dom-dompointreadonly-dompointreadonly |

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

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
DOMPointReadOnly: fromPoint() static method
===========================================

 The static **`DOMPointReadOnly`**
 method `fromPoint()` creates and returns a new
 `DOMPointReadOnly` object given a source point.

 You can also create a new `DOMPointReadOnly` object using the
 `new DOMPointReadOnly()` constructor.

Syntax
------


```js
DOMPointReadOnly.fromPoint(sourcePoint)
```

### Parameters

`sourcePoint`

 A `DOMPoint` or `DOMPointReadOnly` instance, or an object containing the following properties, from which to take the
 values of the new point's properties:


`x`

An unrestricted floating-point value indicating the `x`-coordinate of the point in space. This is generally the horizontal coordinate, with positive values being to the right and negative values to the left. The default value is `0`.

`y`

An unrestricted floating-point number providing the point's `y`-coordinate. This is the vertical coordinate, and barring any transforms applied to the coordinate system, positive values are downward and negative values upward toward the top of the screen. The default is `0`.

`z`

An unrestricted floating-point value which gives the point's `z`-coordinate, which is (assuming no transformations that alter the situation) the depth coordinate; positive values are closer to the user and negative values retreat back into the screen. The default value is `0`.

`w`

The point's `w` perspective value, given as an unrestricted floating-point number. The default is `1`.


### Return value

A new `DOMPointReadOnly` object (which is identical to the source point).

Examples
--------

### Creating a 2D point

 This sample creates a 2D point, specifying an inline object that includes the values to
 use for `x` and `y`. The `z` and `w` properties are allowed to keep their
 default values (`0` and `1` respectively).


```js
const point2D = DOMPointReadOnly.fromPoint({ x: 25, y: 25 });
```

### Creating a 3D point using an existing point

 This example creates a point, `origPoint`, of type
 `DOMPoint`, using `new DOMPoint()`. That
 point is then used as the input for `fromPoint()` to create a new point,
 `newPoint`.


```js
const origPoint = new DOMPoint(25, 25, 100, 0.5);

const newPoint = DOMPointReadOnly.fromPoint(origPoint);
```

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

| Specification |
| --- |
| Geometry Interfaces Module Level 1 # dom-dompointreadonly-frompoint |

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

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
DOMPointReadOnly: toJSON() method
=================================

 The `DOMPointReadOnly` method
 `toJSON()` returns an object giving the
 JSON form of the point object.

Syntax
------


```js
toJSON()
```

### Parameters

None.

### Return value

 A new object whose properties are set to the values in the
 `DOMPoint` or `DOMPointReadOnly` on which the method was called.

Examples
--------

 This example creates a `DOMPoint` object representing the top-left corner
 of the current window, in screen coordinates, then converts that to JSON.


```js
const topLeft = new DOMPoint(window.screenX, window.screenY);

const pointJSON = topLeft.toJSON();
```

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

| Specification |
| --- |
| Geometry Interfaces Module Level 1 # dom-dompointreadonly-tojson |

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

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
HTMLCanvasElement: height property
==================================

 The **`HTMLCanvasElement.height`** property is a
 positive `integer` reflecting the `height` HTML
 attribute of the `<canvas>` element interpreted in CSS pixels. When the
 attribute is not specified, or if it is set to an invalid value, like a negative, the
 default value of `150` is used.

 This is one of the two properties, the other being
 `HTMLCanvasElement.width`, that controls the size of the canvas.

Value
-----

A number.

Examples
--------

Given this `<canvas>` element:


```html
<canvas id="canvas" width="300" height="300"></canvas>
```


You can get the height of the canvas with the following code:


```js
const canvas = document.getElementById("canvas");
console.log(canvas.height); // 300
```

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

| Specification |
| --- |
| HTML Standard # dom-canvas-height |

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

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

See also
--------

* `HTMLCanvasElement`: Interface used to define the `HTMLCanvasElement.height` property
* `HTMLCanvasElement.width`: Other property used to control the size of the canvas
* `HTMLImageElement.width`
* `HTMLObjectElement.width`
* `HTMLVideoElement.width`
HTMLCanvasElement: contextrestored event
========================================

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
**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

The **`contextrestored`** event of the Canvas API is fired if the user agent restores the backing storage for a `CanvasRenderingContext2D`.

You can redraw, re-retrieve resources, and reinitialize the state of your context after receiving this event.

Syntax
------

Use the event name in methods like `addEventListener()`, or set an event handler property.


```js
addEventListener("contextrestored", (event) => {});

oncontextrestored = (event) => {};
```

Event type
----------

A generic `Event`.

Example
-------

The code fragment below detects the context restored event.


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

canvas.addEventListener(
  "contextrestored",
  (e) => {
    console.log(e);
    // call to redrawCanvas() or similar
  },
  false,
);
```

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

| Specification |
| --- |
| HTML Standard # event-contextrestored |

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

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

See also
--------

* `HTMLCanvasElement: contextlost` event
* `CanvasRenderingContext2D.isContextLost()`
HTMLCanvasElement: webglcontextcreationerror event
==================================================

The **`webglcontextcreationerror`** event of the WebGL API is fired if the user agent is unable to create a `WebGLRenderingContext` context.

This event has a `WebGLContextEvent.statusMessage` property, which can contain a platform dependent string with more information about the failure.

This event does not bubble.

Syntax
------

Use the event name in methods like `addEventListener()`, or set an event handler property.


```js
addEventListener("webglcontextcreationerror", (event) => {});

onwebglcontextcreationerror = (event) => {};
```

Event type
----------

A `WebGLContextEvent`. Inherits from `Event`.

Event

WebGLContextEventEvent properties
----------------

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

`WebGLContextEvent.statusMessage`

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

Example
-------


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

canvas.addEventListener(
  "webglcontextcreationerror",
  (e) => {
    console.log(e.statusMessage || "Unknown error");
  },
  false,
);

const gl = canvas.getContext("webgl");
// logs statusMessage or "Unknown error" if unable to create WebGL context
```

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

| Specification |
| --- |
| WebGL Specification # 5.15.4 |

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

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

See also
--------

* `WebGLContextEvent`
* `WebGLRenderingContext.isContextLost()`
* `WEBGL_lose_context`, `WEBGL_lose_context.loseContext()`, `WEBGL_lose_context.restoreContext()`
HTMLCanvasElement: captureStream() method
=========================================

 The **`captureStream()`** method of the `HTMLCanvasElement` interface returns a `MediaStream`
 which includes a `CanvasCaptureMediaStreamTrack` containing a real-time video capture of the canvas's contents.

Syntax
------


```js
captureStream()
captureStream(frameRate)
```

### Parameters

`frameRate` Optional

 A double-precision floating-point value that indicates the rate of capture of each
 frame. If not set, a new frame will be captured each time the canvas changes; if set
 to `0`, frames will not be captured automatically; instead, they will only
 be captured when the returned track's
 `requestFrame()` method is
 called.


### Return value

 A reference to a `MediaStream` object, which has a single
 `CanvasCaptureMediaStreamTrack` in it.

### Exceptions

`NotSupportedError` `DOMException`

Thrown if the value of `frameRate` is negative.

`SecurityError` `DOMException`

 The canvas's bitmap is not origin clean;
 at least some of its contents have or may have been loaded from a site other than the one from which the document itself was loaded.


Example
-------


```js
// Find the canvas element to capture
const canvasElt = document.querySelector("canvas");

// Get the stream
const stream = canvasElt.captureStream(25); // 25 FPS

// Do things to the stream
// E.g. Send it to another computer using an RTCPeerConnection
// pc is an RTCPeerConnection created elsewhere
stream.getTracks().forEach((track) => pc.addTrack(track, stream));
```

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

| Specification |
| --- |
| Media Capture from DOM Elements # dom-htmlcanvaselement-capturestream |

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

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

See also
--------

* `HTMLMediaElement.captureStream()`, which allows capturing a stream
 from a media element.
* `MediaStream`
* `Media Capture and Streams API`
HTMLCanvasElement: mozOpaque property
=====================================

**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 non-standard **`HTMLCanvasElement.mozOpaque`** property is
 a boolean value reflecting the `moz-opaque` HTML
 attribute of the `<canvas>` element. It lets the canvas know whether or
 not translucency will be a factor. If the canvas knows there's no translucency, painting
 performance can be optimized.


**Note:** This has been standardized as setting the `alpha` option to
 `false` when creating a drawing context with
 `HTMLCanvasElement.getContext()`. Use of `mozOpaque` should be
 avoided. Firefox will stop supporting it in the future.


Value
-----

A boolean value.

Examples
--------

Given this `<canvas>` element:


```html
<canvas id="canvas" width="300" height="300" moz-opaque></canvas>
```


 You can get or set the `mozOpaque` property. For example, you could
 conditionally set it to `true` if `mimeType === 'image/jpeg'`, or
 similar, to gain performance in your application when translucency is not needed.


```js
const canvas = document.getElementById("canvas");
console.log(canvas.mozOpaque); // true
// deactivate it
canvas.mozOpaque = false;
```

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

Not part of any standard.

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

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

See also
--------

* `HTMLCanvasElement`: Interface used to define the `HTMLCanvasElement.mozOpaque` property
* `moz-opaque`: HTML attribute of the `<canvas>` element
* Optimizing your JavaScript game for Firefox OS