recursal/MDN huggingface dataset:
XRCompositionLayer
==================

**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 **`XRCompositionLayer`** interface of the WebXR Device API is a base class that defines a set of common properties and behaviors for WebXR layer types. It is not constructable on its own.

Several layer types inherit from `XRCompositionLayer`:

* `XREquirectLayer`
* `XRCubeLayer`
* `XRCylinderLayer`
* `XRProjectionLayer`
* `XRQuadLayer`

`XRCompositionLayer` itself inherits from the general `XRLayer` class (which inherits from `EventTarget`).

EventTarget

XRLayer

XRCompositionLayerInstance properties
-------------------

`XRCompositionLayer.blendTextureSourceAlpha` 
Experimental

A boolean enabling the layer's texture alpha channel.

`XRCompositionLayer.layout` Read only  
Experimental

The layout type of the layer.

`XRCompositionLayer.mipLevels` Read only  
Experimental

The number of mip levels in the color and texture data for the layer.

`XRCompositionLayer.needsRedraw` Read only  
Experimental

A boolean signaling that the layer should be re-rendered in the next frame.

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

*Inherits methods from its parent, `EventTarget`*.

`XRCompositionLayer.destroy()` 
Experimental

Deletes the underlying layer attachments.

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

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

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

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

See also
--------

* `XRLayer`
* `EventTarget`
* `XREquirectLayer`
* `XRCubeLayer`
* `XRCylinderLayer`
* `XRProjectionLayer`
* `XRQuadLayer`
FragmentDirective
=================

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

The **`FragmentDirective`** interface is an object exposed for feature detectability, that is, whether or not a browser supports text fragments.

It is accessed via the `Document.fragmentDirective` property.

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

None.

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

None.

Examples
--------

Try running the following in a supporting browser's devtools, in a tab with one or more matched text fragments:


```js
document.fragmentDirective;
// returns an empty FragmentDirective object, if supported
// undefined otherwise
```


This functionality is mainly intended for feature detection at present. In the future, the `FragmentDirective` object could include additional information.

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

| Specification |
| --- |
| URL Fragment Text Directives # fragmentdirective |

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

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

See also
--------

* Text fragments
* `::target-text`
isSecureContext global property
===============================

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

 The global **`isSecureContext`** read-only property returns a boolean indicating whether
 the current context is secure
 (`true`) or not (`false`).

Value
-----

Boolean `true` or `false`.

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

| Specification |
| --- |
| HTML Standard # dom-issecurecontext-dev |

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

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

See also
--------

* Secure contexts
HTMLStyleElement
================

The **`HTMLStyleElement`** interface represents a `<style>` element. It inherits properties and methods from its parent, `HTMLElement`.

This interface doesn't allow to manipulate the CSS it contains (in most case). To manipulate CSS, see Using dynamic styling information for an overview of the objects used to manipulate specified CSS properties using the DOM.

EventTarget

Node

Element

HTMLElement

HTMLStyleElementInstance properties
-------------------

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

`HTMLStyleElement.media`

A string reflecting the HTML attribute representing the intended destination medium for style information.

`HTMLStyleElement.type` 
Deprecated

A string reflecting the HTML attribute representing the type of style being applied by this statement.

`HTMLStyleElement.disabled`

A boolean value indicating whether or not the associated stylesheet is disabled.

`HTMLStyleElement.sheet` Read only 

Returns the `CSSStyleSheet` object associated with the given element, or `null` if there is none.

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

*No specific method; inherits methods from its parent, `HTMLElement`.*

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

| Specification |
| --- |
| HTML Standard # htmlstyleelement |

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

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

See also
--------

* The HTML element implementing this interface: `<style>`.
* Using dynamic styling information to see how to manipulate CSS.
SharedStorageWorklet
====================

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

The **`SharedStorageWorklet`** interface of the Shared Storage API represents the shared storage worklet for the current origin.

