recursal/MDN huggingface dataset:
WEBGL\_compressed\_texture\_etc extension
=========================================

The **`WEBGL_compressed_texture_etc`** extension is part of the WebGL API and exposes 10 ETC/EAC compressed texture formats.

Compressed textures reduce the amount of memory needed to store a texture on the GPU, allowing for higher resolution textures or more of the same resolution textures.

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.

Constants
---------

The compressed texture formats are exposed by 10 constants and can be used in two functions: `compressedTexImage2D()` and `compressedTexSubImage2D()`.

`ext.COMPRESSED_R11_EAC`

One-channel (red) unsigned format compression.

`ext.COMPRESSED_SIGNED_R11_EAC`

One-channel (red) signed format compression.

`ext.COMPRESSED_RG11_EAC`

Two-channel (red and green) unsigned format compression.

`ext.COMPRESSED_SIGNED_RG11_EAC`

Two-channel (red and green) signed format compression.

`ext.COMPRESSED_RGB8_ETC2`

Compresses RGB8 data with no alpha channel.

`ext.COMPRESSED_RGBA8_ETC2_EAC`

Compresses RGBA8 data. The RGB part is encoded the same as `RGB_ETC2`, but the alpha part is encoded separately.

`ext.COMPRESSED_SRGB8_ETC2`

Compresses sRGB8 data with no alpha channel.

`ext.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC`

Compresses sRGBA8 data. The sRGB part is encoded the same as `SRGB_ETC2`, but the alpha part is encoded separately.

`ext.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2`

Similar to `RGB8_ETC`, but with ability to punch through the alpha channel, which means to make it completely opaque or transparent.

`ext.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2`

Similar to `SRGB8_ETC`, but with ability to punch through the alpha channel, which means to make it completely opaque or transparent.

Examples
--------


```js
const ext = gl.getExtension("WEBGL\_compressed\_texture\_etc");

const texture = gl.createTexture();
gl.bindTexture(gl.TEXTURE\_2D, texture);

gl.compressedTexImage2D(
  gl.TEXTURE\_2D,
  0,
  ext.COMPRESSED\_RGBA8\_ETC2\_EAC,
  512,
  512,
  0,
  textureData,
);
```

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

| Specification |
| --- |
| WebGL WEBGL\_compressed\_texture\_etc Extension Specification  |

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

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

### Compatibility notes

* This extension was named `WEBGL_compressed_texture_es3` from Firefox 46 to Firefox 51 and used to be available on the WebGL 2 context by default – this is not the case anymore. You have to enable it on both, WebGL 1 and WebGL 2 contexts, in order to use it.
See also
--------

* Ericsson Texture Compression – Wikipedia
* `WEBGL_compressed_texture_etc1` (ETC1)
* `WebGLRenderingContext.getExtension()`
* `WebGLRenderingContext.compressedTexImage2D()`
* `WebGLRenderingContext.compressedTexSubImage2D()`
* `WebGLRenderingContext.getParameter()`
GPUPipelineError
================

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

The **`GPUPipelineError`** interface of the WebGPU API describes a pipeline failure. This is the value received when a `Promise` returned by a `GPUDevice.createComputePipelineAsync()` or `GPUDevice.createRenderPipelineAsync()` call rejects.

DOMException

GPUPipelineErrorConstructor
-----------

`GPUPipelineError()` 
Experimental

Creates a new `GPUPipelineError` object instance.

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

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

`reason` 
Experimental
 Read only 

An enumerated value that defines the reason the pipeline creation failed in a machine-readable way.

Examples
--------

In the following snippet we are attempting to create a `GPUComputePipeline` using `GPUDevice.createComputePipelineAsync()`. However, we have misspelt our compute pipeline `entryPoint` as `"maijn"` (it should be `"main"`), therefore pipeline creation fails, and our `catch` block prints the resulting reason and error message to the console.


```js
// ...

let computePipeline;

try {
  computePipeline = await device.createComputePipelineAsync({
    layout: device.createPipelineLayout({
      bindGroupLayouts: [bindGroupLayout],
    }),
    compute: {
      module: shaderModule,
      entryPoint: "maijn",
    },
  });
} catch (error) {
  // error is a GPUPipelineError object instance
  console.error(error.reason);
  console.error(`Pipeline creation failed: ${error.message}`);
}

// ...
```


