recursal/MDN huggingface dataset:
DeviceOrientationEvent
======================

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

The **`DeviceOrientationEvent`** interface of the Device Orientation Events provides web developers with information from the physical orientation of the device running the web page.

Event

DeviceOrientationEventConstructor
-----------

`DeviceOrientationEvent.DeviceOrientationEvent()`

Creates a new `DeviceOrientationEvent`.

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

`DeviceOrientationEvent.absolute` Read only 

A boolean that indicates whether or not the device is providing orientation data absolutely.

`DeviceOrientationEvent.alpha` Read only 

A number representing the motion of the device around the z axis, express in degrees with values ranging from 0 (inclusive) to 360 (exclusive).

`DeviceOrientationEvent.beta` Read only 

A number representing the motion of the device around the x axis, express in degrees with values ranging from -180 (inclusive) to 180 (exclusive). This represents a front to back motion of the device.

`DeviceOrientationEvent.gamma` Read only 

A number representing the motion of the device around the y axis, express in degrees with values ranging from -90 (inclusive) to 90 (exclusive). This represents a left to right motion of the device.

`DeviceOrientationEvent.webkitCompassHeading` 
Non-standard
 Read only 

A number represents the difference between the motion of the device around the z axis of the world system and the direction of the north, express in degrees with values ranging from 0 to 360.

`DeviceOrientationEvent.webkitCompassAccuracy` 
Non-standard
 Read only 

The accuracy of the compass means that the deviation is positive or negative. It's usually 10.

Example
-------


```js
window.addEventListener("deviceorientation", (event) => {
  console.log(`${event.alpha} : ${event.beta} : ${event.gamma}`);
});
```

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

| Specification |
| --- |
| DeviceOrientation Event Specification # deviceorientation |

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
* `DeviceMotionEvent`
* `devicemotion` event
* `deviceorientation` event
* `deviceorientationabsolute` event
SVGGlyphRefElement
==================

**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 **`SVGGlyphRefElement`** interface corresponds to the `<glyphRef>` elements.

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

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

`SVGGlyphRefElement.glyphRef` 
Deprecated

A string corresponding to the `glyphRef` attribute of the given element.

`SVGGlyphRefElement.format` 
Deprecated

A string corresponding to the `format` attribute of the given element.

`SVGGlyphRefElement.x` 
Deprecated

A float corresponding to the `x` attribute of the given element.

`SVGGlyphRefElement.y` 
Deprecated

A float corresponding to the `y` attribute of the given element.

`SVGGlyphRefElement.dx` 
Deprecated

A float corresponding to the `dx` attribute of the given element.

`SVGGlyphRefElement.dy` 
Deprecated

A float corresponding to the `dy` attribute of the given element.

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

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

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

| Specification |
| --- |
| Scalable Vector Graphics (SVG) 1.1 (Second Edition) # InterfaceSVGGlyphRefElement |

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

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

See also
--------

* `<glyphRef>`
SVGHKernElement
===============

**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 **`SVGHKernElement`** interface corresponds to the `<hkern>` elements.

Object-oriented access to the attributes of the `<hkern>` element via the SVG DOM is not possible.

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

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

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

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

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

| Specification |
| --- |
| Scalable Vector Graphics (SVG) 1.1 (Second Edition) # InterfaceSVGHKernElement |

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

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

See also
--------

* `<hkern>`
SecurityPolicyViolationEvent
============================

The **`SecurityPolicyViolationEvent`** interface inherits from `Event`, and represents the event object of an event sent on a document or worker when its content security policy is violated.

Event

SecurityPolicyViolationEventConstructor
-----------

`SecurityPolicyViolationEvent()`

Creates a new `SecurityPolicyViolationEvent` object instance.

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

`SecurityPolicyViolationEvent.blockedURI` Read only 

A string representing the URI of the resource that was blocked because it violates a policy.

`SecurityPolicyViolationEvent.columnNumber` Read only 

The column number in the document or worker at which the violation occurred.

`SecurityPolicyViolationEvent.disposition` Read only 

Indicates how the violated policy is configured to be treated by the user agent. This will be `"enforce"` or `"report"`.

