recursal/MDN huggingface dataset:
UIEvent: UIEvent() constructor
==============================

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

**Note:** If you construct a synthetic event using this constructor, that event will not be *trusted*, for security reasons.
 Only browser-generated `UIEvent` objects are trusted and only trusted events trigger default actions.


Syntax
------


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

### Parameters

`type`

 A string with the name of the event.
 It is case-sensitive and browsers set it to `load`, `unload`, `abort`, `error`, or `select`.


`options` Optional

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

`detail` Optional

 A number that is an event-dependent value associated with the event.
 It defaults to `0` and `UIEvent.detail` lists the semantic for standard events.


`view` Optional

The `Window` associated with the event. Its default value is `null`.

`sourceCapabilities` Optional 
Non-standard

 An `InputDeviceCapabilities` object which provides information
 about the physical device responsible for generating a touch event.



### Result value

A new `UIEvent` object.

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

| Specification |
| --- |
| UI Events # dom-uievent-uievent |

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

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

See also
--------

* `UIEvent`, the interface of the objects it constructs.
UIEvent: initUIEvent() 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.

 The **`UIEvent.initUIEvent()`** method initializes a UI event
 once it's been created.

 Events initialized in this way must have been created with the `Document.createEvent()` method. This method must be called to set the event
 before it is dispatched, using `EventTarget.dispatchEvent()`. Once
 dispatched, it doesn't do anything anymore.

**Warning:** Do not use this method anymore as it is deprecated.

Instead use specific event constructors, like `UIEvent()`. The page on Creating and triggering events gives more information about the way to use these.

Syntax
------


```js
initUIEvent(type, canBubble, cancelable, view, detail)
```

### Parameters

`type`

A string defining the type of event.

`canBubble`

 A boolean value deciding whether the event should bubble up through the
 event chain or not. Once set, the read-only property `Event.bubbles`
 will give its value.


`cancelable`

 A boolean value defining whether the event can be canceled. Once set, the
 read-only property `Event.cancelable` will give its value.


`view`

Is the WindowProxy associated with the event.

`detail`

 An `unsigned long` specifying some detail information about the
 event, depending on the type of event. For mouse events, it indicates how many times
 the mouse has been clicked on a given screen location.


### Return value

None (`undefined`).

Examples
--------


```js
const e = document.createEvent("UIEvent");
// creates a click event that bubbles, can be cancelled,
// and with its view and detail property initialized to window and 1,
// respectively
e.initUIEvent("click", true, true, window, 1);
```

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

| Specification |
| --- |
| UI Events # dom-uievent-inituievent |

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

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

See also
--------

* `UIEvent`
* The constructor to use instead of this deprecated method:
 `UIEvent()`. More specific constructors can be used
 too.
UIEvent: sourceCapabilities property
====================================

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

 The **`sourceCapabilities`** read-only property of the `UIEvent` interface returns
 an instance of the `InputDeviceCapabilities` interface which provides
 information about the physical device responsible for generating a touch event. If no
 input device was responsible for the event, it returns `null`.

 When a single user interaction with an input device generates a series of different
 input events, the `sourceCapabilities` property for all of them will point to
 the same instance of `InputDeviceCapabilities`. For example, when a user
 lifts their finger off of a touchscreen, several UIEvents may be generated including
 `touchend`, `mousedown`, `click`, and
 `focus`. All of these events must have the same
 `sourceCapabilities` representing the touchscreen.

 A device is considered "responsible" for an event only when that interaction is part of
 the abstraction provided by the web platform. For example, many user agents allow a
 window to be resized with a mouse or a keyboard, but this detail is not exposed to the
 web platform in any way, and so the sourceCapabilities of a resize event will typically
 be null.

Value
-----

An instance of `InputDeviceCapabilities`.

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

| Specification |
| --- |
| Input Device Capabilities # dom-uievent-sourcecapabilities |

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

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
UIEvent: which 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.

The **`UIEvent.which`** read-only property of the `UIEvent` interface returns a number that indicates which button was pressed on the mouse, or the numeric `keyCode` or the character code (`charCode`) of the key pressed on the keyboard.