In this case, the given `reason` is `"Validation"`, and the `message` is `"Entry point "maijn" doesn't exist in the shader module [ShaderModule]."`

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

| Specification |
| --- |
| WebGPU # gpupipelineerror |

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

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

See also
--------

* The WebGPU API
* WebGPU Error Handling best practices
Web Crypto API
==============

The **Web Crypto API** is an interface allowing a script to use cryptographic primitives in order to build systems using cryptography.

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

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

**Warning:** The Web Crypto API provides a number of low-level cryptographic primitives. It's very easy to misuse them, and the pitfalls involved can be very subtle.

Even assuming you use the basic cryptographic functions correctly, secure key management and overall security system design are extremely hard to get right, and are generally the domain of specialist security experts.

Errors in security system design and implementation can make the security of the system completely ineffective.

Please learn and experiment, but don't guarantee or imply the security of your work before an individual knowledgeable in this subject matter thoroughly reviews it. The Crypto 101 Course can be a great place to start learning about the design and implementation of secure systems.

Interfaces
----------

Some browsers implemented an interface called `Crypto` without having it well defined or being cryptographically sound. In order to avoid confusion, methods and properties of this interface have been removed from browsers implementing the Web Crypto API, and all Web Crypto API methods are available on a new interface: `SubtleCrypto`. The `Crypto.subtle` property gives access to an object implementing it.

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

| Specification |
| --- |
| Web Cryptography API # crypto-interface |

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

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

**`TextTrackCue`** is an abstract class which is used as the basis for the various derived cue types, such as `VTTCue`; you will instead work with those derived types. These cues represent strings of text presented for some duration of time during the performance of a `TextTrack`. The cue includes the start time (the time at which the text will be displayed) and the end time (the time at which it will be removed from the display), as well as other information.

EventTarget

TextTrackCueInstance properties
-------------------

*This interface also inherits properties from `EventTarget`.*

`TextTrackCue.track` Read only 

The `TextTrack` that this cue belongs to, or `null` if it doesn't belong to any.

`TextTrackCue.id`

A string that identifies the cue.

`TextTrackCue.startTime`

A `double` that represents the video time that the cue will start being displayed, in seconds.

`TextTrackCue.endTime`

A `double` that represents the video time that the cue will stop being displayed, in seconds.

`TextTrackCue.pauseOnExit`

A `boolean` for whether the video will pause when this cue stops being displayed.

Events
------

`enter`

Fired when a cue becomes active.

`exit`

Fired when the cue has stopped being active.

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

| Specification |
| --- |
| HTML Standard # texttrackcue |

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

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

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 **`EncodedAudioChunk`** interface of the WebCodecs API represents a chunk of encoded audio data.

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

`EncodedAudioChunk()` 
Experimental

Creates a new `EncodedAudioChunk` object.

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

`EncodedAudioChunk.type` Read only  
Experimental

Returns a string indicating whether this chunk of data is a key chunk.

`EncodedAudioChunk.timestamp` Read only  
Experimental

Returns an integer representing the timestamp of the audio in microseconds.

`EncodedAudioChunk.duration` Read only  
Experimental

Returns an integer representing the duration of the audio in microseconds.

`EncodedAudioChunk.byteLength` Read only  
Experimental

Returns an integer representing the length of the audio in bytes.

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

`EncodedAudioChunk.copyTo()` 
Experimental

Copies the encoded audio data.

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

| Specification |
| --- |
| WebCodecs # encodedaudiochunk-interface |

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

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

The **`Storage`** interface of the Web Storage API provides access to a particular domain's session or local storage. It allows, for example, the addition, modification, or deletion of stored data items.

To manipulate, for instance, the session storage for a domain, a call to `Window.sessionStorage` is made; whereas for local storage the call is made to `Window.localStorage`.

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

`Storage.length` Read only 

Returns an integer representing the number of data items stored in the `Storage` object.

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

`Storage.key()`

When passed a number `n`, this method will return the name of the nth key in the storage.

`Storage.getItem()`

When passed a key name, will return that key's value.

`Storage.setItem()`

When passed a key name and value, will add that key to the storage, or update that key's value if it already exists.

