recursal/MDN huggingface dataset:
Sanitizer: sanitize() method
============================

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

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

The **`sanitize()`** method of the `Sanitizer` interface is used to sanitize a tree of DOM nodes, removing any unwanted elements or attributes.

 It should be used when the data to be sanitized is already available as DOM nodes.
 For example when sanitizing a `Document` instance in a frame.

 The default `Sanitizer()` configuration strips out XSS-relevant input by default, including `<script>` tags, custom elements, and comments.
 The sanitizer configuration may be customized using `Sanitizer()` constructor options.


**Note:** To sanitize strings, instead use `Element.setHTML()`.
 See `HTML Sanitizer API` for more information.


Syntax
------


```js
sanitize(input)
```

### Parameters

`input`

A `DocumentFragment` or `Document` to be sanitized.

### Return value

A sanitized `DocumentFragment`.

### Exceptions

None.

Examples
--------

To sanitize data from an iframe with id `userFrame`:


```js
const sanitizer = new Sanitizer(); // Default sanitizer;

// Get the frame and its Document object
const frame_element = document.getElementById("userFrame");
const unsanitized_frame_tree = frame_element.contentWindow.document;

// Sanitize the document tree and update the frame.
const sanitized_frame_tree = sanitizer.sanitize(unsanitized_frame_tree);
frame_element.replaceChildren(sanitized_frame_tree);
```

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

| Specification |
| --- |
| HTML Sanitizer API # dom-sanitizer-sanitize |

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

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

See also
--------

* `HTML Sanitizer API`
* `Element.setHTML()`
GPUTexture: mipLevelCount property
==================================

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

 The **`mipLevelCount`** read-only property of the
 `GPUTexture` interface represents the number of mip levels of the `GPUTexture`.

This is set via the `mipLevelCount` property in the descriptor object passed into the originating `GPUDevice.createTexture()` call. If omitted, this defaults to 1.

Value
-----

A number.

Examples
--------


```js
// ...

const depthTexture = device.createTexture({
  size: [canvas.width, canvas.height],
  format: "depth24plus",
  usage: GPUTextureUsage.RENDER\_ATTACHMENT,
});

console.log(depthTexture.mipLevelCount); // 1
```

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

| Specification |
| --- |
| WebGPU # dom-gputexture-miplevelcount |

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

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

See also
--------

* The WebGPU API
GPUTexture: dimension property
==============================

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

 The **`dimension`** read-only property of the
 `GPUTexture` interface represents the dimension of the set of texels for each `GPUTexture` subresource.

This is set via the `dimension` property in the descriptor object passed into the originating `GPUDevice.createTexture()` call, which defaults to `"2d"` if omitted.

Value
-----

An enumerated value. Possible values are:

* `"1d"`: A one-dimensional texture with a single dimension, width.
* `"2d"`: A two-dimensional texture with a width and height, which may also have layers. Only `"2d"` textures can have mipmaps, be multisampled, use a compressed or depth/stencil format, and be used as a render attachment.
* `"3d"`: A three-dimensional texture with a width, height, and depth.
Examples
--------


```js
// ...

const depthTexture = device.createTexture({
  size: [canvas.width, canvas.height],
  format: "depth24plus",
  usage: GPUTextureUsage.RENDER\_ATTACHMENT,
});

console.log(depthTexture.dimension); // "2d"
```

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

| Specification |
| --- |
| WebGPU # dom-gputexture-dimension |

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

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

See also
--------

* The WebGPU API
GPUTexture: depthOrArrayLayers property
=======================================

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

 The **`depthOrArrayLayers`** read-only property of the
 `GPUTexture` interface represents the depth or layer count of the `GPUTexture`.

This is set based on the `size` property in the descriptor object passed into the originating `GPUDevice.createTexture()` call.

Value
-----

A number. This represents:

* The depth in pixels, in the case of textures with a `"3d"` `GPUTexture.dimension`.
* The number of layers, in the case of layered textures with a `"2d"` `GPUTexture.dimension`.

In cases where the `GPUTexture` does not have a depth or layers, the value is 1.

Examples
--------


```js
// ...

const test = device.createTexture({
  size: [128],
  format: "r8uint",
  dimension: "1d",
  usage: GPUTextureUsage.COPY\_SRC,
});

console.log(test.depthOrArrayLayers); // 1
```

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

| Specification |
| --- |
| WebGPU # dom-gputexture-depthorarraylayers |

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

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

See also
--------

* The WebGPU API
GPUTexture: destroy() method
============================

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

 The **`destroy()`** method of the
 `GPUTexture` interface destroys the `GPUTexture`.

