recursal/MDN huggingface dataset:
VRDisplay: getEyeParameters() method
====================================

**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 **`getEyeParameters()`** method of the `VRDisplay` interface returns the `VREyeParameters` object containing the eye parameters for the specified eye.

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

Syntax
------


```js
getEyeParameters(whichEye)
```

### Parameters

`whichEye`

A string representing the eye you want to return the eye parameters for. Available values are `left` and `right` (defined in the VREye enum).

### Return value

A `VREyeParameters` object, or null if the VR is not able to present content (e.g. `VRDisplayCapabilities.canPresent` returns `false`).

Examples
--------

See `VREyeParameters` for example code.

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

This method 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
VRDisplay: displayId 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 **`displayId`** read-only property of the `VRDisplay` interface returns an identifier for this particular `VRDisplay`, which is also used as an association point in the Gamepad API (see `Gamepad.displayId`).

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

Value
-----

A number representing the ID of the specific `VRDisplay`.

Examples
--------

See `VRDisplayCapabilities` for example code.

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

This property 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
VRDisplay: getPose() method
===========================

**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 **`getPose()`** method of the `VRDisplay` interface returns a `VRPose` object defining the future predicted pose of the `VRDisplay` as it will be when the current frame is actually presented.

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

It was even deprecated there — instead, you should use `VRDisplay.getFrameData()`, which also provides a `VRPose` object.

Syntax
------


```js
getPose()
```

### Parameters

None.

### Return value

A `VRPose` object.

Examples
--------

Once we have a reference to a `VRDisplay` object, we can retrieve the `VRPose` representing the current pose of the display.


```js
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");

      // Return the current VRPose object for the display
      const pose = vrDisplay.getPose();

      // …
    }
  });
}
```


It is however recommended that you use the non-deprecated `pose` property of the `VRFrameData` object (retrieved via `VRDisplay.getFrameData()`) to retrieve the current pose for each frame before it is submitted to the display to be presented. This happens on each iteration of the rendering loop for your app, so you can be sure the pose data is current.

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

This method 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
VRDisplay: resetPose() method
=============================

**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 **`resetPose()`** method of the `VRDisplay` interface resets the pose for the `VRDisplay`, treating its current `VRPose.position` and `VRPose.orientation` as the "origin/zero" values.

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

After `resetPost()` has been called, future poses returned from `VRDisplay.getPose()`/`VRDisplay.getImmediatePose()` will describe positions relative to the `VRDisplay`'s position when `resetPose()` was last called and will treat the display's yaw when `resetPose()` was last called as the forward orientation.

The VRDisplay's reported roll and pitch do not change when `resetPose()` is called as they are relative to gravity. Calling `resetPose()` may change the `VRStageParameters.sittingToStandingTransform` matrix.

Syntax
------


```js
resetPose()
```

### Parameters

None.

### Return value

None (`undefined`).

Examples
--------


```js
// Assuming vrDisplay already contains a VRDisplay object,
// and we have a <button> referenced inside btn
btn.addEventListener("click", () => {
  vrDisplay.resetPose();
  console.log("Current pose set as origin/center");
});
```

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

This method 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
VRDisplay: capabilities 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 **`capabilities`** read-only property of the `VRDisplay` interface returns a `VRDisplayCapabilities` object that indicates the various capabilities of the `VRDisplay`.

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

Value
-----

A `VRDisplayCapabilities` object.

Examples
--------

See `VRDisplayCapabilities` for example code.

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

This property 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
VRDisplay: depthNear 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 **`depthNear`** property of the `VRDisplay` interface gets and sets the z-depth defining the near plane of the eye view frustum, i.e. the nearest viewable boundary of the scene.

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

Generally you should leave the value as is, but you might want to increase it if you are trying to improve performance on slower computers, and/or your UI makes sense with the near boundary made further away.

Value
-----

A double, representing the z-depth in meters; its initial value is `0.01`.

Examples
--------


```js
let vrDisplay;

navigator.getVRDisplays().then((displays) => {
  vrDisplay = displays[0];
  vrDisplay.depthNear = 1.0;
  vrDisplay.depthFar = 7500.0;
});
```

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

This property 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
VRDisplay: getImmediatePose() method
====================================

**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 **`getImmediatePose()`** method of the `VRDisplay` interface returns a `VRPose` object defining the current pose of the `VRDisplay`, with no prediction applied.

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

Syntax
------


```js
getImmediatePose()
```

### Parameters

None.

### Return value

A `VRPose` object.

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

This method 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
CSSPositionValue: CSSPositionValue() constructor
================================================