Value
-----

### Value for KeyboardEvent 
Non-standard

 For `KeyboardEvent`, `event.which` contains the numeric code for a particular key pressed, depending on whether an alphanumeric or non-alphanumeric key was pressed.
 Please see deprecated `KeyboardEvent.charCode` and `KeyboardEvent.keyCode` for more details.

**Note:** Consider `KeyboardEvent.key` or `KeyboardEvent.code` for new code.

### Value for MouseEvent 
Non-standard

For `MouseEvent`, `event.which` is a number representing a given button:

* `0`: No button
* `1`: Left button
* `2`: Middle button (if present)
* `3`: Right button

 For a mouse configured for left-handed use, the button actions are reversed.
 In this case, the values are read from right to left.

**Note:** Consider `MouseEvent.button` for new code.

Examples
--------


```html
<html lang="en">
  <head>
    <title>charCode/keyCode/which example</title>

    <script>
 function showKeyPress(evt) {
 alert(
 `onkeypress handler:\n` +
 `keyCode property: ${evt.keyCode}\n` +
 `which property: ${evt.which}\n` +
 `charCode property: ${evt.charCode}\n` +
 `Character Key Pressed: ${String.fromCharCode(evt.charCode)}\n`,
 );
 }

 function keyDown(evt) {
 alert(
 `onkeydown handler:\n` +
 `keyCode property: ${evt.keyCode}\n` +
 `which property: ${evt.which}\n`,
 );
 }
 </script>
  </head>

  <body onkeypress="showKeyPress(event);" onkeydown="keyDown(event);">
    <p>Please press any key.</p>
  </body>
</html>
```

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

| Specification |
| --- |
| UI Events # dom-uievent-which |

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

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

See also
--------

* `KeyboardEvent`
* `MouseEvent`
UIEvent: view property
======================

 The **`UIEvent.view`** read-only property returns the
 WindowProxy object from which the event was generated. In browsers, this
 is the `Window` object the event happened in.

Value
-----

A reference to an `AbstractView` object.

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

| Specification |
| --- |
| UI Events # dom-uievent-view |

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

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

 The **`oldVersion`** read-only property of the
 `IDBVersionChangeEvent` interface returns the old version number of the
 database.

When the opened database doesn't exist yet, the value of `oldVersion` is 0.

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

Value
-----

A number containing a 64-bit integer.

Examples
--------


```js
const dbName = "sampleDB";
const dbVersion = 2;
const request = indexedDB.open(dbName, dbVersion);

request.onupgradeneeded = (e) => {
  const db = request.result;
  if (e.oldVersion < 1) {
    db.createObjectStore("store1");
  }

  if (e.oldVersion < 2) {
    db.deleteObjectStore("store1");
    db.createObjectStore("store2");
  }

  // etc. for version < 3, 4…
};
```

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

| Specification |
| --- |
| Indexed Database API 3.0 # dom-idbversionchangeevent-oldversion |

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

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

See also
--------

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

 The **`newVersion`** read-only property of the
 `IDBVersionChangeEvent` interface returns the new version number of the
 database.

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

Value
-----

A number that is a 64-bit integer or null if the database is being deleted.

Examples
--------

 In the following code snippet, we make a request to open a database, and include
 handlers for the success and error cases. These events are fired via the custom
 `IDBVersionChangeEvent` interface. For a full working example, see our To-do Notifications app (view example live).


```js
const note = document.querySelector("ul");

// Let us open version 4 of our database
const DBOpenRequest = window.indexedDB.open("toDoList", 4);

// these two event handlers act on the database being opened
DBOpenRequest.onerror = (event) => {
  note.innerHTML += "<li>Error loading database.</li>";
};

DBOpenRequest.onsuccess = (event) => {
  note.innerHTML += "<li>Database initialized.</li>";

  // store the result of opening the database in the db variable.
  // This is used a lot later on, for opening transactions and suchlike.
  const db = DBOpenRequest.result;
};
```

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