Syntax
------


```js
destroy()
```

### Parameters

None.

### Return value

None (`Undefined`).

Examples
--------


```js
// ...

const depthTexture = device.createTexture({
  size: [canvas.width, canvas.height],
  format: "depth24plus",
  usage: GPUTextureUsage.RENDER\_ATTACHMENT,
});

// some time later

depthTexture.destroy();
```

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

| Specification |
| --- |
| WebGPU # dom-gputexture-destroy |

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

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

See also
--------

* The WebGPU API
GPUTexture: format property
===========================

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

 The **`format`** read-only property of the
 `GPUTexture` interface represents the format of the `GPUTexture`.

This is set via the `format` property in the descriptor object passed into the originating `GPUDevice.createTexture()` call.

Value
-----

An enumerated value. See the Texture formats section of the specification for all the possible values.

Examples
--------


```js
// ...

const depthTexture = device.createTexture({
  size: [canvas.width, canvas.height],
  format: "depth24plus",
  usage: GPUTextureUsage.RENDER\_ATTACHMENT,
});

console.log(depthTexture.format); // "depth24plus"
```

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

| Specification |
| --- |
| WebGPU # dom-gputexture-format |

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

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

See also
--------

* The WebGPU API
GPUTexture: width property
==========================

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

 The **`width`** read-only property of the
 `GPUTexture` interface represents the width of the `GPUTexture`.

This is set based on the value of the `size` property in the descriptor object passed into the originating `GPUDevice.createTexture()` call.

Value
-----

A number.

Examples
--------


```js
// ...

const depthTexture = device.createTexture({
  size: [640, 480],
  format: "depth24plus",
  usage: GPUTextureUsage.RENDER\_ATTACHMENT,
});

console.log(depthTexture.width); // 640
```

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

| Specification |
| --- |
| WebGPU # dom-gputexture-width |

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

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

See also
--------

* The WebGPU API
GPUTexture: height property
===========================

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

 The **`height`** read-only property of the
 `GPUTexture` interface represents the height of the `GPUTexture`.

This is set based on the value of the `size` property in the descriptor object passed into the originating `GPUDevice.createTexture()` call.

Value
-----

A number.

Examples
--------


```js
// ...

const depthTexture = device.createTexture({
  size: [640, 480],
  format: "depth24plus",
  usage: GPUTextureUsage.RENDER\_ATTACHMENT,
});

console.log(depthTexture.height); // 480
```

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

| Specification |
| --- |
| WebGPU # dom-gputexture-height |

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

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

See also
--------

* The WebGPU API
GPUTexture: sampleCount property
================================

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

 The **`sampleCount`** read-only property of the
 `GPUTexture` interface represents the sample count of the `GPUTexture`.

This is set via the `sampleCount` property in the descriptor object passed into the originating `GPUDevice.createTexture()` call. If omitted, this defaults to 1.

Value
-----

A number. Possible values are:

* 1
* 4, which indicates a multi-sampled texture.
Examples
--------


```js
// ...

const depthTexture = device.createTexture({
  size: [canvas.width, canvas.height],
  format: "depth24plus",
  usage: GPUTextureUsage.RENDER\_ATTACHMENT,
});

console.log(depthTexture.sampleCount); // 1
```

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

| Specification |
| --- |
| WebGPU # dom-gputexture-samplecount |

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

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

See also
--------

* The WebGPU API
GPUTexture: usage property
==========================

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

 The **`usage`** read-only property of the
 `GPUTexture` interface is the bitwise flags representing the allowed usages of the `GPUTexture`.

This is set via the `usage` property in the descriptor object passed into the originating `GPUDevice.createTexture()` call.

Value
-----

The bitwise flags representing the original usages set when the `GPUTexture` was first created. The returned number is the sum of decimal values representing the different flags, as seen in the table below.

| Usage flag | Usage description | Hex equiv. | Decimal equiv. |
| --- | --- | --- | --- |
| `GPUTextureUsage.COPY_SRC` | The texture can be used as the source of a copy operation, for example the source argument of a `copyTextureToBuffer()` call. | 0x01 | 1 |
| `GPUTextureUsage.COPY_DST` | The texture can be used as the destination of a copy/write operation, for example the destination argument of a `copyBufferToTexture()` call. | 0x02 | 2 |
| `GPUTextureUsage.RENDER_ATTACHMENT` | The texture can be used as a color or depth/stencil attachment in a render pass, for example as the `view` property of the descriptor object in a `beginRenderPass()` call. | 0x10 | 16 |
| `GPUTextureUsage.STORAGE_BINDING` | The texture can be bound for use as a storage texture in a shader, for example as a resource in a bind group entry when creating a `GPUBindGroup` (via `createBindGroup()`), which adheres to a `GPUBindGroupLayout` entry with a specified storage texture binding layout. | 0x08 | 8 |
| `GPUTextureUsage.TEXTURE_BINDING` | The texture can be bound for use as a sampled texture in a shader, for example as a resource in a bind group entry when creating a `GPUBindGroup` (via `createBindGroup()`), which adheres to a `GPUBindGroupLayout` entry with a specified texture binding layout. | 0x04 | 4 |