`Storage.removeItem()`

When passed a key name, will remove that key from the storage.

`Storage.clear()`

When invoked, will empty all keys out of the storage.

Examples
--------

Here we access a `Storage` object by calling `localStorage`. We first test whether the local storage contains data items using `!localStorage.getItem('bgcolor')`. If it does, we run a function called `setStyles()` that grabs the data items using `Storage.getItem()` and uses those values to update page styles. If it doesn't, we run another function, `populateStorage()`, which uses `Storage.setItem()` to set the item values, then runs `setStyles()`.


```js
if (!localStorage.getItem("bgcolor")) {
  populateStorage();
} else {
  setStyles();
}

function populateStorage() {
  localStorage.setItem("bgcolor", document.getElementById("bgcolor").value);
  localStorage.setItem("font", document.getElementById("font").value);
  localStorage.setItem("image", document.getElementById("image").value);

  setStyles();
}

function setStyles() {
  const currentColor = localStorage.getItem("bgcolor");
  const currentFont = localStorage.getItem("font");
  const currentImage = localStorage.getItem("image");

  document.getElementById("bgcolor").value = currentColor;
  document.getElementById("font").value = currentFont;
  document.getElementById("image").value = currentImage;

  htmlElem.style.backgroundColor = `#${currentColor}`;
  pElem.style.fontFamily = currentFont;
  imgElem.setAttribute("src", currentImage);
}
```


**Note:** To see this running as a complete working example, see our Web Storage Demo.

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

| Specification |
| --- |
| HTML Standard # storage |

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

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

See also
--------

* Using the Web Storage API
* `Window.localStorage`
* `Window.sessionStorage`
* `CacheStorage`
SharedStorageSelectURLOperation
===============================

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

The **`SharedStorageSelectURLOperation`** interface of the Shared Storage API represents a URL Selection output gate operation.

SharedStorageOperation

SharedStorageSelectURLOperationInstance methods
----------------

`run()` 
Experimental

Defines the structure to which the `run()` method defined inside a URL Selection output gate operation should conform.

Examples
--------

In this example, a class called `SelectURLOperation` is defined in a worklet and is registered using `SharedStorageWorkletGlobalScope.register()` with the name `ab-testing`. `SharedStorageSelectURLOperation` defines the structure to which this class needs to conform, essentially defining the parameters required for the `run()` method. Other than this requirement, the functionality of the class can be defined flexibly.


```js
// ab-testing-worklet.js
class SelectURLOperation {
  async run(urls, data) {
    // Read the user's experiment group from Shared Storage
    const experimentGroup = await this.sharedStorage.get("ab-testing-group");

    // Return the group number
    return experimentGroup;
  }
}

// Register the operation
register("ab-testing", SelectURLOperation);
```


**Note:** It is possible to define and register multiple operations in the same shared storage worklet module script with different names; see `SharedStorageOperation` for an example.

In the main browsing context, the `ab-testing` operation is invoked using the `WindowSharedStorage.selectURL()` method:


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

async function injectContent() {
  // Register 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();
```


For more details about this example and links to other examples, see the Shared Storage API landing page.

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

| Specification |
| --- |
| Shared Storage API # sharedstorageselecturloperation |

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

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

See also
--------

* Shared Storage API
CDATASection
============

 The **`CDATASection`** interface represents a CDATA section
 that can be used within XML to include extended portions of unescaped text.
 When inside a CDATA section, the symbols `<` and `&` don't need escaping
 as they normally do.

In XML, a CDATA section looks like:


```xml
<![CDATA[ … ]]>
```


For example:


```html
<foo>
  Here is a CDATA section: <![CDATA[ < > & ]]> with all kinds of unescaped text.
</foo>
```


 The only sequence which is not allowed within a CDATA section is the closing sequence
 of a CDATA section itself, `]]>`.

**Note:** CDATA sections should not be used within HTML they are considered as comments and not displayed.

EventTarget

Node

CharacterData

Text

CDATASectionInstance properties
-------------------

*This interface has no specific properties and implements those of its parent
`Text`.*

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

*This interface has no specific methods and implements those of its parent
`Text`.*

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

| Specification |
| --- |
| DOM Standard # interface-cdatasection |

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

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

See also
--------