`SecurityPolicyViolationEvent.documentURI` Read only 

A string representing the URI of the document or worker in which the violation was found.

`SecurityPolicyViolationEvent.effectiveDirective` Read only 

A string representing the directive whose enforcement uncovered the violation.

`SecurityPolicyViolationEvent.lineNumber` Read only 

The line number in the document or worker at which the violation occurred.

`SecurityPolicyViolationEvent.originalPolicy` Read only 

A string containing the policy whose enforcement uncovered the violation.

`SecurityPolicyViolationEvent.referrer` Read only 

A string representing the URL for the referrer of the resources whose policy was violated, or `null`.

`SecurityPolicyViolationEvent.sample` Read only 

A string representing a sample of the resource that caused the violation, usually the first 40 characters. This will only be populated if the resource is an inline script, event handler, or style — external resources causing a violation will not generate a sample.

`SecurityPolicyViolationEvent.sourceFile` Read only 

If the violation occurred as a result of a script, this will be the URL of the script; otherwise, it will be `null`. Both `columnNumber` and `lineNumber` should have non-null values if this property is not `null`.

`SecurityPolicyViolationEvent.statusCode` Read only 

A number representing the HTTP status code of the document or worker in which the violation occurred.

`SecurityPolicyViolationEvent.violatedDirective` Read only 

A string representing the directive whose enforcement uncovered the violation.

Examples
--------


```js
document.addEventListener("securitypolicyviolation", (e) => {
  console.log(e.blockedURI);
  console.log(e.violatedDirective);
  console.log(e.originalPolicy);
});
```

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

| Specification |
| --- |
| Content Security Policy Level 3 # report-violation |

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

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

See also
--------

* Content Security Policy (CSP)
MIDIInputMap
============

The **`MIDIInputMap`** read-only interface of the Web MIDI API provides the set of MIDI input ports that are currently available.

A `MIDIInputMap` instance is a read-only `Map`-like object, in which each key is the ID string for MIDI input, and the associated value is the corresponding `MIDIInput` object.

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

| Specification |
| --- |
| Web MIDI API # midiinputmap-interface |

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

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

The **`HTMLOptionsCollection`** interface represents a collection of `<option>` HTML elements (in document order) and offers methods and properties for selecting from the list as well as optionally altering its items. This object is returned only by the `options` property of select.

HTMLCollection

HTMLOptionsCollectionInstance properties
-------------------

`length`

`unsigned long`. As optionally allowed by the spec, this property isn't read-only. You can either remove options from the end by lowering the value, or add blank options at the end by raising the value. Mozilla allows this, while other implementations could potentially throw a DOMException.

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

*This interface inherits the methods of its parent, `HTMLCollection`.*

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

| Specification |
| --- |
| HTML Standard # the-htmloptionscollection-interface |

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

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

See also
--------

* HTMLCollection
VRPose
======

**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 **`VRPose`** interface of the WebVR API represents the state of a VR sensor at a given timestamp (which includes orientation, position, velocity, and acceleration information).

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

This interface is accessible through the `VRDisplay.getPose()` and `VRDisplay.getFrameData()` methods. `VRDisplay.getPose()` is deprecated.

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

`VRPose.position` 
Deprecated
 Read only  
Non-standard

Returns the position of the `VRDisplay` at the current `VRFrameData.timestamp` as a 3D vector

`VRPose.linearVelocity` 
Deprecated
 Read only  
Non-standard

Returns the linear velocity of the `VRDisplay` at the current `VRFrameData.timestamp`, in meters per second.

`VRPose.linearAcceleration` 
Deprecated
 Read only  
Non-standard

Returns the linear acceleration of the `VRDisplay` at the current `VRFrameData.timestamp`, in meters per second per second.

`VRPose.orientation` 
Deprecated
 Read only  
Non-standard

Returns the orientation of the sensor at the current `VRFrameData.timestamp`, as a quarternion value.

`VRPose.angularVelocity` 
Deprecated
 Read only  
Non-standard

Returns the angular velocity of the `VRDisplay` at the current `VRFrameData.timestamp`, in radians per second.

`VRPose.angularAcceleration` 
Deprecated
 Read only  