Examples
--------


```js
// ...

const depthTexture = device.createTexture({
  size: [canvas.width, canvas.height],
  format: "depth24plus",
  usage: GPUTextureUsage.RENDER\_ATTACHMENT,
});

console.log(depthTexture.usage); // 16
```

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

| Specification |
| --- |
| WebGPU # dom-gputexture-usage |

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

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

See also
--------

* The WebGPU API
GPUTexture: label property
==========================

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

 The **`label`** property of the
 `GPUTexture` interface provides a label that can be used to identify the object, for example in `GPUError` messages or console warnings.

This can be set by providing a `label` property in the descriptor object passed into the originating `GPUDevice.createTexture()` call, or you can get and set it directly on the `GPUTexture` object.

Value
-----

A string. If this has not been previously set as described above, it will be an empty string.

Examples
--------

Setting and getting a label via `GPUTexture.label`:


```js
// ...

const depthTexture = device.createTexture({
  size: [canvas.width, canvas.height],
  format: "depth24plus",
  usage: GPUTextureUsage.RENDER\_ATTACHMENT,
});

depthTexture.label = "mytexture";

console.log(depthTexture.label); // "mytexture"
```


Setting a label via the originating `GPUDevice.createTexture()` call, and then getting it via `GPUTexture.label`:


```js
// ...

const depthTexture = device.createTexture({
  size: [canvas.width, canvas.height],
  format: "depth24plus",
  usage: GPUTextureUsage.RENDER\_ATTACHMENT,
  label: "mytexture",
});

console.log(depthTexture.label); // "mytexture"
```

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

| Specification |
| --- |
| WebGPU # dom-gpuobjectbase-label |

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

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

See also
--------

* The WebGPU API
RTCOutboundRtpStreamStats: sliCount property
============================================

 The **`sliCount`** property of the
 `RTCOutboundRtpStreamStats` dictionary indicates how many **Slice
Loss Indication** (**SLI**) packets the
 `RTCRtpSender` received from the remote `RTCRtpReceiver` for
 the RTP stream described by this object.

 An SLI packet is used by a decoder to let the encoder (the sender) know that it's
 detected corruption of one or more consecutive macroblocks, in scan order, in the
 received media. In general, what's usually of interest is that the higher this number is,
 the more the stream data is becoming corrupted between the sender and the receiver,
 causing the receiver to request retransmits or to drop frames entirely.

Value
-----

 An unsigned integer indicating the number of SLI packets the sender received from the
 receiver due to lost runs of macroblocks. A high value of `sliCount` may be
 an indication of an unreliable network.

This is a very technical part of how video codecs work. For details, see RFC 4585: 6.3.2.

**Note:** This value is only present for video media.

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

#### No specification found

No specification data found for `api.RTCOutboundRtpStreamStats.sliCount`.  
Check for problems with this page or contribute a missing `spec_url` to mdn/browser-compat-data. Also make sure the specification is included in w3c/browser-specs.

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

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

See also
--------

* RFC 4585, section 6.3.2: Definition of "Slice Loss Indication" in the document
 *Extended RTP Profile for Real-time Transport Control Protocol (RTCP)-Based
Feedback (RTP/AVPF)*.
RTCOutboundRtpStreamStats: timestamp property
=============================================

The **`timestamp`** property of the `RTCOutboundRtpStreamStats` dictionary is a `DOMHighResTimeStamp` object specifying the time at which the data in the object was sampled.

Value
-----

A `DOMHighResTimeStamp` value indicating the time at which the activity described by the statistics in this object was recorded, in milliseconds elapsed since the beginning of January 1, 1970, UTC.

The value should be accurate to within a few milliseconds but may not be entirely precise, either because of hardware or operating system limitations or because of fingerprinting protection in the form of reduced clock precision or accuracy.

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