* `Document.createCDATASection()`
MediaStreamEvent
================

**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 **`MediaStreamEvent`** interface represents events that occurs in relation to a `MediaStream`. Two events of this type can be thrown: `addstream` and `removestream`.

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

*A `MediaStreamEvent` being an `Event`, this event also implements these properties*.

`MediaStreamEvent.stream` Read only  
Deprecated

Non-standard

Contains the `MediaStream` containing the stream associated with the event.

Constructors
------------

`MediaStreamEvent()` 
Deprecated

Non-standard

Returns a new `MediaStreamEvent`. It takes two parameters, the first being a string representing the type of the event; the second a dictionary containing the `MediaStream` it refers to.

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

A `MediaStreamEvent` being an `Event`, this event also implements these properties. There is no specific `MediaStreamEvent` method.

Examples
--------


```js
pc.onaddstream = (ev) => {
  alert(`A stream (id: '${ev.stream.id}') has been added to this connection.`);
};
```

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

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

See also
--------

* WebRTC
* Its usual target: `RTCPeerConnection`.
WEBGL\_compressed\_texture\_pvrtc extension
===========================================

The **`WEBGL_compressed_texture_pvrtc`** extension is part of the WebGL API and exposes four PVRTC compressed texture formats.

Compressed textures reduce the amount of memory needed to store a texture on the GPU, allowing for higher resolution textures or more of the same resolution textures.

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

**Note:** PVRTC is typically only available on mobile devices with PowerVR chipsets.
 It is used in all generations of the iPhone, iPod Touch and iPad and supported on certain Android devices that use a PowerVR GPU.


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

**Note:** On iOS devices, this extension is named `WEBKIT_WEBGL_compressed_texture_pvrtc`.

Constants
---------

The compressed texture formats are exposed by four constants and can be used in two functions: `compressedTexImage2D()` (where the `height` and `width` parameters must be powers of 2) and `compressedTexSubImage2D()` (where the height and width parameters must equal the current values of the existing texture and the `xoffset` and `yoffset` parameters must be 0).

`ext.COMPRESSED_RGB_PVRTC_4BPPV1_IMG`

RGB compression in 4-bit mode. One block for each 4×4 pixels.

`ext.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG`

RGBA compression in 4-bit mode. One block for each 4×4 pixels.

`ext.COMPRESSED_RGB_PVRTC_2BPPV1_IMG`

RGB compression in 2-bit mode. One block for each 8×4 pixels.

`ext.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG`

RGBA compression in 2-bit mode. One block for each 8×4 pixels.

Examples
--------


```js
const ext = gl.getExtension("WEBGL\_compressed\_texture\_pvrtc");

const texture = gl.createTexture();
gl.bindTexture(gl.TEXTURE\_2D, texture);

gl.compressedTexImage2D(
  gl.TEXTURE\_2D,
  0,
  ext.COMPRESSED\_RGB\_PVRTC\_4BPPV1\_IMG,
  512,
  512,
  0,
  textureData,
);
```

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

| Specification |
| --- |
| WebGL WEBGL\_compressed\_texture\_pvrtc Extension Specification  |

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

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

See also
--------

* PVRTC Texture Compression – Wikipedia
* `WebGLRenderingContext.getExtension()`
* `WebGLRenderingContext.compressedTexImage2D()`
* `WebGLRenderingContext.compressedTexSubImage2D()`
* `WebGLRenderingContext.getParameter()`
SVGAnimatedNumber
=================

SVG animated number interface
-----------------------------

The `SVGAnimatedNumber` interface is used for attributes of basic type <Number> which can be animated.

### Interface overview

|  |  |
| --- | --- |
| Also implement | *None* |
| Methods | *None* |
| Properties | * float `baseVal`
* readonly float `animVal`
 |
| Normative document | SVG 1.1 (2nd Edition) |

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

| Name | Type | Description |
| --- | --- | --- |
| `baseVal` | float | The base value of the given attribute before applying any animations. |
| `animVal` | float | 
 If the given attribute or property is being animated, contains the
 current animated value of the attribute or property. If the given
 attribute or property is not currently being animated, contains the same
 value as `baseVal`.
  |

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

The `SVGAnimatedNumber` interface do not provide any specific methods.

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

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