`SharedStorageWorklet` does not have its own properties or methods. Rather, it inherits the `addModule()` method from the `Worklet` interface. This method is used for adding a module.

Unlike a regular `Worklet`:

* If the calling site has not included the Shared Storage API in a privacy sandbox enrollment process, calls to `sharedStorageWorklet.addModule()` will be rejected.
* `SharedStorageWorklet` allows only a single module to be added, for privacy reasons. Even with a successful enrollment, repeated calls to `addModule()` on the same shared storage worklet will be rejected.

`SharedStorageWorklet` is accessed via `WindowSharedStorage.worklet`.

Worklet

SharedStorageWorkletExamples
--------


```js
// Randomly assigns a user to a group 0 or 1
function getExperimentGroup() {
  return Math.round(Math.random());
}

async function injectContent() {
  // Add the module to the shared storage worklet
  await window.sharedStorage.worklet.addModule("ab-testing-worklet.js");

  // Assign user to a random group (0 or 1) and store it in shared storage
  window.sharedStorage.set("ab-testing-group", getExperimentGroup(), {
    ignoreIfPresent: true,
  });

  // Run the URL selection operation
  const fencedFrameConfig = await window.sharedStorage.selectURL(
    "ab-testing",
    [
      { url: `https://your-server.example/content/default-content.html` },
      { url: `https://your-server.example/content/experiment-content-a.html` },
    ],
    {
      resolveToConfig: true,
    },
  );

  // Render the chosen URL into a fenced frame
  document.getElementById("content-slot").config = fencedFrameConfig;
}