**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 **`CSSPositionValue()`** constructor
 creates a new `CSSPositionValue` object which represents values for
 properties that take a position, for example `object-position`.

Syntax
------


```js
new CSSPositionValue(x, y)
```

### Parameters

`x`

A position along the web page's horizontal axis.

`y`

A position along the web page's vertical axis.

Examples
--------

 The following example positions a container `<div>` 5 pixels from the
 top and 10 pixels from the left of the page.


```js
let someDiv = document.getElementById("container");
let position = new CSSPositionValue(CSS.px(5), CSS.px(10));

someDiv.attributeStyleMap.set("object-position", position);
console.log(position.x.value, position.y.value); // 5 10
```

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

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

See also
--------

* `CSSPositionValue.x`
* `CSSPositionValue.y`
* Using the CSS Typed OM
* CSS Typed Object Model API
CSSPositionValue: y 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 **`y`** property of the
 `CSSPositionValue` interface returns the item's position along the
 vertical axis.

Value
-----

A `CSSNumericValue`.

Examples
--------

 The following example positions a container `<div>` 5 pixels from the
 top and 10 pixels from the left of the page.


```js
let replaceEl = document.getElementById("container");
let position = new CSSPositionValue(CSS.px(5), CSS.px(10));

someDiv.attributeStyleMap.set("object-position", position);
console.log(position.x.value, position.y.value);
```

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

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

See also
--------

* `CSSPositionValue()`
* `CSSPositionValue.x`
* Using the CSS Typed OM
* CSS Typed Object Model API
CSSPositionValue: x 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 **`x`** property of the
 `CSSPositionValue` interface returns the item's position along the web
 page's horizontal axis.

Value
-----

A `CSSNumericValue`.

Examples
--------

 The following example positions a container `<div>` 5 pixels from the
 top and 10 pixels from the left of the page.


```js
let someDiv = document.getElementById("container");
let position = new CSSPositionValue(CSS.px(5), CSS.px(10));

someDiv.attributeStyleMap.set("object-position", position);
console.log(position.x.value, position.y.value);
```

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

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

See also
--------

* `CSSPositionValue()`
* `CSSPositionValue.y`
* Using the CSS Typed OM
* CSS Typed Object Model API
CloseEvent: wasClean property
=============================

The **`wasClean`** read-only property of the `CloseEvent` interface returns `true` if the connection closed cleanly.

Value
-----

A boolean value. True if the connection closed cleanly, false otherwise.

Examples
--------

The following example prints the value of `wasClean` to the console.


```js
WebSocket.onclose = (event) => {
  console.log(event.wasClean);
};
```

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

| Specification |
| --- |
| WebSockets Standard # ref-for-dom-closeevent-wasclean② |

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

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

The **`reason`** read-only property of the `CloseEvent` interface returns the WebSocket connection close reason the server gave for closing the connection; that is, a concise human-readable prose explanation for the closure.

Value
-----

A string.

Examples
--------

The following example prints the value of `reason` to the console.


```js
WebSocket.onclose = (event) => {
  console.log(event.reason);
};
```

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

| Specification |
| --- |
| WebSockets Standard # ref-for-dom-closeevent-reason② |

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

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

See also
--------

* RFC 6455 (the WebSocket Protocol specification)
CloseEvent: CloseEvent() constructor
====================================

The **`CloseEvent()`** constructor creates a new `CloseEvent` object.

Syntax
------


```js
new CloseEvent(type)
new CloseEvent(type, options)
```

### Parameters

`type`

 A string with the name of the event.
 It is case-sensitive and browsers always set it to `close`.


`options` Optional

An object that, *in addition of the properties defined in `Event()`*, has the following properties:

`wasClean` Optional

A boolean value indicating if the connection has been closed cleanly or not. It defaults to `false`.

`code` Optional

An integer representing the *connection close code* sent by the server. It defaults to `0`.

`reason` Optional

A string containing a human-readable reason describing why the server closed the connection. It defaults to `''`


Return value
------------

A new `CloseEvent` object.

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

| Specification |
| --- |
| WebSockets Standard # dom-closeevent-closeevent |

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

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

See also
--------

* `CloseEvent`, the interface of the objects it constructs.
SVGGeometryElement: pathLength property
=======================================

 The **`SVGGeometryElement.pathLength`** property reflects the
 `pathLength` attribute and returns the total length of the path, in user units.

Value
-----

A number.

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

| Specification |
| --- |
| Scalable Vector Graphics (SVG) 2 # \_\_svg\_\_SVGGeometryElement\_\_pathLength |

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

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