| Specification |
| --- |
| Indexed Database API 3.0 # dom-idbversionchangeevent-newversion |

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

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

See also
--------

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

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

 The **`IDBVersionChangeEvent()`** constructor
 creates a new `IDBVersionChangeEvent` object, which is used to represent
 when a version of the database has changed, as a result of the
 `onupgradeneeded` event handler.

Syntax
------


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

### Parameters

`type`

 A string with the name of the event.
 It is case-sensitive and browsers set it to `versionchange`, `success`, or `blocked`.


`options` Optional

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

`oldVersion` Optional

A number representing the previous version of the database. It defaults to `0`.

`newVersion` Optional

 An unsigned long representing the new version of the database,
 or `null` if the database is being deleted. It defaults is `null`.



### Return value

A new `IDBVersionChangeEvent` object.

Examples
--------

For a full working example, see our To-do Notifications app (view example live).

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

| Specification |
| --- |
| Indexed Database API 3.0 # dom-idbversionchangeevent-idbversionchangeevent |

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

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
WindowControlsOverlayGeometryChangeEvent: WindowControlsOverlayGeometryChangeEvent() constructor
================================================================================================

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

The **`WindowControlsOverlayGeometryChangeEvent()`** constructor returns a new `WindowControlsOverlayGeometryChangeEvent` object, representing the current geometry of a desktop Progressive Web App's title bar area.

Syntax
------


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

### Parameters

*The `WindowControlsOverlayGeometryChangeEvent()` constructor also inherits arguments from
`Event()`.*

`type`

A string indicating the event type. It is case-sensitive and browsers set it to `geometrychange`.

`options`

An object with the following properties:

`visible` Optional

A boolean flag that's true when the `titlebarAreaRect` object's values are not 0. Its default value is `false`.

`titlebarAreaRect`

A `DOMRect` representing the position and size of the title bar area.


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

| Specification |
| --- |
| Window Controls Overlay # windowcontrolsoverlay-interface |

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

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

See also
--------

* The `WindowControlsOverlayGeometryChangeEvent` interface it belongs to.
WindowControlsOverlayGeometryChangeEvent: visible property
==========================================================

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

The **`visible`** read-only property of the `WindowControlsOverlayGeometryChangeEvent` interface is a boolean flag that indicates whether the window controls overlay is visible or not in a desktop-installed Progressive Web App.

If the user opts-out of the Window Controls Overlay feature, the default title bar appears and the window controls buttons do not appear as an overlay, in which case the `visible` flag is false.

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

| Specification |
| --- |
| Window Controls Overlay # windowcontrolsoverlay-interface |

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

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

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

The **`titlebarAreaRect`** read-only property of the `WindowControlsOverlayGeometryChangeEvent` interface is a `DOMRect` representing the position and size of the area occupied by the title bar in a desktop-installed Progressive Web App.

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

| Specification |
| --- |
| Window Controls Overlay # windowcontrolsoverlay-interface |

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

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
AbsoluteOrientationSensor: AbsoluteOrientationSensor() constructor
==================================================================

The **`AbsoluteOrientationSensor()`** constructor creates a new `AbsoluteOrientationSensor` object which describes the device's physical orientation in relation to the Earth's reference coordinate system.

Syntax
------


```js
new AbsoluteOrientationSensor()
new AbsoluteOrientationSensor(options)
```

### Parameters

`options` Optional

Options are as follows:

`frequency`

The desired number of times per second a sample should be taken, meaning the number of times per second that the `reading` event will be called. A whole number or decimal may be used, the latter for frequencies less than a second. The actual reading frequency depends on the device hardware and consequently may be less than requested.

`referenceFrame`

Either `'device'` or `'screen'`. The default is `'device'`.


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

| Specification |
| --- |
| Orientation Sensor # dom-absoluteorientationsensor-absoluteorientationsensor |

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

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

See also
--------

* `reading` event
SourceBufferList: length property
=================================

 The **`length`** read-only property of the
 `SourceBufferList` interface returns the number of
 `SourceBuffer` objects in the list.