injectContent();
```


See the Shared Storage API landing page for a walkthrough of this example and links to other examples.

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

| Specification |
| --- |
| Shared Storage API # sharedstorageworklet |

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

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

See also
--------

* Shared Storage API
FileSystemSync
==============

**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.

**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.

In the File and Directory Entries API, a `FileSystemSync` object represents a file system. It has two properties.

**Warning:** This interface is deprecated and is no more on the standard track.
 *Do not use it anymore.* Use the File and Directory Entries API instead.


Basic concepts
--------------

The `FileSystemSync` object is your gateway to the entire API and you will use it a lot. So once you have a reference, cache the object in a global variable or class property.

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

`name` Read only  
Non-standard

Deprecated

A string that represents the name of the file system. The name must be unique across the list of exposed file systems.

`root` Read only  
Non-standard

Deprecated

A `DirectoryEntry` that is the root directory of the file system.

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

This feature is not part of any specification anymore. It is no longer on track to become a standard.

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
HTMLMapElement
==============

The **`HTMLMapElement`** interface provides special properties and methods (beyond those of the regular object `HTMLElement` interface it also has available to it by inheritance) for manipulating the layout and presentation of map elements.

EventTarget

Node

Element

HTMLElement

HTMLMapElementInstance properties
-------------------

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

`HTMLMapElement.name`

A string representing the `<map>` element for referencing it other context. If the `id` attribute is set, this must have the same value; and it cannot be `null` or empty.

`HTMLMapElement.areas` Read only 

A live `HTMLCollection` representing the `<area>` elements associated to this `<map>`.

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

*No specific method; inherits methods from its parent, `HTMLElement` .*

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

| Specification |
| --- |
| HTML Standard # htmlmapelement |

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

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

See also
--------

* HTML element implementing this interface: `<map>`.
Document Object Model (DOM)
===========================

The **Document Object Model** (**DOM**) connects web pages to scripts or programming languages by representing the structure of a document—such as the HTML representing a web page—in memory. Usually it refers to JavaScript, even though modeling HTML, SVG, or XML documents as objects are not part of the core JavaScript language.

The DOM represents a document with a logical tree. Each branch of the tree ends in a node, and each node contains objects. DOM methods allow programmatic access to the tree. With them, you can change the document's structure, style, or content.

Nodes can also have event handlers attached to them. Once an event is triggered, the event handlers get executed.

To learn more about what the DOM is and how it represents documents, see our article Introduction to the DOM.

DOM interfaces
--------------

* `AbortController`
* `AbortSignal`
* `AbstractRange`
* `Attr`
* `CDATASection`
* `CharacterData`
* `Comment`
* `CustomEvent`
* `Document`
* `DocumentFragment`
* `DocumentType`
* `DOMError` 
Deprecated
* `DOMException`
* `DOMImplementation`
* `DOMParser`
* `DOMPoint`
* `DOMPointReadOnly`
* `DOMRect`
* `DOMTokenList`
* `Element`
* `Event`
* `EventTarget`
* `HTMLCollection`
* `MutationObserver`
* `MutationRecord`
* `NamedNodeMap`
* `Node`
* `NodeIterator`
* `NodeList`
* `ProcessingInstruction`
* `Range`
* `StaticRange`
* `Text`
* `TextDecoder`
* `TextEncoder`
* `TimeRanges`
* `TreeWalker`
* `XMLDocument`
### Obsolete DOM interfaces

The Document Object Model has been highly simplified. To achieve this, the following interfaces in the different DOM level 3 or earlier specifications have been removed. They are no longer available to web developers.

* `DOMConfiguration`
* `DOMErrorHandler`
* `DOMImplementationList`
* `DOMImplementationRegistry`
* `DOMImplementationSource`
* `DOMLocator`
* `DOMObject`
* `DOMSettableTokenList`
* `DOMUserData`
* `ElementTraversal`
* `Entity`
* `EntityReference`
* `NameList`
* `Notation`
* `TypeInfo`
* `UserDataHandler`
HTML DOM
--------

A document containing HTML is described using the `Document` interface, which is extended by the HTML specification to include various HTML-specific features. In particular, the `Element` interface is enhanced to become `HTMLElement` and various subclasses, each representing one of (or a family of closely related) elements.

The HTML DOM API provides access to various browser features such as tabs and windows, CSS styles and stylesheets, browser history, etc. These interfaces are discussed further in the HTML DOM API documentation.

SVG DOM
-------

Similarly, a document containing SVG is also described using the `Document` interface, which is extended by the SVG specification to include various SVG-specific features. In particular, the `Element` interface is enhanced to become `SVGElement` and various subclasses, each representing an element or a family of closely related elements. These interfaces are discussed further in the SVG API documentation.

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

| Specification |
| --- |
| DOM Standard  |

See also
--------

* DOM Examples
* CSS Object Model (CSSOM)
SVGFontFaceUriElement
=====================

**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 **`SVGFontFaceUriElement`** interface corresponds to the `<font-face-uri>` elements.

Object-oriented access to the attributes of the `<font-face-uri>` 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) # InterfaceSVGFontFaceUriElement |

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

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

See also
--------

* `<font-face-uri>`
USBIsochronousOutTransferPacket
===============================

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 `USBIsochronousOutTransferPacket` interface of the WebUSB API is part of the response from a call to the `isochronousTransferOut()` method of the `USBDevice` interface. It represents the status of an individual packet from a request to transfer data from the USB host to the USB device over an isochronous endpoint.

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

`USBIsochronousOutTransferPacket()` 
Experimental

Creates a new `USBIsochronousOutTransferPacket` object with the provided `status` and `bytesWritten` fields.

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

`USBIsochronousOutTransferPacket.bytesWritten` Read only  
Experimental

Returns the number of bytes from the packet that were sent to the device.

`USBIsochronousOutTransferPacket.status` Read only  
Experimental

Returns the status of the transfer request, one of:

* `"ok"` - The transfer was successful.
* `"stall"` - The device indicated an error by generating a stall condition on the endpoint. A stall on an isochronous endpoint does not need to be cleared.

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

| Specification |
| --- |
| WebUSB API # usbisochronousouttransferpacket |

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

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

A `CSSRuleList` represents an ordered collection of read-only `CSSRule` objects.

While the `CSSRuleList` object is read-only, and cannot be directly modified, it is considered a `live` object, as the content can change over time.

To edit the underlying rules returned by `CSSRule` objects, use `CSSStyleSheet.insertRule()` and `CSSStyleSheet.deleteRule()`, which are methods of `CSSStyleSheet`.

The interface has no constructor. An instance of `CSSRuleList` is returned by `CSSStyleSheet.cssRules` and `CSSKeyframesRule.cssRules`.

**Note:** This interface was an attempt to create an unmodifiable list and only continues to be supported to not break code that's already using it. Modern APIs use types that wrap around ECMAScript array types instead, so you can treat them like ECMAScript arrays, and at the same time impose additional semantics on their usage (such as making their items read-only).

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

`CSSRuleList.length` Read only 

Returns an integer representing the number of `CSSRule` objects in the collection.

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

`CSSRuleList.item()`

Gets a single `CSSRule`.

Examples
--------

In the following example there is a stylesheet with three rules. Using `CSSStyleSheet.cssRules` returns a `CSSRuleList`, which is printed to the console.

The number of rules in the list is printed to the console using `CSSRuleList.length`. The first `CSSRule` can be returned by using `0` as the parameter for `CSSRuleList.item`, in the example this will return the rules set for the `body` selector.

### CSS


```css
body {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  margin: 2em;
}