Non-standard

Returns the angular acceleration of the `VRDisplay` at the current `VRFrameData.timestamp`, in meters per second per second.

Examples
--------

See `VRDisplay.getFrameData()` for example code.

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

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

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

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

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

See also
--------

* WebVR API
BackgroundFetchEvent
====================

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 **`BackgroundFetchEvent`** interface of the Background Fetch API is the event type for background fetch events dispatched on the `service worker global scope`.

It is the event type passed to `onbackgroundfetchabort` and `onbackgroundfetchclick`.

Event

ExtendableEvent

BackgroundFetchEventConstructor
-----------

`BackgroundFetchEvent()` 
Experimental

Creates a new `BackgroundFetchEvent` object. This constructor is not typically used, as the browser creates these objects itself and provides them to background fetch event callbacks.

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

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

`BackgroundFetchEvent.registration` Read only  
Experimental

Returns the `BackgroundFetchRegistration` that the event was initialized to.

### Event handlers

None.

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

None.

Examples
--------

In this example, if the user clicks on the user interface displaying the download progress, a new window will open. The current `BackgroundFetchRegistration` is returned by calling `event.registration`.


```js
addEventListener("backgroundfetchclick", (event) => {
  const bgFetch = event.registration;

  if (bgFetch.result === "success") {
    clients.openWindow("/latest-podcasts");
  } else {
    clients.openWindow("/download-progress");
  }
});
```

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

| Specification |
| --- |
| Background Fetch # background-fetch-event |

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

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

**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 **`NDEFRecord`** interface of the Web NFC API provides data that can be read from, or written to, compatible NFC devices, e.g. NFC tags supporting NDEF.

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

`NDEFRecord()` 
Experimental

Returns a new `NDEFRecord`.

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

`NDEFRecord.recordType` 
Experimental
 Read only 

Returns the record type of the record. Records must have either a standardized well-known type name such as `"empty"`, `"text"`, `"url"`, `"smart-poster"`, `"absolute-url"`, `"mime"`, or `"unknown"` or else an external type name, which consists of a domain name and custom type name separated by a colon (":").

`NDEFRecord.mediaType` 
Experimental
 Read only 

Returns the MIME type of the record. This value will be `null` if `recordType` is not equal to `"mime"`.

`NDEFRecord.id` 
Experimental
 Read only 

Returns the record identifier, which is an absolute or relative URL used to identify the record.

**Note:** The uniqueness of the identifier is enforced only by the generator of the record.

`NDEFRecord.data` 
Experimental
 Read only 

Returns a `DataView` containing the raw bytes of the record's payload.

`NDEFRecord.encoding` 
Experimental
 Read only 

Returns the encoding of a textual payload, or `null` otherwise.

`NDEFRecord.lang` 
Experimental
 Read only 

Returns the language of a textual payload, or `null` if one was not supplied.

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

`NDEFRecord.toRecords()` 
Experimental

Converts `NDEFRecord.data` to a sequence of records. This allows parsing the payloads of record types which may contain nested records, such as smart poster and external type records.

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

| Specification |
| --- |
| Web NFC API # dom-ndefrecord |

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

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

The **`TextEncoderStream`** interface of the Encoding API converts a stream of strings into bytes in the UTF-8 encoding. It is the streaming equivalent of `TextEncoder`.

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

`TextEncoderStream()`

Creates a new `TextEncoderStream` object.

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

`TextEncoderStream.encoding` Read only 

Always returns "`utf-8`".

`TextEncoderStream.readable` Read only 

Returns the `ReadableStream` instance controlled by this object.

`TextEncoderStream.writable` Read only 

Returns the `WritableStream` instance controlled by this object.

Examples
--------

* Examples of streaming structured data and HTML
* An example of fetch request streams which uses `TextEncoderStream` to upload the data.
Specifications
--------------

| Specification |
| --- |
| Encoding Standard # interface-textencoderstream |

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

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

See also
--------

* `TextDecoderStream`
* Streams API Concepts
* Experimenting with the Streams API
CharacterData
=============