| Specification |
| --- |
| Identifiers for WebRTC's Statistics API # dom-rtcstats-timestamp |

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

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

 The **`qualityLimitationReason`**
 property of the `RTCOutboundRtpStreamStats` dictionary is a string
 indicating the reason why the media quality in the stream is currently being reduced
 by the codec during encoding, or `none` if no quality reduction is being
 performed.

 This quality reduction may include changes such as reduced frame
 rate or resolution, or an increase in compression factor.

 The amount of time the encoded media has had its quality reduced in each of the
 potential ways that can be done can be found in
 `qualityLimitationDurations`.

Value
-----

 A `Map` whose keys are strings whose values are `none`, `cpu`, `bandwidth`, or `other`, and whose values are the
 duration of the media, in seconds, whose quality was reduced for that reason.

Examples
--------

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

#### No specification found

No specification data found for `api.RTCOutboundRtpStreamStats.qualityLimitationReason`.  
Check for problems with this page or contribute a missing `spec_url` to mdn/browser-compat-data. Also make sure the specification is included in w3c/browser-specs.

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

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

 The **`averageRtcpInterval`** property
 of the `RTCOutboundRtpStreamStats` dictionary is a floating-point value
 indicating the average time that should pass between transmissions of
 RTCP packets on this stream.

Value
-----

 A floating-point value indicating the average interval, in seconds, between
 transmissions of RTCP packets. This interval is computed following the formula outlined
 in RFC 1889: A.7.

 Because the interval's value is determined in part by the number of active senders, it
 will be different for each user of a service. Since this value is also used to determine
 the number of seconds after a stream starts to flow before the first RTCP packet should
 be sent, the result is that if many users try to start using the service at the same
 time, the server won't be flooded with RTCP packets coming in all at once.

 The sending endpoint computes this value when sending compound RTCP packets, which must
 contain at least an RTCP RR or SR packet and an SDES packet with the CNAME item.

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

#### No specification found

No specification data found for `api.RTCOutboundRtpStreamStats.averageRtcpInterval`.  
Check for problems with this page or contribute a missing `spec_url` to mdn/browser-compat-data. Also make sure the specification is included in w3c/browser-specs.

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

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

 The **`framesEncoded`** property of
 the `RTCOutboundRtpStreamStats` dictionary indicates the total number of
 frames that have been encoded by this `RTCRtpSender` for this media
 source.

Value
-----

 An integer value indicating the total number of video frames that this sender has
 encoded so far for this stream.

**Note:** This property is only valid for video streams.

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

#### No specification found

No specification data found for `api.RTCOutboundRtpStreamStats.framesEncoded`.  
Check for problems with this page or contribute a missing `spec_url` to mdn/browser-compat-data. Also make sure the specification is included in w3c/browser-specs.

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

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

 The **`nackCount`** property of the
 `RTCOutboundRtpStreamStats` dictionary is a numeric value indicating the
 number of times the `RTCRtpSender` described by this object received a
 **NACK** packet from the remote receiver.

 A NACK (Negative
 ACKnowledgement, also called "Generic NACK") packet is used by the
 `RTCRtpReceiver` to inform the sender that one or more RTP
 packets it sent were lost in transport.

Value
-----

 An integer value indicating how many times the sender received a NACK packet from the
 receiver, indicating the loss of one or more packets.

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

| Specification |
| --- |
| Identifiers for WebRTC's Statistics API # dom-rtcoutboundrtpstreamstats-nackcount |

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

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

 The **`firCount`** property of the
 `RTCOutboundRtpStreamStats` dictionary indicates the number of
 **Full Intra Request** (**FIR**) that the remote
 `RTCRtpReceiver` has sent to this `RTCRtpSender`.

 A FIR packet is sent when the receiver finds that it has fallen behind and needs to skip
 frames in order to catch up; the sender should respond by sending a full frame instead
 of a delta frame.

Available only on video media.

Value
-----

 An integer value indicating how many FIR packets have been received by the sender
 during the current connection. This statistic is available only for video tracks.

 The receiver sends a FIR packet to the sender any time it falls behind or loses packets
 and cannot decode the incoming stream any longer because of the lost data. This tells
 the sender to send a full frame instead of a delta frame, so that the receiver can catch
 up.

 The higher `firCount` is, the more often frames were dropped, which may be
 an indication that the media's bit rate is too high for the available bandwidth, or that
 the receiving device is overburdened and is therefore unable to process the incoming
 data.

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

#### No specification found

No specification data found for `api.RTCOutboundRtpStreamStats.firCount`.  
Check for problems with this page or contribute a missing `spec_url` to mdn/browser-compat-data. Also make sure the specification is included in w3c/browser-specs.

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

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