.container {
  display: grid;
  grid-template-columns: repeat(auto-fill, 200px);
}

.container > \* {
  background-color: #3740ff;
  color: #fff;
}
```

### JavaScript


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

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

| Specification |
| --- |
| CSS Object Model (CSSOM) # the-cssrulelist-interface |

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

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

See also
--------

* `CSSRule`
GamepadHapticActuator
=====================

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

The **`GamepadHapticActuator`** interface of the Gamepad API represents hardware in the controller designed to provide haptic feedback to the user (if available), most commonly vibration hardware.

This interface is accessible through the `Gamepad.hapticActuators` property.

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

`GamepadHapticActuator.type` Read only 

Returns an enum representing the type of the haptic hardware.

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

`GamepadHapticActuator.pulse()` Read only 

Makes the hardware pulse at a certain intensity for a specified duration.

`GamepadHapticActuator.playEffect()` Read only  
Non-standard

Makes the hardware play a specific vibration pattern.

Examples
--------


```js
const gamepad = navigator.getGamepads()[0];

gamepad.hapticActuators[0].pulse(1.0, 200);

gamepad.vibrationActuator.playEffect("dual-rumble", {
  startDelay: 0,
  duration: 200,
  weakMagnitude: 1.0,
  strongMagnitude: 1.0,
});
```

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

| Specification |
| --- |
| Gamepad Extensions # gamepadhapticactuator-interface |

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

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

See also
--------

* Gamepad API
WEBGL\_lose\_context extension
==============================

The **WEBGL\_lose\_context** extension is part of the WebGL API and exposes functions to simulate losing and restoring a `WebGLRenderingContext`.

WebGL extensions are available using the `WebGLRenderingContext.getExtension()` method. For more information, see also Using Extensions in the WebGL tutorial.

**Note:** This extension is available to both, WebGL1 and WebGL2 contexts.

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

`WEBGL_lose_context.loseContext()`

Simulates losing the context.

`WEBGL_lose_context.restoreContext()`

Simulates restoring the context.

Examples
--------

With this extension, you can simulate the `webglcontextlost` and `webglcontextrestored` events:


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

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

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

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

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

| Specification |
| --- |
| WebGL WEBGL\_lose\_context Khronos Ratified Extension Specification  |

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

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

See also
--------

* `WebGLRenderingContext.isContextLost()`
* Events: `webglcontextlost`, `webglcontextrestored`, `webglcontextcreationerror`