The **`CharacterData`** abstract interface represents a `Node` object that contains characters. This is an abstract interface, meaning there aren't any objects of type `CharacterData`: it is implemented by other interfaces like `Text`, `Comment`, `CDATASection`, or `ProcessingInstruction`, which aren't abstract.

EventTarget

Node

CharacterDataInstance properties
-------------------

*This interface also inherits properties from its parents, `Node` and `EventTarget`.*

`CharacterData.data`

A string representing the textual data contained in this object.

`CharacterData.length` Read only 

Returns a number representing the size of the string contained in the object.

`CharacterData.nextElementSibling` Read only 

Returns the first `Element` that *follows* this node, and is a sibling.

`CharacterData.previousElementSibling` Read only 

Returns the first `Element` that *precedes* this node, and is a sibling.

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

*This interface also inherits methods from its parents, `Node` and `EventTarget`.*

`CharacterData.after()`

 Inserts a set of `Node` objects or strings in the children list of the
 `CharacterData`'s parent, just after the `CharacterData` object.


`CharacterData.appendData()`

Appends the given string to the `CharacterData.data` string; when this method returns, `data` contains the concatenated string.

`CharacterData.before()`

 Inserts a set of `Node` objects or strings in the children list of the
 `CharacterData`'s parent, just before the `CharacterData` object.


`CharacterData.deleteData()`

Removes the specified amount of characters, starting at the specified offset, from the `CharacterData.data` string; when this method returns, `data` contains the shortened string.

`CharacterData.insertData()`

Inserts the specified characters, at the specified offset, in the `CharacterData.data` string; when this method returns, `data` contains the modified string.

`CharacterData.remove()`

Removes the object from its parent children list.

`CharacterData.replaceData()`

Replaces the specified amount of characters, starting at the specified offset, with the specified string; when this method returns, `data` contains the modified string.

`CharacterData.replaceWith()`

Replaces the characters in the children list of its parent with a set of `Node` objects or strings.

`CharacterData.substringData()`

Returns a string containing the part of `CharacterData.data` of the specified length and starting at the specified offset.

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

| Specification |
| --- |
| DOM Standard # interface-characterdata |

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

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

See also
--------

* The DOM overview page.
* The concrete interfaces implemented it: `Text`, `CDATASection`, `ProcessingInstruction`, and `Comment`.
USBAlternateInterface
=====================

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
**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 `USBAlternateInterface` interface of the WebUSB API provides information about a particular configuration of an interface provided by the USB device. An interface includes one or more alternate settings which can configure a set of endpoints based on the operating mode of the device.

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

`USBAlternateInterface()` 
Experimental

Creates a new `USBAlternateInterface` object which will be populated with information about the alternate interface of the provided `USBInterface` with the given alternate setting number.

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

`USBAlternateInterface.alternateSetting` Read only  
Experimental

Returns the alternate setting number of this interface. This is equal to the `bAlternateSetting` field of the interface descriptor defining this interface.

`USBAlternateInterface.interfaceClass` Read only  
Experimental

Returns the class of this interface. This is equal to the `bInterfaceClass` field of the interface descriptor defining this interface. Standardized values for this field are defined by the USB Implementers Forum. A value of `0xFF` indicates a vendor-defined interface.

`USBAlternateInterface.interfaceSubclass` Read only  
Experimental

Returns the subclass of this interface. This is equal to the `bInterfaceSubClass` field of the interface descriptor defining this interface. The meaning of this value depends on the `interfaceClass` field.

`USBAlternateInterface.interfaceProtocol` Read only  
Experimental

Returns the protocol supported by this interface. This is equal to the `bInterfaceProtocol` field of the interface descriptor defining this interface. The meaning of this value depends on the `interfaceClass` and `interfaceSubclass` fields.

`USBAlternateInterface.interfaceName` Read only  
Experimental

Returns the name of the interface, if one is provided by the device. This is the value of the string descriptor with the index specified by the `iInterface` field of the interface descriptor defining this interface.

`USBAlternateInterface.endpoints` Read only  
Experimental

Returns an array containing instances of the `USBEndpoint` interface describing each of the endpoints that are part of this interface.

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

| Specification |
| --- |
| WebUSB API # usbalternateinterface |

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

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