Value
-----

An unsigned long number.

Examples
--------

TBD

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

| Specification |
| --- |
| Media Source Extensions™ # dom-sourcebufferlist-length |

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

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

See also
--------

* `MediaSource`
* `SourceBuffer`
DeviceOrientationEvent: gamma property
======================================

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

 The **`gamma`** read-only property of the `DeviceOrientationEvent` interface returns the rotation of the device around the Y axis; that is, the number of degrees,
 ranged between `-90` and `90`, by which the device is tilted left
 or right.
 See Orientation and motion data explained for details.

Value
-----

A number.

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

| Specification |
| --- |
| DeviceOrientation Event Specification # ref-for-dom-deviceorientationevent-gamma② |

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

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

See also
--------

* Detecting device orientation
* Orientation and motion data explained
* `deviceorientation` event
* `deviceorientationabsolute` event
DeviceOrientationEvent: absolute property
=========================================

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

 The **`absolute`** read-only property of the `DeviceOrientationEvent` interface indicates whether or not the device is providing orientation data absolutely (that is,
 in reference to the Earth's coordinate frame) or using some arbitrary frame determined
 by the device.
 See Orientation and motion data explained for details.

Value
-----

* `true` if the orientation data in `instanceOfDeviceOrientationEvent` is provided as the difference between the Earth's coordinate frame and the device's coordinate frame
* `false` if the orientation data is being provided in reference to some arbitrary, device-determined coordinate frame.
Specifications
--------------

| Specification |
| --- |
| DeviceOrientation Event Specification # ref-for-dom-deviceorientationevent-absolute |

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

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

See also
--------

* Detecting device orientation
* Orientation and motion data explained
* `deviceorientation` event
* `deviceorientationabsolute` event
DeviceOrientationEvent: alpha property
======================================

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

 The **`alpha`** read-only property of the `DeviceOrientationEvent` interface returns the rotation of the device around the Z axis; that is, the number of degrees by
 which the device is being twisted around the center of the screen.
 See Orientation and motion data explained for details.

Value
-----

A number.

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

| Specification |
| --- |
| DeviceOrientation Event Specification # ref-for-dom-deviceorientationevent-alpha③ |

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

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

See also
--------

* Detecting device orientation
* Orientation and motion data explained
* `deviceorientation` event
* `deviceorientationabsolute` event
DeviceOrientationEvent: DeviceOrientationEvent() constructor
============================================================

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

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

Syntax
------


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

### Parameters

`type`

 A string with the name of the event.
 It is case-sensitive and browsers set it to `deviceorientation` or `deviceorientationabsolute`.
 In the latter case, `options.absolute` is always `true`.


`options` Optional

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

`alpha` Optional

 A number representing the motion of the device around the z axis,
 expressed in degrees with values ranging from 0 to 360.
 It defaults to `null`.


`beta` Optional

 A number representing the motion of the device around the x axis,
 expressed in degrees with values ranging from -180 to 180.
 This represents a front to back motion of the device.
 It defaults to `null`.


`gamma` Optional

 A number representing the motion of the device around the y axis,
 expressed in degrees with values ranging from -90 to 90.
 This represents a left to right motion of the device.
 It defaults to `null`.


`absolute`

 A boolean value that indicates whether or not the device is providing orientation data absolutely.
 It defaults to `false`.



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

A new `DeviceOrientationEvent` object.

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

| Specification |
| --- |
| DeviceOrientation Event Specification # dom-deviceorientationevent-deviceorientationevent |

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

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

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

 The **`beta`** read-only property of the `DeviceOrientationEvent` interface returns the rotation of the device around the X axis; that is, the number of degrees,
 ranged between -180 and 180, by which the device is tipped forward or backward.
 See Orientation and motion data explained for details.

Value
-----

A number.

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

| Specification |
| --- |
| DeviceOrientation Event Specification # ref-for-dom-deviceorientationevent-beta② |

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

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

See also
--------

* Detecting device orientation
* Orientation and motion data explained
* `deviceorientation` event
* `deviceorientationabsolute` event