repo_id
stringlengths 22
103
| file_path
stringlengths 41
147
| content
stringlengths 181
193k
| __index_level_0__
int64 0
0
|
---|---|---|---|
data/mdn-content/files/en-us/web/api/domtokenlist | data/mdn-content/files/en-us/web/api/domtokenlist/value/index.md | ---
title: "DOMTokenList: value property"
short-title: value
slug: Web/API/DOMTokenList/value
page-type: web-api-instance-property
browser-compat: api.DOMTokenList.value
---
{{APIRef("DOM")}}
The **`value`** property of the {{domxref("DOMTokenList")}}
interface is a {{Glossary("stringifier")}} that returns the value of the list serialized as a
string, or clears and sets the list to the given value.
## Value
A string representing the serialized content of the list.
Each item is separated by a space.
## Examples
In the following example we retrieve the list of classes set on a
{{htmlelement("span")}} element as a `DOMTokenList` using
{{domxref("Element.classList")}}, then write the value of the list to the
`<span>`'s {{domxref("Node.textContent")}}.
First, the HTML:
```html
<span class="a b c"></span>
```
Now the JavaScript:
```js
const span = document.querySelector("span");
const classes = span.classList;
span.textContent = classes.value;
```
The output looks like this:
{{ EmbedLiveSample('Examples', '100%', 60) }}
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api/domtokenlist | data/mdn-content/files/en-us/web/api/domtokenlist/replace/index.md | ---
title: "DOMTokenList: replace() method"
short-title: replace()
slug: Web/API/DOMTokenList/replace
page-type: web-api-instance-method
browser-compat: api.DOMTokenList.replace
---
{{APIRef("DOM")}}
The **`replace()`** method of the {{domxref("DOMTokenList")}} interface
replaces an existing token with a new token.
If the first token doesn't exist, `replace()` returns `false` immediately,
without adding the new token to the token list.
## Syntax
```js-nolint
replace(oldToken, newToken)
```
### Parameters
- `oldToken`
- : A string representing the token you want to replace.
- `newToken`
- : A string representing the token you want to replace `oldToken` with.
### Return value
A boolean value, which is `true` if `oldToken` was
successfully replaced, or `false` if not.
## Examples
In the following example we retrieve the list of classes set on a
{{htmlelement("span")}} element as a `DOMTokenList` using
{{domxref("Element.classList")}}. We then replace a token in the list, and write the
list into the `<span>`'s {{domxref("Node.textContent")}}.
First, the HTML:
```html
<span class="a b c"></span>
```
Now the JavaScript:
```js
const span = document.querySelector("span");
const classes = span.classList;
const result = classes.replace("c", "z");
span.textContent = result ? classes : "token not replaced successfully";
```
The output looks like this:
{{ EmbedLiveSample('Examples', '100%', 60) }}
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api/domtokenlist | data/mdn-content/files/en-us/web/api/domtokenlist/contains/index.md | ---
title: "DOMTokenList: contains() method"
short-title: contains()
slug: Web/API/DOMTokenList/contains
page-type: web-api-instance-method
browser-compat: api.DOMTokenList.contains
---
{{APIRef("DOM")}}
The **`contains()`** method of the {{domxref("DOMTokenList")}} interface
returns a boolean value — `true` if the underlying list contains the given token,
otherwise `false`.
## Syntax
```js-nolint
contains(token)
```
### Parameters
- `token`
- : A string representing the token
you want to check for the existence of in the list.
### Return value
A boolean value, which is `true` if the calling list contains
`token`, otherwise `false`.
## Examples
In the following example we retrieve the list of classes set on a
{{htmlelement("span")}} element as a `DOMTokenList` using
{{domxref("Element.classList")}}. We then test for the existence of `"c"` in
the list, and write the result into the `<span>`'s
{{domxref("Node.textContent")}}.
First, the HTML:
```html
<span class="a b c"></span>
```
Now the JavaScript:
```js
const span = document.querySelector("span");
span.textContent = span.classList.contains("c")
? "The classList contains 'c'"
: "The classList does not contain 'c'";
```
The output looks like this:
{{ EmbedLiveSample('Examples', '100%', 60) }}
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api/domtokenlist | data/mdn-content/files/en-us/web/api/domtokenlist/values/index.md | ---
title: "DOMTokenList: values() method"
short-title: values()
slug: Web/API/DOMTokenList/values
page-type: web-api-instance-method
browser-compat: api.DOMTokenList.values
---
{{APIRef("DOM")}}
The **`values()`** method of the {{domxref("DOMTokenList")}} interface
returns an {{jsxref("Iteration_protocols",'iterator')}}
allowing the caller to go through all values contained in the `DOMTokenList`.
The individual values are strings.
## Syntax
```js-nolint
tokenList.values()
```
### Parameters
None.
### Return value
Returns an {{jsxref("Iteration_protocols","iterator")}}.
## Examples
In the following example we retrieve the list of classes set on a
{{htmlelement("span")}} element as a `DOMTokenList` using
{{domxref("Element.classList")}}. We when retrieve an iterator containing the values
using `values()`, then iterate through those values using a [for...of](/en-US/docs/Web/JavaScript/Reference/Statements/for...of) loop,
writing each one to the `<span>`'s {{domxref("Node.textContent")}}.
First, the HTML:
```html
<span class="a b c"></span>
```
Now the JavaScript:
```js
const span = document.querySelector("span");
const classes = span.classList;
const iterator = classes.values();
for (const value of iterator) {
span.textContent += `(${value}) `;
}
```
The output looks like this:
{{ EmbedLiveSample('Examples', '100%', 60) }}
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api/domtokenlist | data/mdn-content/files/en-us/web/api/domtokenlist/toggle/index.md | ---
title: "DOMTokenList: toggle() method"
short-title: toggle()
slug: Web/API/DOMTokenList/toggle
page-type: web-api-instance-method
browser-compat: api.DOMTokenList.toggle
---
{{APIRef("DOM")}}
The **`toggle()`** method of the {{domxref("DOMTokenList")}} interface
removes an existing token from the list and returns `false`.
If the token doesn't exist it's added and the function returns `true`.
## Syntax
```js-nolint
toggle(token)
toggle(token, force)
```
### Parameters
- `token`
- : A string representing the token you want to toggle.
- `force` {{optional_inline}}
- : If included, turns the toggle into a one way-only operation.
If set to `false`, then `token` will _only_ be removed, but not added.
If set to `true`, then `token` will _only_ be added, but not removed.
### Return value
A boolean value, `true` or `false`, indicating whether `token` is in the
list after the call or not.
## Examples
### Toggling a class on click
In the following example we retrieve the list of classes set on a
{{htmlelement("span")}} element as a `DOMTokenList` using
{{domxref("Element.classList")}}. We then replace a token in the list, and write the
list into the `<span>`'s {{domxref("Node.textContent")}}.
First, the HTML:
```html
<span class="a b">classList is 'a b'</span>
```
Now the JavaScript:
```js
const span = document.querySelector("span");
const classes = span.classList;
span.addEventListener("click", () => {
const result = classes.toggle("c");
span.textContent = `'c' ${
result ? "added" : "removed"
}; classList is now "${classes}".`;
});
```
The output looks like this and it will change each time you click on the text:
{{ EmbedLiveSample('Toggling_a_class_on_click', '100%', 60) }}
### Setting the force parameter
The second parameter can be used to determine whether the class is included or not. This example would include the 'c' class only if the browser window is over 1000 pixels wide:
```js
span.classList.toggle("c", window.innerWidth > 1000);
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api/domtokenlist | data/mdn-content/files/en-us/web/api/domtokenlist/foreach/index.md | ---
title: "DOMTokenList: forEach() method"
short-title: forEach()
slug: Web/API/DOMTokenList/forEach
page-type: web-api-instance-method
browser-compat: api.DOMTokenList.forEach
---
{{APIRef("DOM")}}
The **`forEach()`** method of the {{domxref("DOMTokenList")}} interface
calls the callback given in parameter once for each value pair in the list, in
insertion order.
## Syntax
```js-nolint
forEach(callback)
forEach(callback, thisArg)
```
### Parameters
- `callback`
- : The function to execute for each element, eventually taking three arguments:
- `currentValue`
- : The current element being processed in the array.
- `currentIndex`
- : The index of the current element being processed in the array.
- `listObj`
- : The array that `forEach()` is being applied to.
- `thisArg` {{Optional_inline}}
- : The value to use as {{jsxref("Operators/this", "this")}} when executing `callback`.
### Return value
None.
## Example
In the following example we retrieve the list of classes set on a
{{htmlelement("pre")}} element as a `DOMTokenList` using
{{domxref("Element.classList")}}. We when retrieve an iterator containing the values
using `forEach()`, writing each one to the `<pre>`'s
{{domxref("Node.textContent")}} inside the `forEach()` inner function.
### HTML
```html
<pre class="a b c"></pre>
```
### JavaScript
```js
const pre = document.querySelector("pre");
const classes = pre.classList;
const iterator = classes.values();
classes.forEach(function (value, key, listObj) {
pre.textContent += `(${value} ${key})/${this}\n`;
}, "arg");
```
### Result
{{ EmbedLiveSample('Example', '100%', 100) }}
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{domxref("DOMTokenList.entries()")}}, {{domxref("DOMTokenList.keys")}} and {{domxref("DOMTokenList.values")}}.
| 0 |
data/mdn-content/files/en-us/web/api/domtokenlist | data/mdn-content/files/en-us/web/api/domtokenlist/entries/index.md | ---
title: "DOMTokenList: entries() method"
short-title: entries()
slug: Web/API/DOMTokenList/entries
page-type: web-api-instance-method
browser-compat: api.DOMTokenList.entries
---
{{APIRef("DOM")}}
The **`entries()`** method of the {{domxref("DOMTokenList")}} interface
returns an {{jsxref("Iteration_protocols",'iterator')}} allowing you
to go through all key/value pairs contained in this object. The values are
{{jsxref("Array")}}s which have [key, value] pairs, each representing a single token.
## Syntax
```js-nolint
entries()
```
### Return value
Returns an {{jsxref("Iteration_protocols","iterator")}}.
## Examples
In the following example we retrieve the list of classes set on a
{{htmlelement("span")}} element as a `DOMTokenList` using
{{domxref("Element.classList")}}. We when retrieve an iterator containing the key/value
pairs using `entries()`, then iterate through each one using a
{{jsxref("Statements/for...of", "for...of")}} loop, writing them to the
`<span>`'s {{domxref("Node.textContent")}}.
First, the HTML:
```html
<span class="a b c"></span>
```
Now the JavaScript:
```js
const span = document.querySelector("span");
const classes = span.classList;
const iterator = classes.entries();
for (const value of iterator) {
span.textContent += `(${value})`;
}
```
The output looks like this:
{{ EmbedLiveSample('Examples', '100%', 60) }}
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{domxref("DOMTokenList.foreach()")}}, {{domxref("DOMTokenList.keys")}} and {{domxref("DOMTokenList.values")}}.
| 0 |
data/mdn-content/files/en-us/web/api | data/mdn-content/files/en-us/web/api/audiotrack/index.md | ---
title: AudioTrack
slug: Web/API/AudioTrack
page-type: web-api-interface
browser-compat: api.AudioTrack
---
{{APIRef("HTML DOM")}}
The **`AudioTrack`** interface represents a single audio track from one of the HTML media elements, {{HTMLElement("audio")}} or {{HTMLElement("video")}}.
The most common use for accessing an `AudioTrack` object is to toggle its {{domxref("AudioTrack.enabled", "enabled")}} property in order to mute and unmute the track.
## Instance properties
- {{domxref("AudioTrack.enabled", "enabled")}}
- : A Boolean value which controls whether or not the audio track's sound is enabled. Setting this value to `false` mutes the track's audio.
- {{domxref("AudioTrack.id", "id")}} {{ReadOnlyInline}}
- : A string which uniquely identifies the track within the media. This ID can be used to locate a specific track within an audio track list by calling {{domxref("AudioTrackList.getTrackById()")}}. The ID can also be used as the fragment part of the URL if the media supports seeking by media fragment per the [Media Fragments URI specification](https://www.w3.org/TR/media-frags/).
- {{domxref("AudioTrack.kind", "kind")}} {{ReadOnlyInline}}
- : A string specifying the category into which the track falls. For example, the main audio track would have a `kind` of `"main"`.
- {{domxref("AudioTrack.label", "label")}} {{ReadOnlyInline}}
- : A string providing a human-readable label for the track. For example, an audio commentary track for a movie might have a `label` of `"Commentary with director John Q. Public and actors John Doe and Jane Eod."` This string is empty if no label is provided.
- {{domxref("AudioTrack.language", "language")}} {{ReadOnlyInline}}
- : A string specifying the audio track's primary language, or an empty string if unknown. The language is specified as a BCP 47 ({{RFC(5646)}}) language code, such as `"en-US"` or `"pt-BR"`.
- {{domxref("AudioTrack.sourceBuffer", "sourceBuffer")}} {{ReadOnlyInline}}
- : The {{domxref("SourceBuffer")}} that created the track. Returns null if the track was not created by a {{domxref("SourceBuffer")}} or the {{domxref("SourceBuffer")}} has been removed from the {{domxref("MediaSource.sourceBuffers")}} attribute of its parent media source.
## Usage notes
To get an `AudioTrack` for a given media element, use the element's {{domxref("HTMLMediaElement.audioTracks", "audioTracks")}} property, which returns an {{domxref("AudioTrackList")}} object from which you can get the individual tracks contained in the media:
```js
const el = document.querySelector("video");
const tracks = el.audioTracks;
```
You can then access the media's individual tracks using either array syntax or functions such as {{jsxref("Array.forEach", "forEach()")}}.
This first example gets the first audio track on the media:
```js
const firstTrack = tracks[0];
```
The next example scans through all of the media's audio tracks, enabling any that are in the user's preferred language (taken from a variable `userLanguage`) and disabling any others.
```js
tracks.forEach((track) => {
track.enabled = track.language === userLanguage;
});
```
The {{domxref("AudioTrack.language", "language")}} is in standard ({{RFC(5646)}}) format. For US English, this would be `"en-US"`, for example.
## Example
See [`AudioTrack.label`](/en-US/docs/Web/API/AudioTrack/label#examples) for a simple example that shows how to get an array of track kinds and labels for a specified media element, filtered by kind.
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api/audiotrack | data/mdn-content/files/en-us/web/api/audiotrack/enabled/index.md | ---
title: "AudioTrack: enabled property"
short-title: enabled
slug: Web/API/AudioTrack/enabled
page-type: web-api-instance-property
browser-compat: api.AudioTrack.enabled
---
{{APIRef("HTML DOM")}}
The **{{domxref("AudioTrack")}}** property
**`enabled`** specifies whether or not the described audio
track is currently enabled for use. If the track is disabled by setting
`enabled` to `false`, the track is muted and does not produce
audio.
## Value
The `enabled` property is a Boolean whose value is `true` if the
track is enabled; enabled tracks produce audio while the media is playing. Setting
`enabled` to `false` effectively mutes the audio track, preventing
it from contributing to the media's audio performance.
## Example
This example switches between the main and commentary audio tracks of a media element.
```js
function swapCommentaryMain() {
const videoElem = document.getElementById("main-video");
let audioTrackMain;
let audioTrackCommentary;
videoElem.audioTracks.forEach((track) => {
if (track.kind === "main") {
audioTrackMain = track;
} else if (track.kind === "commentary") {
audioTrackCommentary = track;
}
});
if (audioTrackMain && audioTrackCommentary) {
const commentaryEnabled = audioTrackCommentary.enabled;
audioTrackCommentary.enabled = audioTrackMain.enabled;
audioTrackMain.enabled = commentaryEnabled;
}
}
```
The `swapCommentaryMain()` function above finds within the audio tracks of
the {{HTMLElement("video")}} element `"main-video"` the audio tracks whose
{{domxref("AudioTrack.kind", "kind")}} values are `"main"` and
`"commentary"`. These represent the primary audio track and the commentary
track.
> **Note:** This example assumes that there is only one of each kind of
> track in the video, but this is not necessarily the case.
The element's audio tracks are then scanned through using the JavaScript
{{jsxref("Array.forEach", "forEach()")}} method (although the
{{domxref("HTMLMediaElement.audioTracks", "audioTracks")}} property of a media element
isn't actually a JavaScript array, it can be accessed like one for the most part).
The scan looks for the tracks whose {{domxref("AudioTrack.kind", "kind")}} values are
`"main"` and `"commentary"` and remembers those
{{domxref("AudioTrack")}} objects. Once those have been found, the values of the two
tracks' `enabled` properties are exchanged, which results in swapping which
of the two tracks is currently active.
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api/audiotrack | data/mdn-content/files/en-us/web/api/audiotrack/language/index.md | ---
title: "AudioTrack: language property"
short-title: language
slug: Web/API/AudioTrack/language
page-type: web-api-instance-property
browser-compat: api.AudioTrack.language
---
{{APIRef("HTML DOM")}}
The read-only **{{domxref("AudioTrack")}}**
property **`language`** returns a string identifying the
language used in the audio track.
For tracks that include multiple languages
(such as a movie in English in which a few lines are spoken in other languages), this
should be the video's primary language.
## Value
A string specifying the BCP 47 ({{RFC(5646)}}) format language tag of
the primary language used in the audio track, or an empty string (`""`) if
the language is not specified or known, or if the track doesn't contain speech.
For example, if the primary language used in the track is United States English, this
value would be `"en-US"`. For Brazilian Portuguese, the value would be
`"pt-BR"`.
## Examples
This example locates all of a media element's primary language and translated audio
tracks and returns a list of objects containing each of those tracks'
{{domxref("AudioTrack.id", "id")}}, {{domxref("AudioTrack.kind", "kind")}}, and
`language`.
This could then be used to build a user interface for selecting the language the user
would like to listen to while watching a movie, for example.
```js
function getAvailableLanguages(el) {
const trackList = [];
const wantedKinds = ["main", "translation"];
el.audioTracks.forEach((track) => {
if (wantedKinds.includes(track.kind)) {
trackList.push({
id: track.id,
kind: track.kind,
language: track.language,
});
}
});
return trackList;
}
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api/audiotrack | data/mdn-content/files/en-us/web/api/audiotrack/id/index.md | ---
title: "AudioTrack: id property"
short-title: id
slug: Web/API/AudioTrack/id
page-type: web-api-instance-property
browser-compat: api.AudioTrack.id
---
{{APIRef("HTML DOM")}}
The **`id`** property contains a
string which uniquely identifies the track represented by the
**{{domxref("AudioTrack")}}**.
This ID can be used with the
{{domxref("AudioTrackList.getTrackById()")}} method to locate a specific track within
the media associated with a media element. The track ID can also be used as the fragment of a URL that loads the specific track
(if the media supports media fragments).
## Value
A string which identifies the track, suitable for use when calling
{{domxref("AudioTrackList.getTrackById", "getTrackById()")}} on an
{{domxref("AudioTrackList")}} such as the one specified by a media element's
{{domxref("HTMLMediaElement.audioTracks", "audioTracks")}} property.
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api/audiotrack | data/mdn-content/files/en-us/web/api/audiotrack/label/index.md | ---
title: "AudioTrack: label property"
short-title: label
slug: Web/API/AudioTrack/label
page-type: web-api-instance-property
browser-compat: api.AudioTrack.label
---
{{APIRef("HTML DOM")}}
The read-only **{{domxref("AudioTrack")}}**
property **`label`** returns a string specifying the audio
track's human-readable label, if one is available; otherwise, it returns an empty
string.
## Value
A string specifying the track's human-readable label, if one is
available in the track metadata. Otherwise, an empty string (`""`) is
returned.
For example, a track whose {{domxref("AudioTrack.kind", "kind")}} is
`"commentary"` might have a `label` such as
`"Commentary with director Mark Markmarkimark and star Donna Donnalidon"`.
## Examples
This example returns an array of track kinds and labels for potential use in a user
interface to select audio tracks for a specified media element. The list is filtered to
only allow certain track kinds through.
```js
function getTrackList(el) {
const trackList = [];
const wantedKinds = [
"main",
"alternative",
"main-desc",
"translation",
"commentary",
];
el.audioTracks.forEach((track) => {
if (wantedKinds.includes(track.kind)) {
trackList.push({
id: track.id,
kind: track.kind,
label: track.label,
});
}
});
return trackList;
}
```
The resulting `trackList` contains an array of audio tracks whose
`kind` is one of those in the array `wantedKinds`, with each entry
providing the track's {{domxref("AudioTrack.id", "id")}}, {{domxref("AudioTrack.kind",
"kind")}}, and {{domxref("AudioTrack.label", "label")}}.
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api/audiotrack | data/mdn-content/files/en-us/web/api/audiotrack/kind/index.md | ---
title: "AudioTrack: kind property"
short-title: kind
slug: Web/API/AudioTrack/kind
page-type: web-api-instance-property
browser-compat: api.AudioTrack.kind
---
{{APIRef("HTML DOM")}}
The **`kind`** property contains a
string indicating the category of audio contained in the
**{{domxref("AudioTrack")}}**.
The `kind` can be used
to determine the scenarios in which specific tracks should be enabled or disabled. See
[Audio track kind strings](#audio_track_kind_strings) for a list of the kinds available for audio tracks.
## Value
A string specifying the type of content the media represents. The
string is one of those found in [Audio track kind strings](#audio_track_kind_strings) below.
## Audio track kind strings
The kinds available for audio tracks are:
- `"alternative"`
- : A potential alternative to the main track, such as a different audio take or a
version of the soundtrack with only the music and no dialogue.
- `"descriptions"`
- : An audio track providing audible descriptions of the action depicted in a video
track.
- `"main"`
- : The primary audio track.
- `"main-desc"`
- : The primary audio track with audio descriptions mixed into it.
- `"translation"`
- : A translated version of the primary audio track.
- `"commentary"`
- : An audio track containing a commentary. This might be used to contain the director's
commentary track on a movie, for example.
- `""` (empty string)
- : The track doesn't have an explicit kind, or the kind provided by the track's
metadata isn't recognized by the {{Glossary("user agent")}}.
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api/audiotrack | data/mdn-content/files/en-us/web/api/audiotrack/sourcebuffer/index.md | ---
title: "AudioTrack: sourceBuffer property"
short-title: sourceBuffer
slug: Web/API/AudioTrack/sourceBuffer
page-type: web-api-instance-property
browser-compat: api.AudioTrack.sourceBuffer
---
{{APIRef("HTML DOM")}}
The read-only **{{domxref("AudioTrack")}}**
property **`sourceBuffer`** returns the
{{domxref("SourceBuffer")}} that created the track, or null if the track was not
created by a {{domxref("SourceBuffer")}} or the {{domxref("SourceBuffer")}} has been
removed from the {{domxref("MediaSource.sourceBuffers")}} attribute of its parent
media source.
## Value
A {{domxref("SourceBuffer")}} or null.
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api | data/mdn-content/files/en-us/web/api/processinginstruction/index.md | ---
title: ProcessingInstruction
slug: Web/API/ProcessingInstruction
page-type: web-api-interface
browser-compat: api.ProcessingInstruction
---
{{APIRef("DOM")}}
The **`ProcessingInstruction`** interface represents a [processing instruction](https://www.w3.org/TR/xml/#sec-pi); that is, a {{domxref("Node")}} which embeds an instruction targeting a specific application but that can be ignored by any other applications which don't recognize the instruction.
> **Warning:** `ProcessingInstruction` nodes are only supported in XML documents, not in HTML documents. In these, a process instruction will be considered as a comment and be represented as a {{domxref("Comment")}} object in the tree.
A processing instruction may be different than the [XML declaration](/en-US/docs/Web/XML/XML_introduction#xml_declaration).
> **Note:** User-defined processing instructions cannot begin with "`xml`", as `xml`-prefixed processing-instruction target names are reserved by the XML specification for particular, standard uses (see, for example, `<?xml-stylesheet ?>`.
For example:
```html
<?xml version="1.0"?>
```
is a processing instruction whose `target` is `xml`.
{{InheritanceDiagram}}
## Instance properties
_This interface also inherits properties from its parent interfaces, {{domxref("CharacterData")}}, {{domxref("Node")}}, and {{domxref("EventTarget")}}._
- {{domxref("ProcessingInstruction.sheet")}} {{ReadOnlyInline}}
- : Returns the associated {{domxref("StyleSheet")}} object, if any; or `null` if none.
- {{domxref("ProcessingInstruction.target")}} {{ReadOnlyInline}}
- : A name identifying the application to which the instruction is targeted.
## Instance methods
_This interface doesn't have any specific method, but inherits methods from its parent interfaces, {{domxref("CharacterData")}}, {{domxref("Node")}}, and {{domxref("EventTarget")}}._
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- [document.createProcessingInstruction()](/en-US/docs/Web/API/Document/createProcessingInstruction)
- The [DOM API](/en-US/docs/Web/API/Document_Object_Model)
| 0 |
data/mdn-content/files/en-us/web/api/processinginstruction | data/mdn-content/files/en-us/web/api/processinginstruction/target/index.md | ---
title: "ProcessingInstruction: target property"
short-title: target
slug: Web/API/ProcessingInstruction/target
page-type: web-api-instance-property
browser-compat: api.ProcessingInstruction.target
---
{{ApiRef("DOM")}}
The read-only **`target`** property of the {{domxref("ProcessingInstruction")}} interface
represent the application to which the `ProcessingInstruction` is targeted.
For example:
```html
<?xml version="1.0"?>
```
is a processing instruction whose `target` is `xml`.
## Value
A string containing the name of the application.
## Example
### In an XML document
```html hidden
<output></output>
```
```js
let parser = new DOMParser();
const doc = parser.parseFromString(
'<?xml version="1.0"?><test/>',
"application/xml",
);
const pi = doc.createProcessingInstruction(
"xml-stylesheet",
'href="mycss.css" type="text/css"',
);
doc.insertBefore(pi, doc.firstChild);
const output = document.querySelector("output");
output.textContent = `This processing instruction's target is: ${doc.firstChild.target}`;
```
{{EmbedLiveSample("In an XML document", "100%", 50)}}
### In an HTML document
The processing instruction line will be considered, and represented, as a {{domxref("Comment")}} object.
```html
<?xml version="1.0"?>
<pre></pre>
```
```js
const node = document.querySelector("pre").previousSibling.previousSibling;
const result = `Node with the processing instruction: ${node.nodeName}: ${node.nodeValue}\n`;
document.querySelector("pre").textContent = result;
```
{{EmbedLiveSample("In an HTML document", "100%", 50)}}
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- The [DOM API](/en-US/docs/Web/API/Document_Object_Model)
| 0 |
data/mdn-content/files/en-us/web/api/processinginstruction | data/mdn-content/files/en-us/web/api/processinginstruction/sheet/index.md | ---
title: "ProcessingInstruction: sheet property"
short-title: sheet
slug: Web/API/ProcessingInstruction/sheet
page-type: web-api-instance-property
browser-compat: api.ProcessingInstruction.sheet
---
{{ApiRef("DOM")}}
The read-only **`sheet`** property of the {{domxref("ProcessingInstruction")}} interface
contains the stylesheet associated to the `ProcessingInstruction`.
The `xml-stylesheet` processing instruction is used to associate a stylesheet in an XML file.
## Value
The associated {{DOMxref("Stylesheet")}} object, or `null` if there are none.
## Example
```xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="rule.css"?>
…
```
The `sheet` property of the processing instruction will return the {{domxref("StyleSheet")}} object describing `rule.css`.
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- The [DOM API](/en-US/docs/Web/API/Document_Object_Model)
| 0 |
data/mdn-content/files/en-us/web/api | data/mdn-content/files/en-us/web/api/svganimatedinteger/index.md | ---
title: SVGAnimatedInteger
slug: Web/API/SVGAnimatedInteger
page-type: web-api-interface
browser-compat: api.SVGAnimatedInteger
---
{{APIRef("SVG")}}
## SVG animated integer interface
The `SVGAnimatedInteger` interface is used for attributes of basic type [\<integer>](/en-US/docs/Web/SVG/Content_type#integer) which can be animated.
### Interface overview
<table class="no-markdown">
<tbody>
<tr>
<th scope="row">Also implement</th>
<td><em>None</em></td>
</tr>
<tr>
<th scope="row">Methods</th>
<td><em>None</em></td>
</tr>
<tr>
<th scope="row">Properties</th>
<td>
<ul>
<li>readonly long <code>baseVal</code></li>
<li>readonly long <code>animVal</code></li>
</ul>
</td>
</tr>
<tr>
<th scope="row">Normative document</th>
<td>
<a
href="https://www.w3.org/TR/SVG11/types.html#InterfaceSVGAnimatedInteger"
>SVG 1.1 (2nd Edition)</a
>
</td>
</tr>
</tbody>
</table>
## Instance properties
<table class="no-markdown">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>baseVal</code></td>
<td>long</td>
<td>
The base value of the given attribute before applying any animations.
</td>
</tr>
<tr>
<td><code>animVal</code></td>
<td>long</td>
<td>
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 <code>baseVal</code>.
</td>
</tr>
</tbody>
</table>
## Instance methods
The `SVGAnimatedInteger` interface do not provide any specific methods.
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api | data/mdn-content/files/en-us/web/api/csstransition/index.md | ---
title: CSSTransition
slug: Web/API/CSSTransition
page-type: web-api-interface
browser-compat: api.CSSTransition
---
{{APIRef("Web Animations")}}
The **`CSSTransition`** interface of the {{domxref('Web Animations API','','',' ')}} represents an {{domxref("Animation")}} object used for a [CSS Transition](/en-US/docs/Web/CSS/CSS_transitions).
{{InheritanceDiagram}}
## Instance properties
_This interface inherits properties from its parent, {{domxref("Animation")}}._
- {{domxref("CSSTransition.transitionProperty")}} {{ReadOnlyInline}}
- : Returns the transition CSS property name as a string.
## Instance methods
_This interface inherits methods from its parent, {{domxref("Animation")}}._
No specific methods.
## Examples
### Inspecting the returned CSSTransition
The transition in the following example changes the width of the box on hover. Calling {{domxref("Element.getAnimations()")}} returns an array of all {{domxref("Animation")}} objects. In our case this returns a `CSSTransition` object, representing the animation created.
```css
.box {
background-color: #165baa;
color: #fff;
width: 100px;
height: 100px;
transition: width 4s;
}
.box:hover {
width: 200px;
}
```
```js
const item = document.querySelector(".box");
item.addEventListener("transitionrun", () => {
let animations = document.querySelector(".box").getAnimations();
console.log(animations[0]);
});
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api/csstransition | data/mdn-content/files/en-us/web/api/csstransition/transitionproperty/index.md | ---
title: "CSSTransition: transitionProperty property"
short-title: transitionProperty
slug: Web/API/CSSTransition/transitionProperty
page-type: web-api-instance-property
browser-compat: api.CSSTransition.transitionProperty
---
{{APIRef("Web Animations")}}
The **`transitionProperty`** property of the
{{domxref("CSSTransition")}} interface returns the **expanded transition property
name** of the transition. This is the longhand CSS property for which the
transition was generated.
## Value
A string.
## Examples
### Returning the transitionProperty
The transition in the following example changes the width of the box on hover. Calling
{{domxref("Element.getAnimations()")}} returns an array of all {{domxref("Animation")}}
objects. In our case this returns a `CSSTransition` object, representing the
animation created. The `transitionProperty` property returns the property
that the transition is created for, which is `width`.
```css
.box {
background-color: #165baa;
color: #fff;
width: 100px;
height: 100px;
transition: width 4s;
}
.box:hover {
width: 200px;
}
```
```js
const item = document.querySelector(".box");
item.addEventListener("transitionrun", () => {
let animations = document.querySelector(".box").getAnimations();
console.log(animations[0].propertyName);
});
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api | data/mdn-content/files/en-us/web/api/hmdvrdevice/index.md | ---
title: HMDVRDevice
slug: Web/API/HMDVRDevice
page-type: web-api-interface
status:
- deprecated
- non-standard
browser-compat: api.HMDVRDevice
---
{{APIRef("WebVR API")}}{{Deprecated_Header}}{{Non-standard_Header}}
The **`HMDVRDevice`** interface of the [WebVR API](/en-US/docs/Web/API/WebVR_API) represents a head mounted display, providing access to information about each eye, and allowing us to modify the current field of view.
## Instance methods
- {{domxref("HMDVRDevice.getEyeParameters()")}} {{Deprecated_Inline}} {{Non-standard_Inline}}
- : Returns current parameters for the eye specified as its argument ("left" or "right") — such as field of view information — stored in a {{domxref("VREyeParameters")}} object.
- {{domxref("HMDVRDevice.setFieldOfView()")}} {{Deprecated_Inline}} {{Non-standard_Inline}}
- : Sets the field of view for both eyes.
## Instance properties
_This interface doesn't define any properties of its own, but it does inherit the properties of its parent interface, {{domxref("VRDisplay")}}._
- `VRDisplay.hardwareUnitId` {{ReadOnlyInline}}
- : Returns the distinct hardware ID for the overall hardware unit that this `VRDevice` is a part of. All devices that are part of the same physical piece of hardware will have the same `hardwareUnitId`.
- {{domxref("VRDisplay.displayId")}} {{ReadOnlyInline}}
- : Returns the ID for this specific `VRDevice`. The ID shouldn't change across browser restarts, allowing configuration data to be saved based on it.
- {{domxref("VRDisplay.displayName")}} {{ReadOnlyInline}}
- : A human-readable name to identify the `VRDevice`.
## Examples
The following example, taken from the WebVR spec, finds the first available `HMDVRDevice` and its associated {{domxref("PositionSensorVRDevice")}}, if it has one.
```js
navigator.getVRDevices().then((devices) => {
for (const device of devices) {
if (device instanceof HMDVRDevice) {
gHMD = device;
break;
}
}
if (gHMD) {
for (const device of devices) {
if (
device instanceof PositionSensorVRDevice &&
device.hardwareUnitId === gHMD.hardwareUnitId
) {
gPositionSensor = devices[i];
break;
}
}
}
});
```
## Browser compatibility
{{Compat}}
## See also
- [WebVR API](/en-US/docs/Web/API/WebVR_API)
| 0 |
data/mdn-content/files/en-us/web/api/hmdvrdevice | data/mdn-content/files/en-us/web/api/hmdvrdevice/setfieldofview/index.md | ---
title: "HMDVRDevice: setFieldOfView() method"
short-title: setFieldOfView()
slug: Web/API/HMDVRDevice/setFieldOfView
page-type: web-api-instance-method
status:
- deprecated
- non-standard
browser-compat: api.HMDVRDevice.setFieldOfView
---
{{deprecated_header}}{{APIRef("WebVR API")}}{{Non-standard_header}}
The **`setFieldOfView()`** method of the {{domxref("HMDVRDevice")}} interface can be used to set the field of view for one eye, or both eyes simultaneously.
## Syntax
```js-nolint
setFieldOfView(leftFOV, rightFOV, zNear, zFar)
```
### Parameters
- `leftFOV` {{optional_inline}}
- : A {{domxref("VRFieldOfView")}} object that defines the new field of view for the left eye. If not specified, the left eye field of view does not change.
- `rightFOV` {{optional_inline}}
- : A {{domxref("VRFieldOfView")}} object that defines the new field of view for the right eye. If not specified, the right eye field of view does not change.
- `zNear` {{optional_inline}}
- : The distance from the eyes of the nearest point of the view. The closest things can be and still be in the view. If not specified, the default is used — `0.01`.
- `zFar` {{optional_inline}}
- : The distance from the eyes of the farthest point of the view. The furthest away things can be and still be in the view. If not specified, the default is used — `10000.0`.
### Return value
None ({{jsxref("undefined")}}).
## Examples
The following simple example shows a function that can be used to set a custom field of view with four specified degree values for up, right, down and left. The `VRFieldOfView()` constructor is used to create a {{domxref("VRFieldOfView")}} object from the supplied values, which is then fed into the `setFieldOfView()` method (the default `zNear` and `zFar` values are always used, in this case.)
```js
function setCustomFOV(up, right, down, left) {
const testFOV = new VRFieldOfView(up, right, down, left);
gHMD.setFieldOfView(testFOV, testFOV, 0.01, 10000.0);
const lEye = gHMD.getEyeParameters("left");
const rEye = gHMD.getEyeParameters("right");
console.log(lEye.currentFieldOfView);
console.log(rEye.currentFieldOfView);
}
```
> **Note:** When testing, setting a weird/tiny field of view can really mess up your view. It is a good idea to grab the current field of view first (using {{domxref("VREyeParameters.fieldOfView")}}) before making any drastic changes, so you can reset it afterwards if needed.
## Browser compatibility
{{Compat}}
## See also
- [WebVR API](/en-US/docs/Web/API/WebVR_API)
| 0 |
data/mdn-content/files/en-us/web/api/hmdvrdevice | data/mdn-content/files/en-us/web/api/hmdvrdevice/geteyeparameters/index.md | ---
title: "HMDVRDevice: getEyeParameters() method"
short-title: getEyeParameters()
slug: Web/API/HMDVRDevice/getEyeParameters
page-type: web-api-instance-method
status:
- deprecated
- non-standard
browser-compat: api.HMDVRDevice.getEyeParameters
---
{{deprecated_header}}{{APIRef("WebVR API")}}{{Non-standard_header}}
The **`getEyeParameters()`** method of the {{domxref("HMDVRDevice")}} interface returns current parameters for the eye specified as its argument ("left" or "right") — stored in a {{domxref("VREyeParameters")}} object.
This includes field of view information, and more.
## Syntax
```js-nolint
getEyeParameters(whichEye)
```
### Parameters
- `whichEye`
- : A string representing the eye you want to return information about. The value can be `left` or `right`.
### Return value
A {{domxref("VREyeParameters")}} object.
## Examples
The following example is taken from the Mozilla VR Team's [threejs-vr-boilerplate](https://github.com/MozillaReality/vr-web-examples/tree/master/threejs-vr-boilerplate) code — to be precise, the [VREffect.js file](https://github.com/MozillaReality/vr-web-examples/blob/master/threejs-vr-boilerplate/js/VREffect.js). Early on in the code the `getEyeParameters()` method is used to access information about each eye, which is then used for rendering calculations later on.
```js
if (vrHMD.getEyeParameters !== undefined) {
const eyeParamsL = vrHMD.getEyeParameters("left");
const eyeParamsR = vrHMD.getEyeParameters("right");
eyeTranslationL = eyeParamsL.eyeTranslation;
eyeTranslationR = eyeParamsR.eyeTranslation;
eyeFOVL = eyeParamsL.recommendedFieldOfView;
eyeFOVR = eyeParamsR.recommendedFieldOfView;
} else {
// …
}
```
## Browser compatibility
{{Compat}}
## See also
- [WebVR API](/en-US/docs/Web/API/WebVR_API)
| 0 |
data/mdn-content/files/en-us/web/api | data/mdn-content/files/en-us/web/api/datatransferitemlist/index.md | ---
title: DataTransferItemList
slug: Web/API/DataTransferItemList
page-type: web-api-interface
browser-compat: api.DataTransferItemList
---
{{APIRef("HTML Drag and Drop API")}}
The **`DataTransferItemList`** object is a list of {{domxref("DataTransferItem")}} objects representing items being dragged. During a _drag operation_, each {{domxref("DragEvent")}} has a {{domxref("DragEvent.dataTransfer","dataTransfer")}} property and that property is a `DataTransferItemList`.
The individual items can be accessed using the [bracket notation](/en-US/docs/Web/JavaScript/Reference/Operators/Property_accessors#bracket_notation) `[]`.
This interface has no constructor.
## Instance properties
- {{domxref("DataTransferItemList.length")}} {{ReadOnlyInline}}
- : An `unsigned long` that is the number of drag items in the list.
## Instance methods
- {{domxref("DataTransferItemList.add()")}}
- : Adds an item (either a {{domxref("File")}} object or a string) to the drag item list and returns a {{domxref("DataTransferItem")}} object for the new item.
- {{domxref("DataTransferItemList.remove()")}}
- : Removes the drag item from the list at the given index.
- {{domxref("DataTransferItemList.clear()")}}
- : Removes all of the drag items from the list.
- {{domxref("DataTransferItemList.operator[]")}}
- : Getter that returns a {{domxref("DataTransferItem")}} at the given index.
## Example
This example shows how to use drag and drop.
### JavaScript
```js
function dragstartHandler(ev) {
console.log("dragStart");
// Add this element's id to the drag payload so the drop handler will
// know which element to add to its tree
const dataList = ev.dataTransfer.items;
dataList.add(ev.target.id, "text/plain");
// Add some other items to the drag payload
dataList.add("<p>Paragraph…</p>", "text/html");
dataList.add("http://www.example.org", "text/uri-list");
}
function dropHandler(ev) {
console.log("Drop");
ev.preventDefault();
// Loop through the dropped items and log their data
for (const item of ev.dataTransfer.items) {
if (item.kind === "string" && item.type.match(/^text\/plain/)) {
// This item is the target node
item.getAsString((s) => {
ev.target.appendChild(document.getElementById(s));
});
} else if (item.kind === "string" && item.type.match(/^text\/html/)) {
// Drag data item is HTML
item.getAsString((s) => {
console.log(`… Drop: HTML = ${s}`);
});
} else if (item.kind === "string" && item.type.match(/^text\/uri-list/)) {
// Drag data item is URI
item.getAsString((s) => {
console.log(`… Drop: URI = ${s}`);
});
}
}
}
function dragoverHandler(ev) {
console.log("dragOver");
ev.preventDefault();
// Set the dropEffect to move
ev.dataTransfer.dropEffect = "move";
}
function dragendHandler(ev) {
console.log("dragEnd");
const dataList = ev.dataTransfer.items;
// Clear any remaining drag data
dataList.clear();
}
```
### HTML
```html
<div>
<p
id="source"
ondragstart="dragstartHandler(event);"
ondragend="dragendHandler(event);"
draggable="true">
Select this element, drag it to the Drop Zone and then release the selection
to move the element.
</p>
</div>
<div
id="target"
ondrop="dropHandler(event);"
ondragover="dragoverHandler(event);">
Drop Zone
</div>
```
### CSS
```css
div {
margin: 0em;
padding: 2em;
}
#source {
color: blue;
border: 1px solid black;
}
#target {
border: 1px solid black;
}
```
### Result
{{EmbedLiveSample('Example', '35%', '250px')}}
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api/datatransferitemlist | data/mdn-content/files/en-us/web/api/datatransferitemlist/remove/index.md | ---
title: "DataTransferItemList: remove() method"
short-title: remove()
slug: Web/API/DataTransferItemList/remove
page-type: web-api-instance-method
browser-compat: api.DataTransferItemList.remove
---
{{APIRef("HTML Drag and Drop API")}}
The **`DataTransferItemList.remove()`** method removes the
{{domxref("DataTransferItem")}} at the specified index from the list. If the index is
less than zero or greater than one less than the length of the list, the list will not
be changed.
## Syntax
```js-nolint
remove(index)
```
### Parameters
- `index`
- : The zero-based index number of the item in the drag data list to remove. If the
`index` doesn't correspond to an existing item in the list, the list is
left unchanged.
### Return value
None ({{jsxref("undefined")}}).
### Exceptions
- `InvalidStateError` {{domxref("DOMException")}}
- : Thrown if the drag data store is not in read/write mode and so the item cannot be removed.
## Examples
### Dragging and dropping an element
This example shows the use of the `remove()` method.
#### HTML
```html
<div>
<p id="source" draggable="true">
Select this element, drag it to the Drop Zone and then release the selection
to move the element.
</p>
</div>
<div id="target">Drop Zone</div>
```
#### CSS
```css
div {
margin: 0em;
padding: 2em;
}
#source {
color: blue;
border: 1px solid black;
}
#target {
border: 1px solid black;
}
```
#### JavaScript
```js
function dragstart_handler(ev) {
console.log("dragStart");
// Add this element's id to the drag payload so the drop handler will
// know which element to add to its tree
const dataList = ev.dataTransfer.items;
dataList.add(ev.target.id, "text/plain");
// Add some other items to the drag payload
dataList.add("<p>Paragraph…</p>", "text/html");
dataList.add("http://www.example.org", "text/uri-list");
}
function drop_handler(ev) {
console.log("Drop");
ev.preventDefault();
const data = event.dataTransfer.items;
// Loop through the dropped items and log their data
for (const item of data) {
if (item.kind === "string" && item.type.match("^text/plain")) {
// This item is the target node
item.getAsString((s) => {
ev.target.appendChild(document.getElementById(s));
});
} else if (item.kind === "string" && item.type.match("^text/html")) {
// Drag data item is HTML
item.getAsString((s) => {
console.log(`… Drop: HTML = ${s}`);
});
} else if (item.kind === "string" && item.type.match("^text/uri-list")) {
// Drag data item is URI
item.getAsString((s) => {
console.log(`… Drop: URI = ${s}`);
});
}
}
}
function dragover_handler(ev) {
console.log("dragOver");
ev.preventDefault();
// Set the dropEffect to move
ev.dataTransfer.dropEffect = "move";
}
function dragend_handler(ev) {
console.log("dragEnd");
const dataList = ev.dataTransfer.items;
// Clear all the files. Iterate in reverse order to safely remove.
for (let i = dataList.length - 1; i >= 0; i--) {
if (dataList[i].kind === "file") {
dataList.remove(i);
}
}
// Clear any remaining drag data
dataList.clear();
}
const source = document.querySelector("#source");
source.addEventListener("dragstart", dragstart_handler);
source.addEventListener("dragend", dragend_handler);
const target = document.querySelector("#target");
target.addEventListener("drop", drop_handler);
target.addEventListener("dragover", dragover_handler);
```
#### Result
{{ EmbedLiveSample('Dragging and dropping an element', 100, '300px')}}
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api/datatransferitemlist | data/mdn-content/files/en-us/web/api/datatransferitemlist/add/index.md | ---
title: "DataTransferItemList: add() method"
short-title: add()
slug: Web/API/DataTransferItemList/add
page-type: web-api-instance-method
browser-compat: api.DataTransferItemList.add
---
{{APIRef("HTML Drag and Drop API")}}
The **`DataTransferItemList.add()`** method creates a new
{{domxref("DataTransferItem")}} using the specified data and adds it to the drag data
list. The item may be a {{domxref("File")}} or a string of a
given type. If the item is successfully added to the list, the newly-created
{{domxref("DataTransferItem")}} object is returned.
## Syntax
```js-nolint
add(data, type)
add(file)
```
### Parameters
- `data`
- : A string representing the drag item's data.
- `type`
- : A string of the drag item's type. Some example types are
`text/html` and `text/plain`.
- `file`
- : A {{domxref("File")}} object. No type needs to be given in this case.
### Return value
A {{domxref("DataTransferItem")}} containing the specified data. If the drag item
couldn't be created (for example, if the associated {{domxref("DataTransfer")}} object
has no data store), `null` is returned.
### Exceptions
- `NotSupportedError` {{domxref("DOMException")}}
- : Thrown if the string `data` parameter was provided, and the list already contains an
item whose {{domxref("DataTransferItem.kind","kind")}} is `"Plain Unicode string"` and
whose type is equal to the specified type parameter.
## Examples
This example shows the use of the `add()` method.
### HTML
```html
<div>
<p
id="source"
ondragstart="dragstart_handler(event);"
ondragend="dragend_handler(event);"
draggable="true">
Select this element, drag it to the Drop Zone and then release the selection
to move the element.
</p>
</div>
<div
id="target"
ondrop="drop_handler(event);"
ondragover="dragover_handler(event);">
Drop Zone
</div>
```
### CSS
```css
div {
margin: 0em;
padding: 2em;
}
#source {
color: blue;
border: 1px solid black;
}
#target {
border: 1px solid black;
}
```
### JavaScript
```js
function dragstart_handler(ev) {
console.log("dragStart");
// Add this element's id to the drag payload so the drop handler will
// know which element to add to its tree
const dataList = ev.dataTransfer.items;
dataList.add(ev.target.id, "text/plain");
// Add some other items to the drag payload
dataList.add("<p>Paragraph…</p>", "text/html");
dataList.add("http://www.example.org", "text/uri-list");
}
function drop_handler(ev) {
console.log("Drop");
ev.preventDefault();
const data = event.dataTransfer.items;
// Loop through the dropped items and log their data
for (let i = 0; i < data.length; i++) {
if (data[i].kind === "string" && data[i].type.match("^text/plain")) {
// This item is the target node
data[i].getAsString((s) => {
ev.target.appendChild(document.getElementById(s));
});
} else if (data[i].kind === "string" && data[i].type.match("^text/html")) {
// Drag data item is HTML
data[i].getAsString((s) => {
console.log(`… Drop: HTML = ${s}`);
});
} else if (
data[i].kind === "string" &&
data[i].type.match("^text/uri-list")
) {
// Drag data item is URI
data[i].getAsString((s) => {
console.log(`… Drop: URI = ${s}`);
});
}
}
}
function dragover_handler(ev) {
console.log("dragOver");
ev.preventDefault();
// Set the dropEffect to move
ev.dataTransfer.dropEffect = "move";
}
function dragend_handler(ev) {
console.log("dragEnd");
const dataList = ev.dataTransfer.items;
for (let i = 0; i < dataList.length; i++) {
dataList.remove(i);
}
// Clear any remaining drag data
dataList.clear();
}
```
### Result
{{EmbedLiveSample('Examples', 400, 300)}}
{{LiveSampleLink('Examples', 'Result link')}}
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api/datatransferitemlist | data/mdn-content/files/en-us/web/api/datatransferitemlist/length/index.md | ---
title: "DataTransferItemList: length property"
short-title: length
slug: Web/API/DataTransferItemList/length
page-type: web-api-instance-property
browser-compat: api.DataTransferItemList.length
---
{{APIRef("HTML Drag and Drop API")}}
The read-only **`length`** property of the
{{domxref("DataTransferItemList")}} interface returns the number of items currently in
the drag item list.
## Value
The number of drag data items in the list, or 0 if the list is empty or disabled. The
drag item list is considered to be disabled if the item list's
{{domxref("DataTransfer")}} object is not associated with a drag data store.
## Examples
This example shows the use of the `length` property.
### JavaScript
```js
function dragstart_handler(ev) {
console.log("dragStart");
// Add this element's id to the drag payload so the drop handler will
// know which element to add to its tree
const dataList = ev.dataTransfer.items;
dataList.add(ev.target.id, "text/plain");
// Add some other items to the drag payload
dataList.add("<p>Paragraph…</p>", "text/html");
dataList.add("http://www.example.org", "text/uri-list");
}
function drop_handler(ev) {
console.log("Drop");
ev.preventDefault();
const data = ev.dataTransfer.items;
// Loop through the dropped items and log their data
for (let i = 0; i < data.length; i++) {
if (data[i].kind === "string" && data[i].type.match("^text/plain")) {
// This item is the target node
data[i].getAsString((s) => {
ev.target.appendChild(document.getElementById(s));
});
} else if (data[i].kind === "string" && data[i].type.match("^text/html")) {
// Drag data item is HTML
data[i].getAsString((s) => {
console.log(`… Drop: HTML = ${s}`);
});
} else if (
data[i].kind === "string" &&
data[i].type.match("^text/uri-list")
) {
// Drag data item is URI
data[i].getAsString((s) => {
console.log(`… Drop: URI = ${s}`);
});
}
}
}
function dragover_handler(ev) {
console.log("dragOver");
ev.preventDefault();
// Set the dropEffect to move
ev.dataTransfer.dropEffect = "move";
}
function dragend_handler(ev) {
console.log("dragEnd");
const dataList = ev.dataTransfer.items;
// Clear any remaining drag data
dataList.clear();
}
```
### HTML
```html
<div>
<p
id="source"
ondragstart="dragstart_handler(event);"
ondragend="dragend_handler(event);"
draggable="true">
Select this element, drag it to the Drop Zone and then release the selection
to move the element.
</p>
</div>
<div
id="target"
ondrop="drop_handler(event);"
ondragover="dragover_handler(event);">
Drop Zone
</div>
```
### CSS
```css
div {
margin: 0em;
padding: 2em;
}
#source {
color: blue;
border: 1px solid black;
}
#target {
border: 1px solid black;
}
```
### Result
{{EmbedLiveSample('Examples', 100, 250)}}
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api/datatransferitemlist | data/mdn-content/files/en-us/web/api/datatransferitemlist/clear/index.md | ---
title: "DataTransferItemList: clear() method"
short-title: clear()
slug: Web/API/DataTransferItemList/clear
page-type: web-api-instance-method
browser-compat: api.DataTransferItemList.clear
---
{{APIRef("HTML Drag and Drop API")}}
The {{domxref("DataTransferItemList")}} method
**`clear()`** removes all {{domxref("DataTransferItem")}}
objects from the drag data items list, leaving the list empty.
The drag data store in which this list is kept is only writable while handling the
{{domxref("HTMLElement/dragstart_event", "dragstart")}} event. While handling {{domxref("HTMLElement/drop_event", "drop")}}, the drag data store is
in read-only mode, and this method silently does nothing. No exception is thrown.
## Syntax
```js-nolint
clear()
```
### Parameters
None.
### Return value
None ({{jsxref("undefined")}}).
## Examples
This example shows the use of the `clear()` method.
### HTML
```html
<div>
<p
id="source"
ondragstart="dragstartHandler(event);"
ondragend="dragendHandler(event);"
draggable="true">
Select this element, drag it to the Drop Zone and then release the selection
to move the element.
</p>
</div>
<div
id="target"
ondrop="dropHandler(event);"
ondragover="dragoverHandler(event);">
Drop Zone
</div>
```
### CSS
```css
div {
margin: 0em;
padding: 2em;
}
#source {
color: blue;
border: 1px solid black;
}
#target {
border: 1px solid black;
}
```
### JavaScript
```js
function dragstartHandler(ev) {
console.log("dragStart");
// Add this element's id to the drag payload so the drop handler will
// know which element to add to its tree
const dataList = ev.dataTransfer.items;
dataList.add(ev.target.id, "text/plain");
}
function dropHandler(ev) {
console.log("Drop");
ev.preventDefault();
// Loop through the dropped items and log their data
for (const item of ev.dataTransfer.items) {
if (item.kind === "string" && item.type.match(/^text\/plain/)) {
// This item is the target node
item.getAsString((s) => {
ev.target.appendChild(document.getElementById(s));
});
} else if (item.kind === "string" && item.type.match(/^text\/html/)) {
// Drag data item is HTML
item.getAsString((s) => {
console.log(`… Drop: HTML = ${s}`);
});
} else if (item.kind === "string" && item.type.match(/^text\/uri-list/)) {
// Drag data item is URI
item.getAsString((s) => {
console.log(`… Drop: URI = ${s}`);
});
}
}
}
function dragoverHandler(ev) {
console.log("dragOver");
ev.preventDefault();
// Set the dropEffect to move
ev.dataTransfer.dropEffect = "move";
}
function dragendHandler(ev) {
console.log("dragEnd");
const dataList = ev.dataTransfer.items;
// Clear any remaining drag data
dataList.clear();
}
```
### Result
{{EmbedLiveSample('Examples', 400, 300)}}
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api | data/mdn-content/files/en-us/web/api/clearinterval/index.md | ---
title: clearInterval() global function
short-title: clearInterval()
slug: Web/API/clearInterval
page-type: web-api-global-function
browser-compat: api.clearInterval
---
{{APIRef("HTML DOM")}}{{AvailableInWorkers}}
The global **`clearInterval()`** method cancels a timed, repeating action which
was previously established by a call to {{domxref("setInterval", "setInterval()")}}.
If the parameter provided does not identify a previously established action,
this method does nothing.
## Syntax
```js-nolint
clearInterval(intervalID)
```
### Parameters
- `intervalID`
- : The identifier of the repeated action you want to cancel. This ID was returned by
the corresponding call to `setInterval()`.
It's worth noting that the pool of IDs used by
{{domxref("setInterval", "setInterval()")}} and
{{domxref("setTimeout()")}} are shared, which
means you can technically use `clearInterval()` and
{{domxref("clearTimeout", "clearTimeout()")}} interchangeably.
However, for clarity, you should avoid doing so.
### Return value
None ({{jsxref("undefined")}}).
## Examples
See the [`setInterval()` examples](/en-US/docs/Web/API/setInterval#examples).
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{domxref("setTimeout()")}}
- {{domxref("setInterval()")}}
- {{domxref("clearTimeout()")}}
- {{domxref("Window.requestAnimationFrame()")}}
| 0 |
data/mdn-content/files/en-us/web/api | data/mdn-content/files/en-us/web/api/usbconnectionevent/index.md | ---
title: USBConnectionEvent
slug: Web/API/USBConnectionEvent
page-type: web-api-interface
status:
- experimental
browser-compat: api.USBConnectionEvent
---
{{securecontext_header}}{{APIRef("WebUSB API")}}{{SeeCompatTable}}
The **`USBConnectionEvent`** interface of the {{domxref('WebUSB API','','',' ')}} is the event type passed to `USB` {{domxref("USB.connect_event", "connect")}} and {{domxref("USB.disconnect_event", "disconnect")}} events when the user agent detects that a new USB device has been connected or disconnected.
{{InheritanceDiagram}}
## Constructor
- {{domxref("USBConnectionEvent.USBConnectionEvent", "USBConnectionEvent()")}} {{Experimental_Inline}}
- : Returns a `USBConnectionEvent` object.
## Instance properties
- {{domxref("USBConnectionEvent.device")}} {{ReadOnlyInline}} {{Experimental_Inline}}
- : Returns a {{domxref("USBDevice")}} object representing the current device.
## Examples
In the following example listening for connect and disconnect events is used to add and remove the devices from the user interface of an application.
```js
navigator.usb.addEventListener("connect", (event) => {
// Add event.device to the UI.
});
navigator.usb.addEventListener("disconnect", (event) => {
// Remove event.device from the UI.
});
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api/usbconnectionevent | data/mdn-content/files/en-us/web/api/usbconnectionevent/usbconnectionevent/index.md | ---
title: "USBConnectionEvent: USBConnectionEvent() constructor"
short-title: USBConnectionEvent()
slug: Web/API/USBConnectionEvent/USBConnectionEvent
page-type: web-api-constructor
status:
- experimental
browser-compat: api.USBConnectionEvent.USBConnectionEvent
---
{{securecontext_header}}{{APIRef("WebUSB API")}}{{SeeCompatTable}}
The **`USBConnectionEvent()`** constructor creates a new {{domxref("USBConnectionEvent")}} object.
This constructor is not typically used,
it is created by the browser in response to the connection and disconnection of a USB device.
## Syntax
```js-nolint
new USBConnectionEvent(type, options)
```
### Parameters
- `type`
- : A string with the name of the event.
It is case-sensitive and browsers set it to `connect` or `disconnect`.
- `options`
- : An object that, _in addition of the properties defined in {{domxref("Event/Event", "Event()")}}_, can have the following properties:
- `device`
- : A {{domxref("USBDevice")}} representing the USB device being connected or disconnected.
### Return value
A new {{domxref("USBConnectionEvent")}} object.
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api/usbconnectionevent | data/mdn-content/files/en-us/web/api/usbconnectionevent/device/index.md | ---
title: "USBConnectionEvent: device property"
short-title: device
slug: Web/API/USBConnectionEvent/device
page-type: web-api-instance-property
status:
- experimental
browser-compat: api.USBConnectionEvent.device
---
{{securecontext_header}}{{APIRef("WebUSB API")}}{{SeeCompatTable}}
The **`device`** read-only property of the {{domxref("USBConnectionEvent")}} interface returns a {{domxref("USBDevice")}} object representing the device being connected or disconnected.
## Value
A {{domxref("USBDevice")}} object.
## Examples
Connecting a USB device fires the `connect` event. The current {{domxref("USBDevice")}} is returned by calling `event.device`.
```js
navigator.usb.addEventListener("connect", (event) => {
console.log(event.device);
});
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api | data/mdn-content/files/en-us/web/api/xrinputsource/index.md | ---
title: XRInputSource
slug: Web/API/XRInputSource
page-type: web-api-interface
browser-compat: api.XRInputSource
---
{{APIRef("WebXR Device API")}}{{SecureContext_Header}}
The [WebXR Device API's](/en-US/docs/Web/API/WebXR_Device_API) **`XRInputSource`** interface describes a single source of control input which is part of the user's WebXR-compatible virtual or augmented reality system. The device is specific to the platform being used, but provides the direction in which it is being aimed and optionally may generate events if the user triggers performs actions using the device.
## Instance properties
- {{domxref("XRInputSource.gamepad", "gamepad")}} {{ReadOnlyInline}}
- : A {{domxref("Gamepad")}} object describing the state of the buttons and axes on the XR input source, if it is a gamepad or comparable device. If the device isn't a gamepad-like device, this property's value is `null`.
- {{domxref('XRInputSource.gripSpace', 'gripSpace')}} {{ReadOnlyInline}}
- : An {{domxref("XRSpace")}} whose origin tracks the pose which is used to render objects which should appear as if they're held in the hand indicated by `handedness`. The orientation of this space indicates the angle at which the hand is gripping the object. Read on in the main article on {{domxref("XRInputSource.gripSpace", "gripSpace")}} for more details on how to use this space.
- {{domxref('XRInputSource.hand', 'hand')}} {{ReadOnlyInline}}
- : An {{domxref("XRHand")}} object providing access to the underlying hand-tracking device.
- {{domxref('XRInputSource.handedness', 'handedness')}} {{ReadOnlyInline}}
- : A string that indicates which hand the device represented by this `XRInputSource` is being used in, if any. The value will be `left`, `right`, or `none`.
- {{domxref('XRInputSource.profiles', 'profiles')}} {{ReadOnlyInline}}
- : An array of strings, each specifying the name of an input profile describing the preferred visual representation and behavior of this input source.
- {{domxref('XRInputSource.targetRayMode', 'targetRayMode')}} {{ReadOnlyInline}}
- : A string indicating the methodology used to produce the target ray: `gaze`, `tracked-pointer`, or `screen`.
- {{domxref('XRInputSource.targetRaySpace', 'targetRaySpace')}} {{ReadOnlyInline}}
- : An {{domxref("XRSpace")}} object defining the origin of the target ray and the direction in which it extends. This space is established using the method defined by `targetRayMode`.
## Instance methods
_The `XRInputSource` interface defines no methods._
## Usage notes
### Actions and the target ray
If the device provides an indication of the direction in which it is pointed, this is done using a **target ray**. This is a ray extending from the position of the device outward in the direction in which it is pointed.
**A target ray emitted by a hand controller.**

If the device includes a trigger or other squeezable input, such as a hand gesture device that recognizes when the user squeezes their fist, that action is called a **primary squeeze action**. A primary squeeze action should correspond to a gripping act in reality, such as taking hold of an object or pressing a trigger on a tool or weapon. When a squeeze action begins, such as by the user pressing the trigger or tightening their grip, a {{domxref("XRSession.squeezestart_event", "squeezestart")}} event is sent to the `XRSession`. Once the action is completed and the user has released the trigger or the grip, a {{domxref("XRSession.squeeze_event", "squeeze")}} event is sent. This is followed by a {{domxref("XRSession.squeezeend_event", "squeezeend")}}, which is also sent if the action is aborted rather than completed.
If the device has a button or other pressable input control, it is a **primary input source**, and this button is a **primary action**. A primary action may occur when the user presses a button, clicks on a touchpad or the top button of a thumb stick, or uses a hand gesture or spoken command that invokes the button-like action. When a primary action begins, a {{domxref("XRSession.selectstart_event", "selectstart")}} event is sent to the {{domxref("XRSession")}}. When the action has completed (such as when the user releases the button), a {{domxref("XRSession.select_event", "select")}} event is sent. Finally, once that is done—or if the user aborts the action—a {{domxref("XRSession.selectend_event", "selectend")}} event is sent to the session object.
An action may be aborted either by the user in some device-specific fashion or if the input device is disconnected before the action is completed.
### Local coordinate system
Each input source has its own local coordinate system, which is described by the {{domxref("XRInputSource.gripSpace", "gripSpace")}} property, which is an {{domxref("XRSpace")}} used to map the input's coordinate system into the world coordinate system. The grip space's coordinate system can then be used to render objects so they appear to be held in the user's hand.

For more details on the input source's coordinate system, see the article that covers the {{domxref("XRInputSource.gripSpace", "gripSpace")}} property in detail.
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- [WebXR Device API](/en-US/docs/Web/API/WebXR_Device_API)
- [Inputs and input sources](/en-US/docs/Web/API/WebXR_Device_API/Inputs)
- {{domxref("XRInputSourceArray")}}
- {{domxref("XRSpace")}}
| 0 |
data/mdn-content/files/en-us/web/api | data/mdn-content/files/en-us/web/api/xrinputsource/xr-hand-axes.svg | <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 1014.35 1066.31"><defs><linearGradient id="rod_2" data-name="rod 2" x1="462.94" y1="391.27" x2="592.94" y2="391.27" gradientUnits="userSpaceOnUse"><stop offset=".56" stop-color="#ff8a15"/><stop offset=".85" stop-color="#ebcaa9"/><stop offset=".99" stop-color="#ff8a15"/></linearGradient><linearGradient id="rod_2-2" x1="462.94" y1="726.19" x2="592.94" y2="726.19" xlink:href="#rod_2"/><linearGradient id="linear-gradient" x1="332.94" y1="664.62" x2="611.46" y2="664.62" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#ab8679" stop-opacity="0"/><stop offset=".63" stop-color="#ab8679"/></linearGradient><linearGradient id="linear-gradient-2" x1="578.05" y1="348.72" x2="531.01" y2="267.23" gradientUnits="userSpaceOnUse"><stop offset=".52" stop-color="#ab8679"/><stop offset="1" stop-color="#ab8679" stop-opacity="0"/></linearGradient><linearGradient id="linear-gradient-3" x1="414.17" y1="340.47" x2="562.42" y2="488.72" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#ffd9cc" stop-opacity="0"/><stop offset=".28" stop-color="#ffd9cc"/></linearGradient><linearGradient id="linear-gradient-4" x1="613.32" y1="611.9" x2="890.91" y2="772.17" gradientUnits="userSpaceOnUse"><stop offset=".28" stop-color="#ab8679"/><stop offset="1" stop-color="#ab8679" stop-opacity="0"/></linearGradient><linearGradient id="linear-gradient-5" x1="645.45" y1="471.38" x2="547.24" y2="641.49" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#c99e8f" stop-opacity="0"/><stop offset=".61" stop-color="#c99e8f"/></linearGradient><radialGradient id="radial-gradient" cx="528.32" cy="539.15" r="204.97" gradientUnits="userSpaceOnUse"><stop offset=".13" stop-color="#264980"/><stop offset=".6" stop-color="#264980" stop-opacity="0"/></radialGradient><style>.cls-12{opacity:.64}.cls-13{isolation:isolate}.cls-15{fill:#0053a7}.cls-16{fill:#002850}.cls-20{fill:#00458b}.cls-21{fill:#005cb8}.cls-22{fill:#0065cc}.cls-29{fill:#c1272d}</style></defs><g id="Layer_1" data-name="Layer 1"><g id="rod"><path d="M567 692.07A360.46 360.46 0 0 0 605.66 709c7.63 2.81 17.39 6.12 28.87 9.28 6.09 1.68 15.19 4.16 27.28 6.37a277.91 277.91 0 0 0 35.06 4.14c16.25.85 27.59 1.44 42.36-1.38.42-.08 8.62-2.1 25-6.14 13.28-3.27 16-4 22.13-5.43 13.16-3.16 19.74-4.74 25.41-5.89a312 312 0 0 1 32.76-4.85c18.5-1.74 39.87-3.57 65.67 2.13 6.76 1.5 12.19 3.15 15.71 4.3a21.93 21.93 0 0 0 9.81-.83 23.39 23.39 0 0 0 6.21-3.26c2.58-1.76 6.17-4.63 11.25-10.87a108.14 108.14 0 0 0 9.07-13.13 147 147 0 0 0 7.75-15.32c.25-.55 4.9-11.07 8.44-22.21A278.24 278.24 0 0 0 990 585.07c1.79-31.85-3.48-54.74-8.75-77.61 0 0-3.78-16.44-15.51-36.19-2.38-4-6.08-9.62-12.95-13.34a29.69 29.69 0 0 0-8.79-3.09 127 127 0 0 1-28.88-6.14 131.22 131.22 0 0 1-53.11-34.46q-5.82-11-12.1-22.12c-18-32-36.37-61.56-54.54-88.62a366.59 366.59 0 0 0-242-105.67 510.57 510.57 0 0 1-64.76 44.31c-28.23 16.29-53 15.55-54.53 27.27-2 15.21 34.21 33.91 34.08 34.09s-2.79-1.93-6.11-4.36a106.22 106.22 0 0 1-8.77-6.29l-97.6 44.73c-15.65 22.78-39.92 64.95-47.72 122.71 0 0-9.79 72.51 18.73 146.42 7.19 18.65 17.09 37.61 17.09 37.61 4.1 7.87 7.85 14.36 10.69 19.12a226.53 226.53 0 0 0 44.3 24.23s25.59 10.47 53.36 14.55c9.75 1.44 20.2 2.13 20.2 2.13.7 0 6.66.51 12.95.55a296.3 296.3 0 0 0 40.83-2.61 235.64 235.64 0 0 0 24.57-5.29 182.39 182.39 0 0 0 20-6.12c9.34-3.54 15.67-7.08 25.77-12.42a114.2 114.2 0 0 0 14.64-8.92 92.75 92.75 0 0 0 10.55-8.9 52.56 52.56 0 0 0 7.92-9.2 37.15 37.15 0 0 0 4.38-8.7 38.45 38.45 0 0 0 1.87-12 49.7 49.7 0 0 0-1.46-11.1 83.66 83.66 0 0 0-2.53-9.39 61.52 61.52 0 0 0 5.78-15.55 54.07 54.07 0 0 0 1.4-14.41 57.47 57.47 0 0 0-2.29-13.56 59.92 59.92 0 0 0-4.78-11.73 81.16 81.16 0 0 0-10.22-58.65 81.06 81.06 0 0 0-7.09-9.93 48.15 48.15 0 0 0-.06-10.25 46.16 46.16 0 0 0-2.59-10.9 47 47 0 0 0-6.58-11.69 50.87 50.87 0 0 0-8.14-9 51.47 51.47 0 0 0-10.49-7c-2.66-1.33-5.72-2.56-8-3.47-1.16-.47-2.51-1-5.21-2-3.16-1.22-4.75-1.83-5.54-2.11a69.35 69.35 0 0 0-8.45-2.33 108.44 108.44 0 0 0-10.75-1.83c-4.59-.57-6.21-.55-10.88-.95 0 0-7.43-.65-14-1.72-5.77-.94-14.91-2.42-24.67-7.81a72.52 72.52 0 0 1-18.44-15.07c-2.39-2.59-4.54-5.25-6.95-8.23-1.16-1.44-5.91-7.36-9.8-13a167 167 0 0 1-14.61-26.14" style="fill:#fbc5b2"/><path d="M592.94 341.32v99.91a140.57 140.57 0 0 0-18.08-8.66 99.69 99.69 0 0 0-14.77-4.83 119.89 119.89 0 0 0-14.7-2.31c-7.63-.9-8.07-.55-15.16-1.41a104.35 104.35 0 0 1-15.23-2.63 66.51 66.51 0 0 1-13.18-4.74 69 69 0 0 1-12.47-8.14c-5.22-4.24-8.37-7.94-13.31-13.84-3.56-4.23-8.12-10-13.07-17.24v-36.11z" style="fill:url(#rod_2)"/><path d="M552.38 696.58a258.42 258.42 0 0 0 14.66-4.51c3.88 2.1 7.44 3.9 10.57 5.43 3.66 1.79 6.85 3.25 9.36 4.37 2.32 1 4.34 1.9 6 2.58v32.87h0c-.74 12.75-29.54 23-65 23s-64.23-10.25-65-23h0q0-16.87.07-33.74c5.66.6 12.65 1.14 20.69 1.3a257 257 0 0 0 26.24-.88 216.89 216.89 0 0 0 26.53-3.58c7.19-1.42 12.96-3.04 15.88-3.84z" style="fill:url(#rod_2-2)"/><ellipse cx="527.94" cy="340.81" rx="65" ry="23.5" style="fill:#ebb278"/><path d="M553.9 338.78c.89-7.32-12.43-20.9-26-20.89s-26.83 13.51-26 20.89c1.11 9.39 25.28 9 27.25 9 4.06-.14 23.74-.61 24.75-9z"/></g></g><g id="color"><path d="M438.35 269.28c.34 2.92 3.53 4.63 7.92 7 22.65 12.14 48.87 2.66 56 0l.85-.33c16-6.33 27.06-21 23.94-28.58-1-2.39-3.67-3.77-9.07-6.52a48.58 48.58 0 0 0-14.73-4.85c-7.94-1.07-14.2 1.68-33.45 11.79-27.56 14.43-31.9 17.81-31.46 21.49z" style="fill:#fff3f2"/><path d="M332.94 624.32a286 286 0 0 0 278.41 14.89 66.64 66.64 0 0 1-3.76 26.32 63.43 63.43 0 0 1-3.83 8.59 192.49 192.49 0 0 1-36.72 18 233.59 233.59 0 0 1-27.04 7.47c-2.71.59-5.08 1-7.07 1.42-6.66 1.24-14 2.29-22.08 3-49 4.25-86.3-7.25-95.44-10.23A232.59 232.59 0 0 1 354 663.1q-10.52-19.4-21.06-38.78z" style="fill:url(#linear-gradient)"/><path d="M468.19 303.5a179.09 179.09 0 0 0 51.13-6.82c40.63-11.65 51.79-31 75-27.27 29.46 4.72 47 41.59 44.31 44.31-2.31 2.38-20.23-21-47.72-20.45-5.08.1-12.48 2.34-27.27 6.82-8.77 2.66-15 4.78-19.73 6.51-18.47 6.75-20 6.76-21.17 7.12-9.74 3.05-26.03 3.35-54.55-10.22z" style="fill:url(#linear-gradient-2)"/><path d="M449.44 352.92A160.93 160.93 0 0 0 469.9 387c9.76 12.45 18.66 23.79 34.08 30.67 10.58 4.73 22.79 5.9 30.68 6.82 9.25 1.08 14.58.82 24.16 3a103.43 103.43 0 0 1 19.95 6.63c.6 1.05 1.27 2.28 2 3.66.46.89 1 2 1.58 3.22 1.2 2.54 2.15 4.86 2.92 6.87.9 2.36 1.56 4.38 2 5.9a98.123 98.123 0 0 1 2.12 8 289.26 289.26 0 0 1-51.33.25c-31.52-2.65-69.1-5.59-102.26-30.67-11-8.29-33.3-27.83-47.72-64.77z" style="fill:url(#linear-gradient-3)"/><path d="M567 692.07c4.81-1.66 8.8-3.3 11.81-4.63 4.64-2.05 8.07-3.84 11.8-5.79 5-2.64 8.64-4.73 9.55-5.26 3.3-1.93 6.14-3.7 8.45-5.19 44 16.77 78.74 18 102.29 16.12 37.87-3.08 57.83-15.18 110-21a411.82 411.82 0 0 1 68.45-1.92A137.16 137.16 0 0 0 898 684a89.09 89.09 0 0 0 9.55 14.63c4.26 5.23 7.05 7.3 8.35 8.2a34.14 34.14 0 0 0 10 4.73l-10.86-3.15a235 235 0 0 0-56.6-4.37c-22.65 1-42.44 5.42-64.76 10.22-30.81 6.64-37.47 9.71-47.88 11.93-2.05.44-5.7 1.11-10.07 1.71-15 2.07-27.19 1.52-38 1-4.26-.22-11-.66-19.28-1.66a281.112 281.112 0 0 1-42.9-8.6A290.91 290.91 0 0 1 567 692.07z" style="fill:url(#linear-gradient-4)"/><path d="M578.77 434.09a98.4 98.4 0 0 1 12.13 36.42 97.4 97.4 0 0 1 0 23.86 65.11 65.11 0 0 1 13.63 68.18A51.91 51.91 0 0 1 614.76 583c4.91 20.21-4.38 36.82-6.82 40.9a62.48 62.48 0 0 1 3.41 20.45 63.48 63.48 0 0 1-7.59 29.77 77.44 77.44 0 0 0 17-12.61c2.69-2.64 7.84-7.68 11-13.75 7.81-14.8 2.1-32 0-37.5a59 59 0 0 0 6.82-34.08 57.55 57.55 0 0 0-6.69-21.2 81.36 81.36 0 0 0-17.31-68.58 49.43 49.43 0 0 0-3.27-22.7c-8.4-20.96-28.91-28.37-32.54-29.61z" style="fill:url(#linear-gradient-5)"/><path d="M649.08 360.43c-2.31.29-8.42 45.85 13.64 88.62 29 56.16 77.1 73.54 78.39 71.58s-37.59-19.33-68.17-75c-24.04-43.76-21.63-85.48-23.86-85.2zM944 454.84c28.46 2.48 49.29 73.67 46 131.05-3.37 58-32.89 126.91-61.27 126-29.26-1-57.82-76.25-51.06-141.27 5.75-55.43 38.68-118.21 66.33-115.78z" style="fill:#c99e8f"/></g><g id="axes"><g class="cls-12"><g class="cls-13"><path d="M539.35 551.42h9v396h-9zm0-414h9v414h-9z" style="fill:#0067cf"/><path class="cls-15" d="M539.35 947.41h9l15.58 9h-9l-15.58-9z"/><path class="cls-15" d="M554.93 956.41h9l-31.17 99h-9l31.17-99z"/><path class="cls-16" d="M554.93 128.41h9l-15.58 9h-9l15.58-9z"/><path style="fill:#0071e2" d="M523.76 29.41h9l31.17 99h-9l-31.17-99z"/><path style="fill:#004c99" d="m523.76 29.41 31.17 99-15.58 9v810l15.58 9-31.17 99-31.18-99 15.59-9v-810l-15.59-9 31.18-99z"/></g></g><g class="cls-12"><g class="cls-13"><path style="fill:#00264d" d="m807.85 395.23 1.35 16.37-5.87-7.49-1.35-16.37 5.87 7.49z"/><path class="cls-20" d="m851.47 405.75 1.34 16.37-18.87-1.51-1.35-16.37 18.88 1.51z"/><path class="cls-21" d="m898.26 363.87 1.35 16.37-46.8 41.88-1.34-16.37 46.79-41.88z"/><path class="cls-22" d="m832.59 404.24 1.35 16.37L534.8 558.09l-1.35-16.37 299.14-137.48z"/><path class="cls-22" d="m533.45 541.72 1.35 16.37L248.67 689.6l-1.35-16.37 286.13-131.51z"/><path style="fill:#0062c4" d="m253.19 680.72 1.34 16.37-96.27 23.87-1.35-16.37 96.28-23.87z"/><path style="fill:#0054aa" d="m898.26 363.87-46.79 41.88-18.88-1.51-299.14 137.48-286.13 131.51 5.87 7.49-96.28 23.87 46.79-41.88 18.88 1.51 286.13-131.5 299.14-137.49-5.87-7.49 96.28-23.87z"/></g></g><g class="cls-12"><g class="cls-13"><path class="cls-20" d="m254.53 387.74-1.34 16.37-5.87 7.49 1.35-16.37 5.86-7.49z"/><path style="fill:#005dbb" d="m223.93 404.24-1.35 16.37-18.88 1.51 1.35-16.37 18.88-1.51z"/><path class="cls-16" d="m205.05 405.75-1.35 16.37-46.79-41.88 1.35-16.37 46.79 41.88z"/><path d="m523.06 541.72-1.34 16.37-299.14-137.48 1.35-16.37 299.13 137.48zM809.2 673.23l-1.35 16.37-286.13-131.51 1.34-16.37L809.2 673.23z" style="fill:#00356a"/><path style="fill:#00458a" d="m899.61 704.59-1.35 16.37-96.28-23.87 1.35-16.37 96.28 23.87z"/><path class="cls-21" d="m158.26 363.87 96.27 23.87-5.86 7.49L547.8 532.72l286.14 131.5 18.87-1.51 46.8 41.88-96.28-23.87 5.87-7.49-286.14-131.51-299.13-137.48-18.88 1.51-46.79-41.88z"/></g></g><path d="M571.91 542.42c8 3.74 76.44 36.67 84.39 40.42-4.3 10.31-8.71 21.07-13 31.38-10.51-4.48-83.44-37.41-93.94-41.89 0 13.13-1 81.07-1 94.2-4.95 1.84-11 2.85-20.81 2.67-6.9-.12-15.2-.27-19.41-1.56-.24-13.79-.76-81.51-1-95.31-11.47 5.35-79.84 34.91-91.31 40.27-5-10.27-10.05-20.19-15-30.46 9.6-4.39 74.18-35.34 83.78-39.72-8.94-4-81.53-38.81-90.47-42.83 5.75-9.77 12-19.45 17.72-29.22 10.05 4.48 85.26 37.65 95.31 42.13 0-10.88 1-91.76 1-102.64 4.5-1.23 10.27-.63 17.36-.7 9.56-.08 17.59.09 22.82 1.84 0 5.25 1 96.25 1 101.5 8.8-4.23 87.82-38.94 96.62-43.17 5.64 10.17 10.9 19.6 16.54 29.77-7.59 3.37-83.01 39.9-90.6 43.32z" style="opacity:.9;fill:url(#radial-gradient)"/></g><g id="letters"><path class="cls-29" d="M887.18 296.19H874v13.21h-3.72v-13.21H857v-3.66h13.21v-13.22H874v13.22h13.22zm46.9 14.56h-19.45v-2.08a17.45 17.45 0 0 0 3.88-.45c1-.27 1.48-.67 1.48-1.22a5.78 5.78 0 0 0-.68-1.82c-.45-.91-1-1.94-1.72-3.07s-1.71-2.73-2.79-4.42-2.13-3.31-3.19-4.85q-2.58 3.41-5.86 8.19t-3.28 5.65a1.5 1.5 0 0 0 .89 1.42 11.75 11.75 0 0 0 3.94.57v2.08h-15.52v-2.08c.5 0 1.15-.11 2-.22a6.35 6.35 0 0 0 1.94-.54 10.19 10.19 0 0 0 2.45-1.77 21.43 21.43 0 0 0 1.86-2.25c1.25-1.71 2.85-3.86 4.8-6.43s3.68-4.91 5.18-7q-1.69-2.49-4.34-6.31L900 276a22.37 22.37 0 0 0-2-2.61 6.2 6.2 0 0 0-1.91-1.32 7.52 7.52 0 0 0-2-.51c-.83-.13-1.49-.21-2-.25v-2.08h19.25v2.08a22.43 22.43 0 0 0-3.53.42c-1.22.25-1.83.62-1.83 1.13a5.29 5.29 0 0 0 .74 1.95c.48.93 1.06 1.92 1.72 3l2.29 3.64q1.26 2 3.08 4.6 3.3-4.49 5.71-8.09c1.6-2.4 2.4-4 2.4-4.69a1.48 1.48 0 0 0-1.1-1.38 12.82 12.82 0 0 0-3.71-.55v-2.08h15.59v2.08a16.45 16.45 0 0 0-1.91.22 7.9 7.9 0 0 0-2 .54 7.18 7.18 0 0 0-2.27 1.58c-.5.57-1.17 1.39-2 2.47q-2.34 3-4.32 5.67c-1.32 1.77-2.9 3.93-4.76 6.47q2.35 3.35 5.23 7.58l5.52 8.11a19.42 19.42 0 0 0 2.08 2.5 11.13 11.13 0 0 0 1.91 1.63 4.53 4.53 0 0 0 1.88.51c.8.07 1.46.11 2 .13zm-521.75 644h-13.22V968h-3.72v-13.25h-13.21v-3.66h13.21v-13.22h3.72v13.22h13.22zm39.78 1.58-1.38 13h-33.39v-1l26.16-38.23h-9.58c-1.11 0-2.05 0-2.8.06a17 17 0 0 0-2.06.23c-1.29.26-2.74 1.32-4.36 3.2a20.65 20.65 0 0 0-3.64 5.94H419l1.26-11.74h31.14v1L425.25 967h9.87a41.68 41.68 0 0 0 5.3-.35q2.82-.35 3.66-1.2a22.38 22.38 0 0 0 3.55-4.45 29.81 29.81 0 0 0 2.43-4.66z"/><path d="M83.17 141.82a9 9 0 0 1-2-6.27v-25.63h5.28v26a3.67 3.67 0 0 0 .7 2.49 3 3 0 0 0 4 0 3.61 3.61 0 0 0 .7-2.49v-26h5.05v25.63a8.9 8.9 0 0 1-2 6.27A7.58 7.58 0 0 1 89 144a7.6 7.6 0 0 1-5.83-2.18zm18.53 0a9.08 9.08 0 0 1-2-6.27v-1.92h5v2.31q0 3.26 2.74 3.26a2.58 2.58 0 0 0 2-.79 3.89 3.89 0 0 0 .69-2.57 7.11 7.11 0 0 0-1-3.72 17.63 17.63 0 0 0-3.55-3.86 21.57 21.57 0 0 1-4.56-5.21 10.68 10.68 0 0 1-1.29-5.26 8.8 8.8 0 0 1 2-6.17 7.61 7.61 0 0 1 5.86-2.18 7.29 7.29 0 0 1 5.73 2.18 9.13 9.13 0 0 1 1.95 6.27v1.39h-5v-1.73a3.85 3.85 0 0 0-.68-2.52 2.41 2.41 0 0 0-2-.79c-1.76 0-2.64 1.07-2.64 3.22a6.28 6.28 0 0 0 1 3.4 18.7 18.7 0 0 0 3.58 3.84 20 20 0 0 1 4.56 5.24 11.59 11.59 0 0 1 1.24 5.52 9 9 0 0 1-2 6.33 7.66 7.66 0 0 1-5.92 2.21 7.44 7.44 0 0 1-5.71-2.18zm16.8-31.9h14.4v4.8h-9.12v8.88H131v4.8h-7.25v10.32h9.12v4.8H118.5zm17.42 0h7.83c2.71 0 4.7.63 5.95 1.9s1.87 3.2 1.87 5.83v2.06q0 5.24-3.46 6.63v.09a4.16 4.16 0 0 1 2.72 2.35 12 12 0 0 1 .79 4.76v5.9c0 1 0 1.74.09 2.33a6.26 6.26 0 0 0 .48 1.75h-5.37a7.57 7.57 0 0 1-.39-1.54 24.56 24.56 0 0 1-.09-2.59v-6.14a5.19 5.19 0 0 0-.75-3.22 3.13 3.13 0 0 0-2.57-.91h-1.82v14.4h-5.28zm7.2 14.4a3.15 3.15 0 0 0 2.38-.82 3.87 3.87 0 0 0 .79-2.73v-2.59a4.26 4.26 0 0 0-.65-2.64 2.43 2.43 0 0 0-2-.82h-2.4v9.6zM157 115h-1.73v-5.09h5.09v4.56l-2.93 6.29H155zm8.34 26.82a9.08 9.08 0 0 1-2-6.27v-1.92h5v2.31c0 2.17.91 3.26 2.73 3.26a2.55 2.55 0 0 0 2-.79 3.83 3.83 0 0 0 .7-2.57 7.11 7.11 0 0 0-1-3.72 17.63 17.63 0 0 0-3.55-3.86 21.13 21.13 0 0 1-4.56-5.21 10.57 10.57 0 0 1-1.3-5.26 8.76 8.76 0 0 1 2-6.17 7.58 7.58 0 0 1 5.85-2.18 7.31 7.31 0 0 1 5.74 2.18 9.12 9.12 0 0 1 1.94 6.27v1.39h-5v-1.73a3.86 3.86 0 0 0-.67-2.52 2.43 2.43 0 0 0-2-.79c-1.76 0-2.64 1.07-2.64 3.22a6.29 6.29 0 0 0 1 3.4 18.32 18.32 0 0 0 3.57 3.84 19.67 19.67 0 0 1 4.56 5.24 11.59 11.59 0 0 1 1.25 5.52 9 9 0 0 1-2 6.33 7.69 7.69 0 0 1-5.93 2.21 7.45 7.45 0 0 1-5.69-2.18zm24.48-31.9h7.83q4.08 0 5.95 1.9t1.87 5.83v2.06q0 5.24-3.45 6.63v.09a4.17 4.17 0 0 1 2.71 2.35 11.85 11.85 0 0 1 .79 4.76v5.9a20.85 20.85 0 0 0 .1 2.33 5.65 5.65 0 0 0 .48 1.75h-5.38a7.51 7.51 0 0 1-.38-1.54 21.39 21.39 0 0 1-.1-2.59v-6.14a5.27 5.27 0 0 0-.74-3.22 3.16 3.16 0 0 0-2.57-.91h-1.83v14.4h-5.28zm7.2 14.4a3.15 3.15 0 0 0 2.38-.82 3.82 3.82 0 0 0 .79-2.73v-2.59a4.2 4.2 0 0 0-.65-2.64 2.43 2.43 0 0 0-2-.82h-2.4v9.6zm12.15-14.4h5.28v33.6h-5.28zm10.83 31.9a9 9 0 0 1-2-6.27v-17.66a9 9 0 0 1 2-6.27 9 9 0 0 1 11.72 0 9 9 0 0 1 2 6.27v2.88h-5v-3.22q0-3.31-2.74-3.31t-2.73 3.31v18.39c0 2.17.91 3.26 2.73 3.26s2.74-1.09 2.74-3.26v-6.58h-2.64v-4.8h7.63v11a9 9 0 0 1-2 6.27 9 9 0 0 1-11.72 0zm17.15-31.9h5.28v13.68h5.66v-13.68h5.28v33.6h-5.28V128.4h-5.66v15.12h-5.28zm24.29 4.8h-5.52v-4.8h16.32v4.8h-5.52v28.8h-5.28zm21.02-4.8h5.28v13.68h5.67v-13.68h5.27v33.6h-5.27V128.4h-5.67v15.12h-5.28zm24.24 0h7.15l5.48 33.6h-5.28l-1-6.67v.09h-6l-1 6.58h-4.9zm5.76 22.46-2.35-16.6H310l-2.3 16.6zm9.41-22.46h6.62l5.14 20.08h.09v-20.08h4.71v33.6H333L326.67 119h-.1v24.53h-4.7zm20.49 0h8.07q3.93 0 5.9 2.11t2 6.19v17q0 4.08-2 6.19t-5.9 2.11h-8.07zm8 28.8a2.54 2.54 0 0 0 2-.77 3.61 3.61 0 0 0 .7-2.49V118a3.61 3.61 0 0 0-.7-2.49 2.54 2.54 0 0 0-2-.77h-2.69v24zm-264.93 32.5h7.15l5.47 33.6h-5.28l-1-6.67v.09h-6l-1 6.58H80zm5.76 22.46-2.36-16.61h-.09l-2.31 16.61zm9.88-12.24h5.09v5.09h-5.09zm0 18.29h5.09v5.09h-5.09zm16.71-28.51h6.62l5.14 20.11h.09v-20.11h4.71v33.6h-5.43l-6.33-24.53h-.1v24.53h-4.7zm24.57 0h7.15l5.47 33.6h-5.27l-1-6.67v.09h-6l-1 6.58h-4.9zm5.76 22.46-2.35-16.61h-.1l-2.3 16.61zM159.44 176h-5.52v-4.8h16.32v4.8h-5.52v28.8h-5.28zm13.34-4.78h5.28v33.6h-5.28zm7.83 0h5.32l3.46 26.06h.1l3.45-26.06h4.85l-5.09 33.6h-7zm19.72 0h14.4V176h-9.12v8.88h7.25v4.8h-7.25V200h9.12v4.8h-14.4zm26.79 31.87a8.77 8.77 0 0 1-2.07-6.24v-17.66a8.77 8.77 0 0 1 2.07-6.24 9.11 9.11 0 0 1 11.9 0 8.77 8.77 0 0 1 2.06 6.24v17.66a8.77 8.77 0 0 1-2.06 6.24 9.11 9.11 0 0 1-11.9 0zm8.68-5.9v-18.34q0-3.32-2.73-3.31t-2.74 3.31v18.34c0 2.2.91 3.31 2.74 3.31s2.73-1.11 2.73-3.31zm8.84-25.97h7.82q4.08 0 6 1.89c1.25 1.27 1.87 3.21 1.87 5.84V181q0 5.24-3.45 6.63v.09a4.12 4.12 0 0 1 2.71 2.35 11.83 11.83 0 0 1 .79 4.75v5.91a21 21 0 0 0 .1 2.33 5.65 5.65 0 0 0 .48 1.75h-5.38a7.67 7.67 0 0 1-.38-1.54 21.39 21.39 0 0 1-.1-2.59v-6.14a5.27 5.27 0 0 0-.74-3.22 3.14 3.14 0 0 0-2.57-.91h-1.82v14.4h-5.28zm7.2 14.4a3.14 3.14 0 0 0 2.37-.82 3.82 3.82 0 0 0 .79-2.73v-2.6a4.31 4.31 0 0 0-.64-2.64 2.48 2.48 0 0 0-2-.81h-2.4v9.6zm12.16-14.4h5.28v33.6H264zm10.83 31.89a8.86 8.86 0 0 1-2-6.26v-17.66a8.9 8.9 0 0 1 2-6.27 9 9 0 0 1 11.71 0 9 9 0 0 1 2 6.27v2.88h-5v-3.22q0-3.32-2.73-3.31t-2.74 3.31v18.38q0 3.27 2.74 3.27t2.73-3.27v-6.57h-2.64v-4.8h7.64v11a8.91 8.91 0 0 1-2 6.26 8.92 8.92 0 0 1-11.71 0zM292 171.22h5.28v33.6H292zm9.18 0h6.62l5.14 20.11h.1v-20.11h4.7v33.6h-5.43L306 180.29h-.1v24.53h-4.7z" style="fill:#4d4d4d"/><circle cx="43.95" cy="126" r="18" style="stroke:#666;stroke-miterlimit:10;fill:#fbc5b2"/><circle cx="43.95" cy="187.3" r="18" style="fill:#ff0;stroke:#666;stroke-miterlimit:10"/><path class="cls-29" d="M836.35 792.38h-13.21v13.21h-3.72v-13.21H806.2v-3.67h13.22V775.5h3.72v13.21h13.21zm42.71-24.94a7.26 7.26 0 0 0-1.58.4 5.82 5.82 0 0 0-1.55.72 11.44 11.44 0 0 0-1.55 1.08 18.62 18.62 0 0 0-1.59 2c-1.52 2.15-2.93 4.33-4.21 6.54s-2.91 5-4.84 8.41a15.63 15.63 0 0 0-1.43 3 11.65 11.65 0 0 0-.36 3.31v7.94a3.75 3.75 0 0 0 .43 1.83 3 3 0 0 0 1.45 1.25 15.69 15.69 0 0 0 2.2.57 14.52 14.52 0 0 0 2.55.37v2.08h-19.46v-2.08l2.46-.22a9 9 0 0 0 2.29-.43 2.73 2.73 0 0 0 1.45-1.2 4.07 4.07 0 0 0 .39-1.87V791a5.31 5.31 0 0 0-.57-1.72c-.38-.83-.83-1.75-1.36-2.76q-1.75-3.4-3.9-7.36c-1.42-2.63-2.66-4.89-3.72-6.76a15.33 15.33 0 0 0-1.71-2.52 8.77 8.77 0 0 0-1.71-1.5 5.53 5.53 0 0 0-1.69-.67 10.92 10.92 0 0 0-1.77-.3v-2.08H857v2.08a19.07 19.07 0 0 0-4.22.41c-.82.24-1.23.57-1.23 1a2 2 0 0 0 .18.61c.11.29.28.66.49 1.11s.56 1.09.91 1.74l1 1.89c.92 1.74 1.85 3.47 2.81 5.2s2.2 4 3.74 6.75q4.59-7.41 7-11.55c1.61-2.76 2.42-4.42 2.42-5a1.33 1.33 0 0 0-.5-1.08 3.54 3.54 0 0 0-1.32-.65 9.43 9.43 0 0 0-1.84-.3c-.67-.05-1.28-.11-1.85-.17v-2.08h14.45z"/><g style="opacity:.88"><path d="M556.22 560.14h-23v-2.78a23.88 23.88 0 0 0 5.05-.78c1.35-.39 2-.87 2-1.44a6 6 0 0 0-.08-.86 3.69 3.69 0 0 0-.24-.9L535.34 541h-19.45c-.73 1.82-1.33 3.41-1.78 4.76s-.87 2.61-1.24 3.75a25.79 25.79 0 0 0-.7 2.74 9.86 9.86 0 0 0-.2 1.72c0 1 .82 1.84 2.47 2.42a19.72 19.72 0 0 0 5.54 1v2.78h-20.87v-2.78a16 16 0 0 0 2.54-.45 8.3 8.3 0 0 0 2.5-1 9.93 9.93 0 0 0 2.42-2.21 14.83 14.83 0 0 0 1.68-3.18q4.17-10.44 9.22-23.44t9-23.16h3.13l18.47 47.81a9.7 9.7 0 0 0 1.33 2.46 9.54 9.54 0 0 0 2.07 1.83 8.64 8.64 0 0 0 2.34.92 11.56 11.56 0 0 0 2.43.41zm-22.3-22.66-8.4-21.48-8.28 21.51z" style="fill:#ff0"/></g></g></svg> | 0 |
data/mdn-content/files/en-us/web/api/xrinputsource | data/mdn-content/files/en-us/web/api/xrinputsource/profiles/index.md | ---
title: "XRInputSource: profiles property"
short-title: profiles
slug: Web/API/XRInputSource/profiles
page-type: web-api-instance-property
browser-compat: api.XRInputSource.profiles
---
{{APIRef("WebXR Device API")}}{{SecureContext_Header}}
The read-only {{domxref("XRInputSource")}} property **`profiles`** returns an array of strings, each describing a configuration profile for the input source. The profile strings are listed in order of specificity, with the most specific profile listed first.
> **Note:** The `profiles` list is always empty when the WebXR
> session is in inline mode.
## Value
An array of strings, each describing one configuration profile
for the input device represented by the `XRInputSource` object. Each input
profile specifies the preferred visual representation and behavior of the input source.
### Input profile names
An input profile name is a string describing a visual representation and behavior the
input source may be configured to use. Each string:
- Has no spaces; instead, words are separated by hyphen ("-") characters
- If the platform makes it available, the USB vendor and product ID may be provided
but cannot be relied upon
- Does not uniquely identify a specific device; rather, it identifies a configuration
that the product is capable of using
- Does not provide information about handedness of the device, if applicable
The [WebXR Input Profiles Registry](https://github.com/immersive-web/webxr-input-profiles/tree/main/packages/registry) is used by device developers and browser developers to
attempt to ensure that a given device will report the same profile strings regardless of
which browser or other {{Glossary("user agent")}} you use.
### Generic input profile names
The following input profile names are generic and can serve as fallbacks that describe the devices in the roughest sense.
- generic-button
- generic-hand-select-grasp
- generic-hand-select
- generic-hand
- generic-touchpad
- generic-touchscreen
- generic-trigger-squeeze-thumbstick
- generic-trigger-squeeze-touchpad-thumbstick
- generic-trigger-squeeze-touchpad
- generic-trigger-squeeze
- generic-trigger-thumbstick
- generic-trigger-touchpad-thumbstick
- generic-trigger-touchpad
- generic-trigger
## Examples
The list in `profiles` is in order of reverse specificity; that is, the most precise description is first, and the least precise description is last. The first entry in the list is typically indicative of the precise model of the controller, or of a model with which the controller is compatible.
For example, entry 0 in `profiles` for an Oculus Touch controller is `oculus-touch`. The next entry is `generic-trigger-squeeze-thumbstick`, indicating a generic device with a trigger, a squeeze control, and a thumbstick. While the Oculus Touch controller actually has a thumbpad rather than a thumbstick, the overall description is "close enough" that the details within the profile matching the name will let the controller be interpreted usefully.
```js
inputSource.profiles;
// ['oculus-touch', 'generic-trigger-squeeze-thumbstick']
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- [WebXR Device API](/en-US/docs/Web/API/WebXR_Device_API)
- [Inputs and input sources](/en-US/docs/Web/API/WebXR_Device_API/Inputs)
| 0 |
data/mdn-content/files/en-us/web/api/xrinputsource | data/mdn-content/files/en-us/web/api/xrinputsource/gamepad/index.md | ---
title: "XRInputSource: gamepad property"
short-title: gamepad
slug: Web/API/XRInputSource/gamepad
page-type: web-api-instance-property
browser-compat: api.XRInputSource.gamepad
---
{{APIRef("WebXR Device API")}}{{SecureContext_Header}}
The read-only {{domxref("XRInputSource")}} property **`gamepad`** returns a {{domxref("Gamepad")}} object describing the state of the buttons and axes on the XR input source, if it is a gamepad or comparable device. If the device isn't a gamepad-like device, this property's value is `null`.
The {{domxref("Gamepad")}} instance returned behaves as described by the [Gamepad API](/en-US/docs/Web/API/Gamepad_API). However, there are a few things to note:
- `Gamepad` instances belonging to `XRInputSource` are not included in the array returned by {{domxref("navigator.getGamepads()")}}. Gamepads are strictly associated with the WebXR hardware and are not general-purpose gaming devices.
- {{domxref("Gamepad.id")}} is an empty string (`""`)
- {{domxref("Gamepad.index")}} is `-1`
- {{domxref("Gamepad.connected")}} is `true` until the `XRInputSource` is removed from the list of active XR input sources or the {{domxref("XRSession")}} is ended.
- If an axis reported by {{domxref("Gamepad.axes")}} represents an axis of a touchpad, the value is 0 when the associated {{domxref("GamepadButton.touched")}} property is `false`.
- {{domxref("Gamepad.mapping")}} returns "xr-standard".
## Examples
### Using a gamepad input source
```js
for (const source of frame.session.inputSources) {
const gamepad = source.gamepad;
if (gamepad) {
if (gamepad.buttons[2].pressed) {
// do something
}
}
}
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api/xrinputsource | data/mdn-content/files/en-us/web/api/xrinputsource/targetraymode/index.md | ---
title: "XRInputSource: targetRayMode property"
short-title: targetRayMode
slug: Web/API/XRInputSource/targetRayMode
page-type: web-api-instance-property
browser-compat: api.XRInputSource.targetRayMode
---
{{APIRef("WebXR Device API")}}{{SecureContext_Header}}
The read-only {{domxref("XRInputSource")}}
property **`targetRayMode`** indicates the method by which the
target ray for the input source should be generated and how it should be presented to
the user.
Typically a target ray is drawn from the source of the targeting system along the target ray in the direction in which the user is looking or pointing. The style of the ray is generally up to you, as is the method for indicating the endpoint of the ray. The targeted point or object might be indicated by drawing a shape or highlighting the targeted surface or object.
A target ray emitted by a hand controller:

The target ray can be anything from a simple line (ideally fading over distance) to an animated effect, such as the science-fiction "phaser" style shown in the screenshot above.
## Value
A string indicating which method to use when generating and presenting the target ray to
the user. The possible values are:
- `gaze`
- : The user is using a gaze-tracking system (or **gaze input**) which detects the direction in which the user is looking. The target ray will be drawn originating at the viewer's eyes and will follow the direction in which they're looking.
- `screen`
- : The direction of the target ray is indicated using a tap on a touch screen, mouse, or other tactile input device.
- `tracked-pointer`
- : Targeting is being performed using a handheld device or hand-tracking system which the user points in the direction of the target. The target ray extends from the hand (or the object in the hand) in the targeted direction. The direction is determined using platform-specific rules, though if no such rules exist, the direction is chosen by assuming the user is pointing their index finger straight out from their hand.
## Usage notes
The input source's {{domxref("XRInputSource.targetRaySpace", "targetRaySpace")}}
indicates the position and orientation of the target ray, and can be used to determine
where to render the ray.
## Examples
This fragment of code shows part of a function to be called once every frame. It looks for inputs which have a non-`null` {{domxref("XRInputSource.targetRaySpace", "targetRaySpace")}}. Inputs which have a value for this property represent inputs that project a target ray outward from the user.
For each such input, this example looks for inputs whose {{domxref("XRInputSource.targetRayMode", "targetRayMode")}} is `tracked-pointer`, indicating that the input is in fact intended to represent a targeting device rather than a gazing device, screen tap, or mouse click. For tracked pointers, a function `myRenderTargetRayAsBeam()` is called to render a beam from the input controller's virtual position outward in the direction it's pointing.
The code should continue to perform tasks such as drawing controllers or any objects representative of the user's hands' positions in the virtual space, as well as any other input-related tasks.
```js
function updateInputSources(session, frame, refSpace) {
for (const source of session.getInputSources()) {
const targetRayPose = frame.getPose(inputSource.targetRaySpace, refSpace);
if (targetRayPose) {
if (source.targetRayMode === "tracked-pointer") {
myRenderTargetRayAsBeam(targetRayPose);
}
}
// …
}
}
```
See the article [Inputs and input sources](/en-US/docs/Web/API/WebXR_Device_API/Inputs) for more details and a more complete example.
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- [WebXR Device API](/en-US/docs/Web/API/WebXR_Device_API)
- [Inputs and input sources](/en-US/docs/Web/API/WebXR_Device_API/Inputs)
- [Using gamepads in WebXR applications](/en-US/docs/Web/WebXR%20Device%20API/Gamepads)
| 0 |
data/mdn-content/files/en-us/web/api/xrinputsource | data/mdn-content/files/en-us/web/api/xrinputsource/targetrayspace/index.md | ---
title: "XRInputSource: targetRaySpace property"
short-title: targetRaySpace
slug: Web/API/XRInputSource/targetRaySpace
page-type: web-api-instance-property
browser-compat: api.XRInputSource.targetRaySpace
---
{{APIRef("WebXR Device API")}}{{SecureContext_Header}}
The read-only {{domxref("XRInputSource")}} property
**`targetRaySpace`** returns an {{domxref("XRSpace")}}
(typically an {{domxref("XRReferenceSpace")}}) representing the position and
orientation of the target ray in the virtual space. Its native origin tracks
the position of the origin point of the target ray, and its orientation indicates the
orientation of the controller device itself. These values, interpreted in the context of
the input source's {{domxref("XRInputSource.targetRayMode", "targetRayMode")}}, can be
used both to fully interpret the device as an input source.
To obtain an `XRSpace` representing the input controller's position and
orientation in virtual space, use the {{domxref("XRInputSource.gripSpace",
"gripSpace")}} property.
## Value
An {{domxref("XRSpace")}} object—typically an {{domxref("XRReferenceSpace")}} or
{{domxref("XRBoundedReferenceSpace")}}—which represents the position and orientation of
the input controller's target ray in virtual space.
The native origin of the returned `XRSpace` is located at the point from
which the target ray is emitted, and the orientation of the space indicates the
direction in which the target ray is pointing.
## Usage notes
All input sources—regardless of their {{domxref("XRInputSource.targetRayMode",
"targetRayMode")}}—have a valid `targetRaySpace`. The exact meaning of this
space varies, however, depending on the mode:
- Every gaze input (`targetRayMode` value of `gaze`), shares the
same {{domxref("XRSpace")}} object as their target ray space, since the gaze input
comes from the viewer's head. This shared space represents the same location as the
space returned by the {{domxref("XRSession")}} method
{{domxref("XRSession.requestReferenceSpace", "requestReferenceSpace()")}}, but is
maintained as a different object to allow for future enhancements to the API.
- The target ray space reported by tracked pointer inputs (`targetRayMode`
of `tracked-pointer`) is actually based upon the true spatial position and
orientation of the input device.
To determine the position and orientation of the target ray while rendering a frame,
pass it into the {{domxref("XRFrame")}} method {{domxref("XRFrame.getPose",
"getPose()")}} method, then use the returned {{domxref("XRPose")}} object's
{{domxref("XRPose.transform", "transform")}} to gather the spatial information you need.
## Examples
This fragment of code shows part of a function to be called once every frame. It looks for inputs which have a non-`null` {{domxref("XRInputSource.targetRaySpace", "targetRaySpace")}}. Inputs which have a value for this property represent inputs that project a target ray outward from the user.
For each such input, this example looks for inputs whose {{domxref("XRInputSource.targetRayMode", "targetRayMode")}} is `tracked-pointer`, indicating that the input is in fact intended to represent a targeting device rather than a gazing device, screen tap, or mouse click. For tracked pointers, a function `myRenderTargetRayAsBeam()` is called to render a beam from the input controller's virtual position outward in the direction it's pointing.
The code should continue to perform tasks such as drawing controllers or any objects representative of the user's hands' positions in the virtual space, as well as any other input-related tasks.
```js
function updateInputSources(session, frame, refSpace) {
for (const source of session.getInputSources()) {
const targetRayPose = frame.getPose(inputSource.targetRaySpace, refSpace);
if (targetRayPose) {
if (source.targetRayMode === "tracked-pointer") {
myRenderTargetRayAsBeam(targetRayPose);
}
}
// …
}
}
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- [WebXR Device API](/en-US/docs/Web/API/WebXR_Device_API)
- [Inputs and input sources](/en-US/docs/Web/API/WebXR_Device_API/Inputs)
- [Using gamepads in WebXR applications](/en-US/docs/Web/WebXR%20Device%20API/Gamepads)
| 0 |
data/mdn-content/files/en-us/web/api/xrinputsource | data/mdn-content/files/en-us/web/api/xrinputsource/hand/index.md | ---
title: "XRInputSource: hand property"
short-title: hand
slug: Web/API/XRInputSource/hand
page-type: web-api-instance-property
browser-compat: api.XRInputSource.hand
---
{{APIRef("WebXR Device API")}}{{SecureContext_Header}}
The read-only **`hand`** property of the {{domxref("XRInputSource")}} interface is a {{domxref("XRHand")}} object providing access to a hand-tracking device.
## Value
An {{domxref("XRHand")}} object or [`null`](/en-US/docs/Web/JavaScript/Reference/Operators/null) if the {{domxref("XRSession")}} has not been [requested](/en-US/docs/Web/API/XRSystem/requestSession) with the `hand-tracking` feature descriptor.
## Examples
```js
navigator.xr
.requestSession({ optionalFeatures: ["hand-tracking"] })
.then(/* … */);
function renderFrame(session, frame) {
// …
for (const inputSource of session.inputSources) {
if (inputSource.hand) {
// render a hand model, perform gesture detection, etc.
}
}
}
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{domxref("XRHand")}}
| 0 |
data/mdn-content/files/en-us/web/api/xrinputsource | data/mdn-content/files/en-us/web/api/xrinputsource/gripspace/index.md | ---
title: "XRInputSource: gripSpace property"
short-title: gripSpace
slug: Web/API/XRInputSource/gripSpace
page-type: web-api-instance-property
browser-compat: api.XRInputSource.gripSpace
---
{{APIRef("WebXR Device API")}}{{SecureContext_Header}}
The read-only {{domxref("XRInputSource")}} property **`gripSpace`** returns an {{domxref("XRSpace")}} whose native origin tracks the pose used to render virtual objects so they appear to be held in (or part of) the user's hand. For example, if a user were holding a virtual straight rod, the native origin of this `XRSpace` would be located at the approximate center of mass of the user's fist.
## Value
An {{domxref("XRSpace")}} object representing the position and orientation of the input
device in virtual space, suitable for rendering an image of the device into the scene.
`gripSpace` is `null` if the input source is inherently
untrackable. For example, only inputs whose {{domxref("XRInputSource.targetRayMode",
"targetRayMode")}} is `tracked-pointer` provide a `gripSpace`.
Imagine that the controller is shaped like a straight rod, held in the user's fist. The
native origin of the grip space is located at the centroid—the center of mass—of the
user's fist, tracking the position of the user's hand.
**The coordinate system for the left hand's grip space.**

**The coordinate system for the right hand's grip space.**

As shown in the diagram above, the coordinate system is oriented as follows:
- The x-axis is perpendicular to the palm of the user's hand, with the direction
extending outward from the back of the hand being +X if the controller is in the
user's right hand or -X if the controller is in the left hand.
- The z-axis along the length of the rod, parallel to the user's palm and along the
length of their grip. -Z is in the direction of the user's thumb, and +Z is in the
opposite direction.
- The y-axis is implied by the relationship between the other two axes; as is always
the case, it's the cross product of the other two axes (lying 90° away from both the X
and Z axes).
## Examples
In tis example, taken from the frame rendering callback, the `gripSpace` is
used to render a mesh that represents the position and orientation of the controller in
the virtual environment.
```js
for (const source in xrSession.inputSources) {
if (source.gripSpace) {
const gripPose = frame.getPose(source.gripSpace, xrRefSpace);
if (gripPose) {
myDrawMeshUsingTransform(controllerMesh, gripPose.transform.matrix);
}
}
}
```
For each input source which has a value for `gripSpace`, this loop obtains
the {{domxref("XRPose")}} representing the position and orientation that are described
by `gripSpace`. If a valid pose is returned, a method
`myDrawMeshUsingTransform()` is called to draw the controller's mesh
transformed using the grip pose's transform matrix.
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api/xrinputsource | data/mdn-content/files/en-us/web/api/xrinputsource/gripspace/gripspace-lefthand-light.svg | <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 648 630.04" xml:space="preserve"><switch><g><path fill="#D18969" d="M285.05 349.53c4.66-11.68 9.32-23.35 13.98-35.03 3.12-10.63 6.25-21.26 9.37-31.9l-24.5-2.34 11.31-23.67c-18.01 20.29-36.01 40.58-54.02 60.86-.13.15-1.02 1-2.03 2.29-1.05 1.35-2.18 2.79-2.84 4.83-.33 1.02-.78 2.9-.43 5.39 14.82 45.94 29.63 91.87 44.45 137.81.2.99.65 2.68 1.77 4.43 9.91 15.54 56.51 10.82 65.7-8.12 1.29-2.66.3-2.41 2.97-11.41 3.43-11.52 8.79-24.49 10.99-23.96 1.05.25.74 3.43 1.35 3.47 1.43.1 4.59-13.52 4.61-27.43.02-13.83.04-25.62-7-32.74-9.37-9.49-29.31-8.72-48.73 1.66-8.97-8.04-17.96-16.09-26.95-24.14z"/><linearGradient id="a" gradientUnits="userSpaceOnUse" x1="352.686" y1="311.125" x2="246.954" y2="342.306" gradientTransform="rotate(-2.206 -342.867 -363.963)"><stop offset=".196" style="stop-color:#380018"/><stop offset=".483" style="stop-color:#c92c5e"/><stop offset=".698" style="stop-color:#380018"/></linearGradient><path fill="url(#a)" d="M320.99 190.01c-3.87-11.74-15.67-19.83-29.47-19.07-16.71.92-30.02 14.48-29.72 30.28.05 2.76.51 5.4 1.33 7.88l76.03 230.86c-.82-2.48-1.28-5.12-1.33-7.88-.3-15.8 13.01-29.36 29.72-30.28 13.8-.76 25.61 7.33 29.47 19.07l-76.03-230.86z"/><ellipse transform="rotate(-18.232 368.08 430.452)" fill="#380018" cx="368.09" cy="430.42" rx="30.46" ry="28.46"/><path fill="#FFD2D5" d="M334.71 262.89c.07 2.98-1.95 5.46-5.01 6.68-.29.1-.58.2-.86.3-1.36.41-2.89.59-4.5.49-5.82-.38-10.63-4.36-10.72-8.87-.1-4.51 4.55-7.85 10.37-7.46 5.82.38 10.63 4.35 10.72 8.86z"/><radialGradient id="b" cx="298.492" cy="287.616" r="19.092" fx="298.088" fy="287.522" gradientTransform="matrix(.8265 .5629 -.506 .743 221.929 -119.27)" gradientUnits="userSpaceOnUse"><stop offset=".352" style="stop-color:#fd1729"/><stop offset=".455" style="stop-color:#fddcde"/><stop offset=".665" style="stop-color:#fd1729"/><stop offset=".827" style="stop-color:#9c0e19"/><stop offset="1" style="stop-color:#380018"/></radialGradient><path fill="url(#b)" d="M338.34 268.17c-.01 0 .24-1.21.2-2.35-.02-.54-.06-.99-.12-1.38 0-.02-.01-.05-.01-.07l-.01-.04a8.18 8.18 0 0 0-.27-1.27c-.04-.14-.09-.27-.13-.41-.03-.1-.06-.2-.1-.31-.01-.04-.03-.09-.04-.13l-.02-.04c-.95-2.75-2.89-5.12-5.57-6.84-.64-.42-1.32-.8-2.03-1.14a.914.914 0 0 1-.14-.07s-.01 0-.01-.01h-.02c-.05-.02-.11-.05-.17-.07-.26-.12-.52-.23-.79-.33-.01 0-.01-.01-.02-.01s-.02-.01-.03-.01l-.1-.03c.03.01.07.02.1.04-.31-.12-.62-.23-.94-.33l-.04-.01c-.06-.02-.11-.04-.18-.05-.06-.02-.12-.04-.17-.05-.01 0-.02-.01-.03-.01.01 0 .02.01.03.01-.22-.07-.46-.13-.69-.19-.84-.21-1.37-.31-2.01-.39-.06-.01-.12-.02-.17-.03-.34-.03-.79-.08-1.13-.11h-.01c-1.31-.09-2.27-.01-2.28 0h-.02c-.33.02-.74.07-1.05.1l-.19.03c-.27.03-.5.07-.74.12l-.11.02c-.29.06-.66.15-.97.22.02-.01.04-.01.06-.02l-.19.05c-.49.12-1.1.32-1.71.56-1.99.76-3.68 1.9-4.99 3.39-.04.04-.07.08-.11.13l-.15.18c-.05.07-.11.14-.17.21-.03.03-.06.06-.08.09l-.14.18c-.12.15-.24.33-.38.51-.01.01-.6.85-1.06 1.96-.21.51-.33.85-.44 1.26l-.03.11c-.06.25-.14.58-.19.83l-.15.78-.06.34c-.02.1-.03.21-.04.31-.1.78-.18 1.93.02 3.15.24 1.37.53 2.43 1.42 4.09.23.44.52.87.84 1.31 1.69 2.37 4.12 4.11 6.83 5.18 1.18.49 2.14.72 3.34.99.01 0 .97.2 2.25.29.67.04 1.56.03 2.23.01.21-.01 2.13-.1 4.24-.81.65-.22 2.01-.69 3.76-1.91 1.75-1.23 2.81-2.77 3-3.06.33-.5.71-1.11 1.06-1.96.25-.59.36-.95.49-1.46.07-.24.13-.49.18-.74l.15-.81z"/><path fill="#E01425" d="M323.99 254.02c5.82.38 10.63 4.36 10.72 8.86.1 4.51-4.55 7.86-10.37 7.47-5.82-.38-10.63-4.36-10.72-8.87-.1-4.5 4.55-7.84 10.37-7.46z"/><path fill="#D18969" d="M351.39 282.41c5.48 4.45 12.45 5.65 18.12 3.13.97-.43 7.01-3.24 7.88-8.57 1.28-7.89-9.81-14.81-13.7-17.24-7.69-4.8-15.67-6.22-21.86-6.45 3.18 9.71 6.37 19.42 9.56 29.13zm1.88 5.71c10.94 3.95 18.77 6.37 24.31 7.93 1.62.46 4.9 1.37 8.72 3.62 3.13 1.85 8.11 4.8 9.76 9.39.92 2.55.49 5.47-5.87 18.04-6.83 13.51-10.24 20.27-15.48 20.42-6.15.18-10.72-8.42-11.32-9.55-4.95-9.33-1.17-18.99-.48-20.65-3.22-9.73-6.43-19.47-9.64-29.2z"/><path fill="#D18969" d="M373.16 360.36c.73 1.63 3.2 7.11 7.42 8.09 5.41 1.26 13.2-4.93 17.16-16.27.97-2.15 2.16-5.61 2.06-9.93-.24-9.81-6.98-16.11-8.45-17.43-6.79 5.66-13.58 11.32-20.36 16.98.48 1.46.96 2.91 1.44 4.37-.57 1.85-2.12 7.83.73 14.19z"/><path fill="#D18969" d="M377.46 377.9c-.23 1.3-.78 4.78.69 8.78.66 1.79 2.32 6.32 6.1 7.64 1.65.58 3.98.64 11.17-3.46 8.64-4.92 13.02-7.26 14.48-11.18 2.3-6.22-.56-13.31-4.25-17.23-2.24-2.37-4.84-3.63-6.35-4.36a26.475 26.475 0 0 0-9.88-2.58c1.37 3.93.36 8.16-2.5 10.61-2.93 2.51-6.57 2.12-7.23 2.03.27.81.54 1.62.8 2.44-.93 1.33-2.43 3.83-3.03 7.31zm-20.28 99.47c-1.58-4.05-3.81-4.2-7.92-11.52-3.48-6.18-4.05-10.8-6.8-18.69-3.34-9.59-5.97-17.85-7.93-24.21 1.66-6.15 3.86-15.67 5.01-27.46 1.79-18.32 4.86-49.83-13.41-77.12-3.62-5.41-9.96-13.46-20.6-21.24.17-6.76.35-13.52.52-20.28 3.86-3.11 16.09-13.76 15.66-28.1-.13-4.52-1.59-11.57-4.96-12.37-2.98-.71-5.46 3.76-15.12 9.35-2.07 1.2-3.85 2.08-5.06 2.66-5.26 2.49-17.69 7.28-19.06 8.01-.33.18-1.14.72-1.33.88-.19.16-.41.35-.41.35-1.24 1.16-1.93 2.59-2.33 3.91-.5 1.64-.59 2.95-.6 3.23-.1 2.38-2.8 15.24-10.26 46.96.38 6.61.76 13.23 1.13 19.84 4.34 59.89 13.89 86.93 22.63 100.22 2.26 3.44 10.7 15.47 7.12 27.05-2.02 6.53-7.22 10.79-11.4 13.41 20.15 31.46 46.82 44.78 61.05 37.6 9.77-4.94 18.22-21.82 14.07-32.48z"/><path opacity=".4" fill="#9D674F" d="M356.44 475.81c-.32-.62-.78-1.39-3.62-4.59-6.99-7.89-13.24-13.39-15.29-15.2-9.3-8.15-13.95-12.23-15.85-12.52-6.92-1.05-12.9 3.83-22.63 11.77a118.526 118.526 0 0 0-16.92 16.94c.88 1.42 2.12 3.35 3.69 5.57 6.2 8.79 12.2 14.59 14.39 16.66 5.19 4.87 11.53 10.66 20.66 14.18.26.1.48.18.66.25 5.8 2.07 12.45 4.45 19.78 1.76 8.49-3.12 12.22-10.98 13.55-13.78 1-2.15 6.06-12.46 1.58-21.04z"/><linearGradient id="c" gradientUnits="userSpaceOnUse" x1="-215.614" y1="398.207" x2="-217.049" y2="405.791" gradientTransform="scale(-1 1) rotate(34.286 -3.579 176.403)"><stop offset="0" style="stop-color:#e3b8a5"/><stop offset=".874" style="stop-color:#ccc"/><stop offset="1" style="stop-color:#e3b8a5"/></linearGradient><path fill="url(#c)" d="M295.57 248.38c1.32-.44 2.95-.88 4.85-1.14 2.06-.29 3.88-.3 5.36-.21 1.97-1.03 4.79-2.77 7.64-5.58 1.57-1.55 3.73-3.68 3.21-4.6-.62-1.11-4.87-.11-7.94 1.32-1.68.78-2.88 1.64-4.9 3.23-2.13 1.66-4.96 3.99-8.22 6.98z"/><linearGradient id="d" gradientUnits="userSpaceOnUse" x1="-206.749" y1="572.76" x2="-206.749" y2="556.462" gradientTransform="scale(-1 1) rotate(34.286 -3.579 176.403)"><stop offset="0" style="stop-color:#e3b8a5"/><stop offset=".66" style="stop-color:#e6e6e6"/><stop offset="1" style="stop-color:#e3b8a5"/></linearGradient><path fill="url(#d)" d="M385.45 376.36c-4.21 2.24-4.84 3.1-5.15 3.75-1.15 2.48.03 5.25.93 7.34 1.02 2.38 2.11 4.93 4.46 5.69 3.52 1.13 7.29-2.61 8.74-4.04 1.34-1.33 5.39-5.34 4.55-10.45-.1-.61-.7-4.24-3.35-5.47-2.24-1.04-4.89.36-10.18 3.18z"/><linearGradient id="e" gradientUnits="userSpaceOnUse" x1="-224.632" y1="547.437" x2="-218.093" y2="529.469" gradientTransform="scale(-1 1) rotate(34.286 -3.579 176.403)"><stop offset="0" style="stop-color:#e3b8a5"/><stop offset=".715" style="stop-color:#e6e6e6"/><stop offset="1" style="stop-color:#e3b8a5"/></linearGradient><path fill="url(#e)" d="M380.88 345.95c-1.48 3.43.43 6.98 3.86 13.38 2.07 3.85 3.13 5.77 4.42 5.77 2.71 0 6.03-6.86 5.08-13.05-.71-4.59-4.01-10.44-8.05-10.29-2.34.08-4.43 2.16-5.31 4.19z"/><linearGradient id="f" gradientUnits="userSpaceOnUse" x1="-229.55" y1="522.665" x2="-223.095" y2="511.484" gradientTransform="scale(-1 1) rotate(34.286 -3.579 176.403)"><stop offset="0" style="stop-color:#e3b8a5"/><stop offset=".659" style="stop-color:#e6e6e6"/><stop offset="1" style="stop-color:#e3b8a5"/></linearGradient><path fill="url(#f)" d="M373.24 331.56c.54-2.7 1.82-4.61 2.59-5.76 1.4-2.1 3.65-5.46 6.23-5.24 2.61.22 4.42 3.78 4.97 6.23.87 3.89-.97 7.18-2.83 10.49-1.92 3.43-4.25 7.59-6.69 7.3-3.02-.35-5.39-7.43-4.27-13.02z"/><path opacity=".19" fill="#9D674F" d="M311.64 416.75c.93 5.47-.23 10.17-1.28 13.14.05-2.81-.04-7-.85-12.01-1.19-7.36-3.17-11.79-2.72-11.97.49-.2 3.8 4.66 4.85 10.84z"/><linearGradient id="g" gradientUnits="userSpaceOnUse" x1="-98.431" y1="428.677" x2="-98.431" y2="574.079" gradientTransform="scale(-1 1) rotate(34.286 -3.579 176.403)"><stop offset="0" style="stop-color:#9d674f;stop-opacity:.5"/><stop offset="1" style="stop-color:#9d674f;stop-opacity:0"/></linearGradient><path opacity=".48" fill="url(#g)" d="M254.15 321.06c-1.39 5.1-3.38 15.16-.78 27.38 3.01 14.17 10.55 23.42 14.17 27.35 2.46 11.2 4.72 23.01 6.68 35.38a615.93 615.93 0 0 1 6.39 57.67c-4.14-12.87-8.29-25.75-12.43-38.62-2.08-6.72-3.84-12.19-5.07-15.99-1.77-5.48-2.59-7.85-5.93-18.16-.66-2.05-2.62-8.1-2.65-8.18-1.37-4.23-3.07-9.47-3.11-9.6-3.02-9.31-3.57-11.08-4.19-13.1-.44-1.45-.67-2.28-1.21-3.95-.99-3.07-1.48-4.6-2.66-8.11-.83-2.44-2.8-8.5-7.46-23.16-.07-.48-.13-1.1-.13-1.82 0-1.35.23-2.37.31-2.7.32-1.33.66-2.96 1.19-2.99.76-.05.7 3.22 2.21 4.44 1.56 1.24 5.34.75 14.67-5.84z"/><linearGradient id="h" gradientUnits="userSpaceOnUse" x1="-232.15" y1="492.484" x2="-221.082" y2="492.484" gradientTransform="scale(-1 1) rotate(34.286 -3.579 176.403)"><stop offset="0" style="stop-color:#9d674f;stop-opacity:0"/><stop offset="1" style="stop-color:#9d674f"/></linearGradient><path fill="url(#h)" d="M362.91 317.32c.67-1.21 1.78-2.92 3.5-4.62 2.16-2.13 4.43-3.39 4.34-3.53-.09-.15-2.31 1.5-5.58 2.27-1.65.39-3.07.44-4.06.42.59 1.82 1.2 3.64 1.8 5.46z"/><path fill="#34221A" d="M380.48 370.59c.63-.45 1.35-.92 2.15-1.37.93-.53 1.81-.95 2.62-1.29.06-.03-1.31.63-2.97.68-1.08.03-1.98-.22-2.61-.45 0 .01.38 1.15.38 1.16.02 0 .43 1.26.43 1.27z"/><path opacity=".06" fill="#E3B8A5" d="M287.81 389.39c3.81-1.22 8.12 2.04 9.35 2.98 4.82 3.65 5.57 8.92 9.63 13.54.49.56 1.5 1.65 2.4 3.41.97 1.9.92 2.7 1.38 3.29 1.74 2.28 10.01.08 14.6-2.85 14.01-8.93 11.97-36.1 11.34-44.6-.54-7.22-2.25-30.08-15.59-42.43-1.22-1.13-12.34-11.41-17.86-12.47 0 0-4.83-.93-7.7-3.84-.06-.07-.09-.1-.09-.1-.04-.04-.04-.05-.11-.11-2.36-2.25-16.62-1.76-16.62-1.76-1.29.04-3.43.1-6.12.07-1.01-.01-2.75.12-4.64.99-.73.33-3.53 1.62-4.77 4.38-.85 1.9-.51 3.51-.2 5.95.45 3.48.21 7.01.6 10.5 1.49 13.4 1.09 12 1.22 13.18 1.08 9.98 2.31 19.54 3.28 26.79.19 2.74.58 6.86 1.51 11.81.94 4.99 1.61 6.5 3.31 12.94 2.59 9.81 5.08 19.43 4.16 25.7-.55 3.74-1.46 8.64-1.46 8.64-.22 1.16-.4 2.11-.52 2.7.67.02 1.58-.06 2.38-.6 2.99-2.01 1.84-8.03 1.59-12.72-.55-10.19 2.76-23.41 8.93-25.39z"/><path opacity=".15" fill="#E3B8A5" d="M334.53 422.95c-.59.64-1.41 1.67-2.01 3.09-1.05 2.45-.95 4.85.59 11.43 1.14 4.86 1.97 7.32 3.52 13.21.66 2.5 1.16 4.55 1.48 5.85 1.55 1.42 3.09 2.84 4.64 4.26a835.82 835.82 0 0 1-4.54-14.16c-1.85-5.95-2.26-7.52-2.61-9.2a55.385 55.385 0 0 1-1.07-14.48z"/><path opacity=".54" fill="#9D674F" d="M334.59 423.15c-.09 1.28-.18 3.05-.11 5.15.06 2 .27 5.28 1.38 10.29.78 3.55 1.4 5.2 4.1 13.61 1.2 3.73 2.15 6.73 2.72 8.54 1.82 1.73 3.67 3.56 5.53 5.51 1.48 1.54 2.9 3.07 4.24 4.58-.23-.32-.56-.78-.95-1.35a50.142 50.142 0 0 1-2.25-3.61c-.32-.58-.74-1.35-1.19-2.29.13-.34.3-.84.47-1.45.41-1.47.53-2.59.59-3.08.13-1.08.44-2.65 1.19-4.7a28.433 28.433 0 0 1-5.16-4.34c-1.48-1.57-2.86-3.08-3.56-5.18-.1-.3-.2-.66-.55-1.73-.56-1.74-1.01-3.01-1.16-3.43-.44-1.24-1.13-3.29-2.24-6.79-.45-1.37-.85-2.63-1.21-3.76-.31-.97-.68-2.14-1.09-3.47-.28-.99-.54-1.82-.75-2.5z"/><linearGradient id="i" gradientUnits="userSpaceOnUse" x1="277.039" y1="396.95" x2="266.018" y2="396.95"><stop offset="0" style="stop-color:#9d674f"/><stop offset="1" style="stop-color:#9d674f;stop-opacity:0"/></linearGradient><path fill="url(#i)" d="M269.06 376.02c-.75-4.25-1.06-7.8-1.21-10.21-.64 1.71-1.44 4.29-1.73 7.49-.54 5.97 1.06 10.03 2.69 15.38 0 0 3.11 10.17 4.96 22.82.56 3.84 1.18 9.52 1.13 16.58.49-1.34 1.08-3.21 1.51-5.48.55-2.9.59-5.14.61-7.17.02-1.29 0-4.02-.45-7.53-.31-2.39-.7-4.27-1.52-7.66-1.29-5.38-1.9-7.36-3.3-12.76-1.41-5.55-2.14-8.39-2.69-11.46z"/><path opacity=".58" fill="#34221A" d="M379.04 370.99a2.84 2.84 0 0 0-.17-1.48c-.36-1.03-1.13-1.57-1.42-1.76-3.19-2.57-4.57-5.18-5.21-6.78-.9-2.23-2.4-7.57-1.63-10.49.09-.33.42-1.45-.11-2.44-.36-.68-.95-1.01-1.17-1.13-1.82-1.06-3.5-3.24-5.22-5.46-1.82-2.35-2.53-4.62-3.09-6.36-1.58-4.98-1.19-9.31-.99-11.29.22-2.27.54-2.83.83-6.09.21-2.44.24-4.47.23-5.84l1.8 5.46c-.98 2.41-1.46 4.56-1.7 6.19-.23 1.55-.64 4.38 0 7.99.14.8.6 3.16 1.92 5.95.27.57 1.48 3.08 3.8 5.73 1.87 2.15 3.24 2.98 4.09 3.41.47.24.87.4 1.15.51-.29 1.15-.45 2.15-.54 2.95-.1.94-.12 1.69-.13 2.04-.02 1.39.1 2.46.16 2.87.08.64.34 2.41 1.16 4.56.48 1.27.98 2.19 1.26 2.71.37.69.78 1.43 1.44 2.34.77 1.04 1.76 2.37 3.5 3.27.28.14.51.24.66.31.27.81.54 1.62.8 2.44-.18.26-.44.64-.73 1.12a18.64 18.64 0 0 0-2.08 5.12c-.47 1.93-.5 3.47-.51 3.99-.03 3.23.87 5.62 1.36 6.87 0 0 1.02 2.62 2.52 4.37.57.66 1.19 1.14 1.19 1.14.69.53 1.24.78 1.24.79-.01.02-1.67-.51-3.08-1.73-.35-.3-1.45-1.3-2.52-3.83-.46-1.09-1.98-4.81-1.41-9.46.34-2.74 1.32-5.1 1.58-5.62.13-.27.23-.49.43-.92.52-1.12.57-1.32.59-1.45z"/><path opacity=".61" fill="#9D674F" d="M395.83 356.71c.09.03.19.06.28.09.07.02.15.05.22.07-.33.97-.83 2.23-1.61 3.6-.91 1.6-1.79 2.67-1.98 2.91-.5.6-1.6 1.85-3.31 3.1-.86.63-1.57 1.02-2.98 1.79-1.9 1.04-3.75 1.88-5.94 2.88-.24.11-.43.2-.57.26.11-.18.22-.35.35-.53l.2-.29c.18-.13.43-.3.73-.5 1.13-.74 2.04-1.21 2.25-1.32.85-.43 1.75-.82 1.83-.86.23-.1.45-.19.78-.35.12-.06.57-.29 1.15-.64.1-.06.5-.31 1-.68.47-.34.7-.51.95-.74.22-.21.36-.36.65-.53.2-.12.28-.13.48-.24.27-.16.45-.32.67-.53.47-.45.76-.87.93-1.11.17-.25.29-.42.42-.67.1-.18.2-.39.39-.66.07-.1.13-.17.15-.2.32-.4.92-1.28 1.46-2.15.31-.49.56-.93.71-1.21.11-.19.3-.54.53-.98.11-.2.2-.37.26-.51zm-4.48-31.9-.53 1.05c-1.2 2.39-1.81 3.58-2.06 4.09-1.16 2.29-1.9 3.76-2.88 5.56-1.22 2.26-1.95 3.53-2.42 4.32-.65 1.08-1.44 2.36-2.59 3.83-.75.96-1.25 1.47-1.79 1.93-.68.58-1.32 1.13-2.36 1.52-1.49.55-2.82.41-3.46.3-.46-.08-.84-.2-1.11-.3-.08.31-.15.63-.22.97-.07.34-.13.67-.18.99.36.05.93.11 1.62.07 2.56-.13 4.39-1.42 5.14-1.95 3.89-2.74 7.34-8.98 10.05-14.53.86-1.75 2.04-4.24 3.36-7.31-.08-.08-.16-.15-.25-.23-.1-.11-.21-.21-.32-.31z"/><path opacity=".15" fill="#915F49" d="M352.44 283.09c-.81-1.84-1.94-4.61-3.05-8.08-2.22-6.98-3.31-10.52-1.91-13.23 2.2-4.28 8.82-4.84 10.62-4.94a45.25 45.25 0 0 0-16.27-3.56c1.33 4.1 2.67 8.2 4.01 12.31 1.84 5.63 3.69 11.23 5.55 16.82.35.23.7.46 1.05.68z"/><path opacity=".38" fill="#915F49" d="M305.53 297.13c-1.23-.69-2.46-1.39-3.68-2.08.9-2.86 1.74-6.15 2.36-9.83.84-4.97 1.08-9.45 1.04-13.23.97.04 2.34-.01 3.87-.47 3-.9 4.74-2.78 4.9-2.6.17.19-1.64 2.15-3.88 4.28a79.03 79.03 0 0 1-4.09 3.64c-.07 2.54-.13 5.07-.2 7.61-.11 4.23-.22 8.45-.32 12.68z"/><image overflow="visible" opacity=".64" width="9" height="25" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAZCAYAAADjRwSLAAAACXBIWXMAAAsSAAALEgHS3X78AAAA GXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAgxJREFUeNqMU01v00AQ3S/brdsk RUlagSKVqqhCXHrmwJWfwJkDhxYJDlwqTnAAiSKBOCBxQOKCxH/h1lJVfFUQIUqAJk1I0hKv7R3e bkxwIpAY63nG67frmTdjxv7DuL29enA9pDSpceUxivX71Y0nlCcJe1MzxYWgfHLJL1WWgsqpi3Zt e3Odj5GEF4TuWCF8i9dPb58WfuCPSNihhFTLWKyBPG+hpsJVSlO1tbnmiEqFhTk1WyojXsilUZ2p nfk0aDU+INaKCRFlBUjGuUDAkXXqqMRcAcqfq85zIYsglCyVuwvvhSybRNcdiUspkY8CqTChzXlU vY+wLdw+zoO/aGgYGTOUgMMYbwEBojymVVjs7T7eKDgSYJPO8uc8Q1EGUyeMjphYvnTtDQQkQGYQ GaZlWKh6pfKievvsriKiYcHjllIS66j5pafIJLOM6KtLdCJxnKbgu+LslVsdIhODmMJHOaA4IkxE W7luEwmIG9kWZ1/FIyWUxtpJYGfHxLpBJj3Ep/vwfTT3CP4nKjsejUr8o/UNCy/xMgYSkDU2fo86 B40/pONuG66C6ewBXRD7SKh1bu1Oc+veujeavr0XDy8gpZVhd4mZaKBXLt987ho8EkUPDnHC55wE e2Pja013mnVmIAXOSY669cHB/sexv+W37Ty6sSiUF4DEUPW7f/5j2/ev+pNrvwQYAM8e+FFIfg2L AAAAAElFTkSuQmCC" transform="translate(308 375.04)"/><linearGradient id="j" gradientUnits="userSpaceOnUse" x1="252.224" y1="306.614" x2="268.325" y2="306.614"><stop offset="0" style="stop-color:#d18969"/><stop offset="1" style="stop-color:#9d674f"/></linearGradient><path opacity=".57" fill="url(#j)" d="M263.42 326.33c-1.01-.4-7.83-3.25-10.33-10.78-1.87-5.64-.19-10.47.37-11.89.03-.04 4.17-4.7 4.2-4.74.21-.23 10.46-11.79 10.67-12.02-.15.65-.55 2.41-.7 3.07-.38 1.66-.57 2.5-.75 3.29-.33 1.45-.61 2.67-1.18 5.12-.26 1.13-.39 1.7-.49 2.13-.45 1.95-.57 2.42-1.11 4.74-.42 1.79-.48 2.08-.72 3.1-.34 1.44-.61 2.61-.79 3.37l.36 6.38c.15 2.74.31 5.49.47 8.23z"/><linearGradient id="k" gradientUnits="userSpaceOnUse" x1="289.617" y1="281.116" x2="269.029" y2="273.623"><stop offset=".006" style="stop-color:#d18969"/><stop offset="1" style="stop-color:#9d674f"/></linearGradient><path opacity=".47" fill="url(#k)" d="M287.94 254.38c-.15-.75 3.15-1.7 5.71-3.1 1.95-1.07 4.76-2.53 8.32-4.11-.94.11-1.94.28-3 .53-.38.09-.74.18-1.1.28 0 0-.68.12-1.31.4-3.51 1.57-6.32 2.76-8.32 3.58-2.21.91-3.32 1.37-4.6 1.87-1.26.5-2.51 1.04-3.77 1.54 0 0-2.63 1.02-3.69 1.9-.65.54-1.06 1.04-1.21 1.23-.19.23-.93 1.17-1.53 3.03-.41 1.27-.39 1.99-.76 4.5 0 0-.01.05-.55 3.21-1.03 6.05-3.31 15.16-3.31 15.16-.11.58-.27 1.45-.5 2.5-.15.69-.26 1.17-.38 1.7-.3 1.29-.2.87-.84 3.69-1.1 4.78-2.43 10.5-2.43 10.5-.44 1.89-1 4.3-1.66 7.1.48-.96 1.3-2.24 2.69-3.26 3.37-2.48 7.59-1.58 7.8-2.69.15-.79-2.06-1.04-3.19-3.05-.74-1.3-.52-2.46.28-7.3 1.12-6.77.86-5.52 1.2-7.3.91-4.73 1.03-4.68 1.56-7.51 1.65-8.88 2.47-13.32 2.76-15.66.05-.42.18-1.52.92-2.62.1-.14.58-.85 1.46-1.48 3.07-2.18 10.8-3.22 10.78-3.93-.01-.29-1.24-.26-1.33-.71z"/><image overflow="visible" opacity=".64" width="6" height="6" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAACXBIWXMAAAsSAAALEgHS3X78AAAA GXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAINJREFUeNpiYACCi52ZLAxogAko qMbEys4K4lyf3aAJ5HOD2CysfEJ8HKLShQ83zZP48+PbTKAYJxB/ZQTJPtgwu5eJjV2YgZGJ4evD m0W/Pr75zASSYGRmWcfAyMj0/8/v72xCYkn65dN/gyXkfROP/v74ru3vj2+Pfn/+cBkkBhBgAPu3 LQWWm6kLAAAAAElFTkSuQmCC" transform="translate(366 270.04)"/><g opacity=".65"><path fill="#11465D" d="m604.38 312.45-1.97-.48-.34-8.71 1.97.48zm-.67-17.43-1.98-.48-.33-8.71 1.97.48z"/><path fill="#1C7499" d="m61.09 336.62-1.97-.48 542.61-41.6 1.98.48z"/><path fill="#1E7EA6" d="m24.26 343.82-1.97-.48 36.49-15.91 1.97.48z"/><path fill="#0E3A4D" d="m61.76 354.06-1.97-.49-37.5-10.23 1.97.48z"/><path fill="#1D789F" d="m640.88 296.55-36.5 15.9-.34-8.71-542.61 41.6.33 8.72-37.5-10.24 36.49-15.91.34 8.71 542.62-41.6-.34-8.71z"/><path fill="#196788" d="M286.45 140.29v5.37l-8.71.33-.01-5.36zm-17.44.67.01 5.37-8.72.33v-5.36z"/><path fill="#0E3B4E" d="M385.46 494.53v5.36L269.02 146.33l-.01-5.37z"/><path fill="#11475E" d="m394.21 507.69.01 5.37-17.47-12.83v-5.37z"/><path fill="#0F3E52" d="M402.89 493.85v5.37l-8.67 13.84-.01-5.37z"/><path fill="#2497C7" d="m268.99 127.46 17.46 12.83-8.72.34 116.45 353.56 8.71-.34-8.68 13.84-17.46-12.83 8.71-.33-116.45-353.57-8.71.34zm67.4 465.39-.64-1.93 8.71-.34.64 1.93zm-17.43.67-.64-1.93 8.71-.34.64 1.93z"/><path fill="#0E3B4E" d="m327.67 593.18-.64-1.93-.25-544.21.64 1.93z"/><path fill="#0F4054" d="m331.76 11.69-.63-1.93 13.08 36.61.64 1.93z"/><path fill="#124B63" d="m318.7 49.31-.63-1.93 13.06-37.62.63 1.93z"/><path fill="#196788" d="m331.76 11.69 13.09 36.61-8.71.34.25 544.21 8.71-.34-13.05 37.61-13.09-36.6 8.71-.34-.25-544.21-8.72.34z"/></g><radialGradient id="l" cx="331.5" cy="319.5" r="13.5" gradientUnits="userSpaceOnUse"><stop offset=".316" style="stop-color:#0f374a"/><stop offset="1" style="stop-color:#670e2f;stop-opacity:0"/></radialGradient><circle fill="url(#l)" cx="331.5" cy="319.5" r="13.5"/><path d="M46.03 72.5h3.45l2.67 10.47h.05V72.5h2.45V90h-2.83l-3.3-12.78h-.05V90h-2.45V72.5zm10.67 5.33h2.65v2.65H56.7v-2.65zm0 9.52h2.65V90H56.7v-2.65zm8.7-14.85h3.45l2.67 10.47h.05V72.5h2.45V90H71.2l-3.3-12.78h-.05V90H65.4V72.5zm12.8 0h3.72L84.77 90h-2.75l-.5-3.47v.05H78.4L77.9 90h-2.55l2.85-17.5zm3 11.7-1.23-8.65h-.05l-1.2 8.65h2.48zm5.9-9.2h-2.88v-2.5h8.5V75h-2.88v15H87.1V75zm6.95-2.5h2.75V90h-2.75V72.5zm4.07 0h2.78l1.8 13.58h.05l1.8-13.58h2.52L104.42 90h-3.65l-2.65-17.5zm10.28 0h7.5V75h-4.75v4.63h3.77v2.5h-3.77v5.38h4.75V90h-7.5V72.5zm13.95 16.6c-.72-.77-1.08-1.85-1.08-3.25v-9.2c0-1.4.36-2.48 1.08-3.25.72-.77 1.75-1.15 3.1-1.15s2.38.38 3.1 1.15c.72.77 1.07 1.85 1.07 3.25v9.2c0 1.4-.36 2.48-1.07 3.25-.72.77-1.75 1.15-3.1 1.15s-2.39-.38-3.1-1.15zm4.52-3.07v-9.55c0-1.15-.47-1.72-1.42-1.72s-1.42.58-1.42 1.72v9.55c0 1.15.47 1.72 1.42 1.72s1.42-.57 1.42-1.72zm4.6-13.53h4.08c1.42 0 2.45.33 3.1.99.65.66.97 1.67.97 3.04v1.07c0 1.82-.6 2.97-1.8 3.45v.05c.67.2 1.14.61 1.41 1.23s.41 1.44.41 2.47v3.08c0 .5.02.9.05 1.21s.12.61.25.91h-2.8c-.1-.28-.17-.55-.2-.8s-.05-.7-.05-1.35v-3.2c0-.8-.13-1.36-.39-1.68-.26-.32-.7-.47-1.34-.47h-.95V90h-2.75V72.5zm3.75 7.5c.55 0 .96-.14 1.24-.42s.41-.76.41-1.42V76.8c0-.63-.11-1.09-.34-1.38-.23-.28-.58-.42-1.06-.42h-1.25v5h1zm6.33-7.5h2.75V90h-2.75V72.5zm5.65 16.61c-.7-.76-1.05-1.85-1.05-3.26v-9.2c0-1.42.35-2.5 1.05-3.26s1.72-1.14 3.05-1.14c1.33 0 2.35.38 3.05 1.14.7.76 1.05 1.85 1.05 3.26v1.5h-2.6v-1.68c0-1.15-.47-1.72-1.42-1.72s-1.42.58-1.42 1.72v9.58c0 1.13.47 1.7 1.42 1.7s1.42-.57 1.42-1.7v-3.42h-1.38v-2.5h3.98v5.72c0 1.42-.35 2.5-1.05 3.26-.7.76-1.72 1.14-3.05 1.14-1.34 0-2.35-.38-3.05-1.14zm8.92-16.61h2.75V90h-2.75V72.5zm4.8 0h3.45l2.67 10.47h.05V72.5h2.45V90h-2.82l-3.3-12.78h-.05V90h-2.45V72.5z" fill="#333"/><path fill="#990042" d="M27 96V39c0-1.65 1.35-3 3-3h3c1.65 0 3 1.35 3 3v57c0 1.65-1.35 3-3 3h-3c-1.65 0-3-1.35-3-3z"/><path fill="#F5FF45" d="M326.28 326v-15.03h2.42l5.04 10.04v-10.04h2.32V326h-2.5l-4.96-9.8v9.8h-2.32z"/><path d="M571.5 276.53v-4.46h-3.69v-3.08h3.69v-4.46h2.46v4.46h3.7v3.08h-3.7v4.46h-2.46zm7.01 2.47 4.87-8.94-4.42-8.24h3.32l2.79 5.14 2.81-5.14h3.29l-4.42 8.22 4.87 8.96h-3.43l-3.13-5.82-3.13 5.82h-3.42zM418.5 519.53v-4.46h-3.69v-3.08h3.69v-4.46h2.46v4.46h3.7v3.08h-3.7v4.46h-2.46zm7.21 2.47v-3.14l7.4-11.13h-6.57v-2.91h10.31v2.7l-7.71 11.58h8.01v2.9h-11.44zM355.5 69.53v-4.46h-3.69v-3.08h3.69v-4.46h2.46v4.46h3.7v3.08h-3.7v4.46h-2.46zM367.63 72v-7.23l-5.16-9.95h3.33l3.31 6.79 3.26-6.79h3.27l-5.18 9.97V72h-2.83z" fill="#B5004E"/><path d="M46.97 62.11c-.7-.76-1.05-1.85-1.05-3.26V45.5h2.75v13.55c0 .6.12 1.03.36 1.3s.59.4 1.04.4.8-.13 1.04-.4.36-.7.36-1.3V45.5h2.65v13.35c0 1.42-.35 2.5-1.05 3.26-.7.76-1.72 1.14-3.05 1.14-1.33 0-2.35-.38-3.05-1.14zm9.66 0c-.68-.76-1.03-1.85-1.03-3.26v-1h2.6v1.2c0 1.13.47 1.7 1.42 1.7.47 0 .82-.14 1.06-.41.24-.28.36-.72.36-1.34 0-.73-.17-1.38-.5-1.94-.33-.56-.95-1.23-1.85-2.01-1.13-1-1.93-1.9-2.38-2.71-.45-.81-.68-1.72-.68-2.74 0-1.38.35-2.45 1.05-3.21.7-.76 1.72-1.14 3.05-1.14 1.32 0 2.31.38 2.99 1.14s1.01 1.85 1.01 3.26v.72h-2.6v-.9c0-.6-.12-1.04-.35-1.31-.23-.27-.58-.41-1.03-.41-.92 0-1.38.56-1.38 1.67 0 .63.17 1.23.51 1.78s.96 1.22 1.86 2c1.15 1 1.94 1.91 2.38 2.72.43.82.65 1.78.65 2.88 0 1.43-.35 2.53-1.06 3.3-.71.77-1.74 1.15-3.09 1.15-1.3 0-2.31-.38-2.99-1.14zm8.75-16.61h7.5V48h-4.75v4.63h3.77v2.5h-3.77v5.38h4.75V63h-7.5V45.5zm9.07 0h4.07c1.42 0 2.45.33 3.1.99.65.66.97 1.67.97 3.04v1.07c0 1.82-.6 2.97-1.8 3.45v.05c.67.2 1.14.61 1.41 1.23.28.62.41 1.44.41 2.47v3.08c0 .5.02.9.05 1.21s.12.61.25.91h-2.8c-.1-.28-.17-.55-.2-.8s-.05-.7-.05-1.35v-3.2c0-.8-.13-1.36-.39-1.68-.26-.32-.7-.47-1.34-.47h-.93V63h-2.75V45.5zM78.2 53c.55 0 .96-.14 1.24-.42.27-.28.41-.76.41-1.42V49.8c0-.63-.11-1.09-.34-1.38-.22-.28-.58-.42-1.06-.42H77.2v5h1zm7.22-4.85h-.9V45.5h2.65v2.38l-1.52 3.28h-1.28l1.05-3.01zm4.35 13.96c-.68-.76-1.03-1.85-1.03-3.26v-1h2.6v1.2c0 1.13.47 1.7 1.42 1.7.47 0 .82-.14 1.06-.41.24-.28.36-.72.36-1.34 0-.73-.17-1.38-.5-1.94-.33-.56-.95-1.23-1.85-2.01-1.13-1-1.93-1.9-2.38-2.71-.45-.81-.68-1.72-.68-2.74 0-1.38.35-2.45 1.05-3.21.7-.76 1.72-1.14 3.05-1.14 1.32 0 2.31.38 2.99 1.14s1.01 1.85 1.01 3.26v.72h-2.6v-.9c0-.6-.12-1.04-.35-1.31-.23-.27-.58-.41-1.03-.41-.92 0-1.38.56-1.38 1.67 0 .63.17 1.23.51 1.78s.96 1.22 1.86 2c1.15 1 1.94 1.91 2.38 2.72.43.82.65 1.78.65 2.88 0 1.43-.35 2.53-1.06 3.3-.71.77-1.74 1.15-3.09 1.15-1.29 0-2.3-.38-2.99-1.14zm12.75-16.61h2.75v15h4.52V63h-7.27V45.5zm8.6 0h7.5V48h-4.75v4.63h3.77v2.5h-3.77v5.38h4.75V63h-7.5V45.5zm9.08 0h7.27V48h-4.52v4.88h3.55v2.5h-3.55V63h-2.75V45.5zm11 2.5h-2.88v-2.5h8.5V48h-2.88v15h-2.75V48zm10.95-2.5h2.75v7.13h2.95V45.5h2.75V63h-2.75v-7.88h-2.95V63h-2.75V45.5zm12.62 0h3.72l2.85 17.5h-2.75l-.5-3.47v.05h-3.13l-.5 3.42h-2.55l2.86-17.5zm3 11.7-1.23-8.65h-.05l-1.2 8.65h2.48zm4.9-11.7h3.45l2.68 10.47h.05V45.5h2.45V63h-2.83l-3.3-12.78h-.05V63h-2.45V45.5zm10.68 0h4.2c1.37 0 2.39.37 3.08 1.1.68.73 1.03 1.81 1.03 3.23v8.85c0 1.42-.34 2.49-1.03 3.23s-1.71 1.1-3.08 1.1h-4.2V45.5zm4.15 15c.45 0 .8-.13 1.04-.4s.36-.7.36-1.3v-9.1c0-.6-.12-1.03-.36-1.3s-.59-.4-1.04-.4h-1.4v12.5h1.4z" fill="#333"/></g></switch></svg> | 0 |
data/mdn-content/files/en-us/web/api/xrinputsource | data/mdn-content/files/en-us/web/api/xrinputsource/gripspace/gripspace-righthand-light.svg | <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 648 630.04" xml:space="preserve"><switch><g><path fill="#D18969" d="M386.76 315.87c-10.69-6.62-21.38-13.23-32.08-19.85-8.83-6.69-17.67-13.38-26.5-20.07 6.1-5.48 12.2-10.97 18.3-16.45-7.72-4.1-15.45-8.2-23.17-12.3 26.54 5.6 53.08 11.21 79.62 16.81.2.04 1.42.19 3 .63 1.65.46 3.41.95 5.15 2.19.87.62 2.35 1.86 3.55 4.08 15.41 45.74 30.81 91.48 46.22 137.22.42.92 1.07 2.54 1.21 4.61 1.27 18.39-38.99 42.31-57.65 32.55-2.62-1.37-1.67-1.76-9.17-7.4-9.61-7.23-21.63-14.46-23.09-12.73-.69.83 1.44 3.2.97 3.59-1.1.93-11.73-8.14-20.02-19.31-8.24-11.11-15.27-20.57-13.84-30.48 1.9-13.2 18.38-24.43 40.16-27.64 2.45-11.81 4.9-23.63 7.34-35.45z"/><linearGradient id="a" gradientUnits="userSpaceOnUse" x1="353.187" y1="285.15" x2="247.456" y2="316.331" gradientTransform="rotate(-2.206 331.823 -363.917)"><stop offset=".196" style="stop-color:#380018"/><stop offset=".483" style="stop-color:#c92c5e"/><stop offset=".698" style="stop-color:#380018"/></linearGradient><path fill="url(#a)" d="M320.99 190.01c-3.87-11.74-15.67-19.83-29.47-19.07-16.71.92-30.02 14.48-29.72 30.28.05 2.76.51 5.4 1.33 7.88l76.03 230.86c-.82-2.48-1.28-5.12-1.33-7.88-.3-15.8 13.01-29.36 29.72-30.28 13.8-.76 25.61 7.33 29.47 19.07l-76.03-230.86z"/><ellipse transform="rotate(-18.232 368.08 430.452)" fill="#380018" cx="368.09" cy="430.42" rx="30.46" ry="28.46"/><path fill="#FFD2D5" d="M334.71 262.89c.07 2.98-1.95 5.46-5.01 6.68-.29.1-.58.2-.86.3-1.36.41-2.89.59-4.5.49-5.82-.38-10.63-4.36-10.72-8.87-.1-4.51 4.55-7.85 10.37-7.46 5.82.38 10.63 4.35 10.72 8.86z"/><radialGradient id="b" cx="298.994" cy="261.641" r="19.092" fx="298.589" fy="261.547" gradientTransform="matrix(.8265 .5629 -.506 .743 208.37 -100.253)" gradientUnits="userSpaceOnUse"><stop offset=".352" style="stop-color:#fd1729"/><stop offset=".455" style="stop-color:#fddcde"/><stop offset=".665" style="stop-color:#fd1729"/><stop offset=".827" style="stop-color:#9c0e19"/><stop offset="1" style="stop-color:#380018"/></radialGradient><path fill="url(#b)" d="M338.34 268.17c-.01 0 .24-1.21.2-2.35-.02-.54-.06-.99-.12-1.38 0-.02-.01-.05-.01-.07l-.01-.04a8.18 8.18 0 0 0-.27-1.27c-.04-.14-.09-.27-.13-.41-.03-.1-.06-.2-.1-.31-.01-.04-.03-.09-.04-.13l-.02-.04c-.95-2.75-2.89-5.12-5.57-6.84-.64-.42-1.32-.8-2.03-1.14a.914.914 0 0 1-.14-.07s-.01 0-.01-.01h-.02c-.05-.02-.11-.05-.17-.07-.26-.12-.52-.23-.79-.33-.01 0-.01-.01-.02-.01s-.02-.01-.03-.01l-.1-.03c.03.01.07.02.1.04-.31-.12-.62-.23-.94-.33l-.04-.01c-.06-.02-.11-.04-.18-.05-.06-.02-.12-.04-.17-.05-.01 0-.02-.01-.03-.01.01 0 .02.01.03.01-.22-.07-.46-.13-.69-.19-.84-.21-1.37-.31-2.01-.39-.06-.01-.12-.02-.17-.03-.34-.03-.79-.08-1.13-.11h-.01c-1.31-.09-2.27-.01-2.28 0h-.02c-.33.02-.74.07-1.05.1l-.19.03c-.27.03-.5.07-.74.12l-.11.02c-.29.06-.66.15-.97.22.02-.01.04-.01.06-.02l-.19.05c-.49.12-1.1.32-1.71.56-1.99.76-3.68 1.9-4.99 3.39-.04.04-.07.08-.11.13l-.15.18c-.05.07-.11.14-.17.21-.03.03-.06.06-.08.09l-.14.18c-.12.15-.24.33-.38.51-.01.01-.6.85-1.06 1.96-.21.51-.33.85-.44 1.26l-.03.11c-.06.25-.14.58-.19.83l-.15.78-.06.34c-.02.1-.03.21-.04.31-.1.78-.18 1.93.02 3.15.24 1.37.53 2.43 1.42 4.09.23.44.52.87.84 1.31 1.69 2.37 4.12 4.11 6.83 5.18 1.18.49 2.14.72 3.34.99.01 0 .97.2 2.25.29.67.04 1.56.03 2.23.01.21-.01 2.13-.1 4.24-.81.65-.22 2.01-.69 3.76-1.91 1.75-1.23 2.81-2.77 3-3.06.33-.5.71-1.11 1.06-1.96.25-.59.36-.95.49-1.46.07-.24.13-.49.18-.74l.15-.81z"/><path fill="#E01425" d="M323.99 254.02c5.82.38 10.63 4.36 10.72 8.86.1 4.51-4.55 7.86-10.37 7.47-5.82-.38-10.63-4.36-10.72-8.87-.1-4.5 4.55-7.84 10.37-7.46z"/><path fill="#D18969" d="M293.51 301.37c-1.76 6.84-6.65 11.94-12.7 13.29-1.03.23-7.56 1.57-11.43-2.21-5.72-5.58-.92-17.75.76-22.01 3.32-8.42 8.89-14.32 13.78-18.21 3.19 9.71 6.39 19.42 9.59 29.14zm1.88 5.7c-6.45 9.68-11.31 16.28-14.83 20.83-1.03 1.33-3.13 4.01-4.85 8.1-1.42 3.35-3.67 8.68-2.26 13.36.78 2.6 2.86 4.69 15.45 11.02 13.52 6.8 20.28 10.2 24.59 7.2 5.05-3.52 3.61-13.15 3.42-14.41-1.57-10.45-10.36-15.96-11.89-16.89-3.22-9.73-6.42-19.47-9.63-29.21z"/><path fill="#D18969" d="M322.36 376.98c.38 1.75 1.66 7.61-1.16 10.92-3.6 4.23-13.54 3.89-23.47-2.88-2.05-1.15-5.07-3.23-7.56-6.76-5.65-8.03-3.97-17.1-3.57-19.04 8.82.51 17.65 1.03 26.47 1.54.48 1.46.96 2.91 1.44 4.37 1.56 1.16 6.37 5.04 7.85 11.85z"/><path fill="#D18969" d="M329.33 393.64c.96.91 3.47 3.38 4.67 7.47.54 1.83 1.89 6.46-.36 9.77-.98 1.45-2.82 2.88-11.04 3.86-9.87 1.18-14.78 1.91-18.29-.38-5.55-3.63-7.47-11.04-6.82-16.38.39-3.24 1.73-5.79 2.51-7.28 2.04-3.89 4.65-6.47 6.41-7.95 1.23 3.98 4.57 6.77 8.32 7.04 3.85.28 6.54-2.21 7.03-2.67.27.81.54 1.62.8 2.44 1.53.52 4.22 1.64 6.77 4.08zm75.47 67.91c-1.14-4.19.56-5.64-.48-13.97-.88-7.03-3.16-11.09-5.65-19.07a688.23 688.23 0 0 0-8.02-24.18c-11.36-6.82-18.36-14.37-22.3-19.28-29.89-37.28-14.4-86.73-13.65-89.02 1.45-4.42 2.99-7.95 4.09-10.27-2.88-6.48-5.75-12.96-8.63-19.44-3.94.2-10.97-.05-17.99-4.03-10.78-6.1-17.38-18.65-14.68-22.15 1.66-2.15 6.29-.19 17.71-1.48 2.3-.26 4.27-.58 4.47-.61 3.21-.53 5.16-1.05 8.63-1.85 4.1-.95 6.15-1.43 7.72-1.69 5.94-.99 10.66-1.71 14.5.66 2.11 1.3 3.2 3.07 3.79 4.06 3.69 6.14 13.51 23.32 26.44 46.6 6.85 22.13 17.9 55.85 33.9 96.94 3.74 9.61 2.45 20.16 10.36 25.98 5.5 4.05 12.23 4.38 17.14 4 2.51 37.28-11.01 63.84-26.72 66.53-10.8 1.86-27.63-6.7-30.63-17.73z"/><path opacity=".4" fill="#9D674F" d="M404.46 459.85c-.11-.69-.2-1.58.18-5.85.93-10.5 2.68-18.64 3.26-21.31 2.63-12.09 3.94-18.13 5.3-19.49 4.94-4.96 12.65-4.6 25.19-4 10.02.48 18.18 2.15 23.68 3.56.14 1.67.29 3.96.35 6.67.24 10.75-1.12 18.99-1.66 21.95-1.27 7-2.93 15.43-8.17 23.69-.15.24-.28.43-.39.59-3.43 5.11-7.36 10.98-14.86 13.17-8.68 2.54-16.36-1.56-19.09-3.02-2.09-1.11-12.29-6.39-13.79-15.96z"/><linearGradient id="c" gradientUnits="userSpaceOnUse" x1="307.552" y1="242.845" x2="302.195" y2="233.567" gradientTransform="rotate(-2.206 331.823 -363.917)"><stop offset="0" style="stop-color:#e3b8a5"/><stop offset=".771" style="stop-color:#ccc"/><stop offset="1" style="stop-color:#e3b8a5"/></linearGradient><path fill="url(#c)" d="M339.12 238.18c-2.43.78-5.35 1.51-8.7 1.95-5.1.67-9.54.45-12.94.01-.13-.28-.13-.5-.11-.64.12-.7 1.15-1.45 11.86-2.51 2.14-.21 3.67-.34 5.71-.01 1.78.28 3.21.79 4.18 1.2z"/><linearGradient id="d" gradientUnits="userSpaceOnUse" x1="292.411" y1="412.236" x2="292.411" y2="395.938" gradientTransform="rotate(-2.206 331.823 -363.917)"><stop offset="0" style="stop-color:#e3b8a5"/><stop offset=".771" style="stop-color:#e6e6e6"/><stop offset="1" style="stop-color:#e3b8a5"/></linearGradient><path fill="url(#d)" d="M322 397.15c4.72-.7 5.74-.39 6.37-.05 2.4 1.31 3.09 4.24 3.62 6.45.6 2.52 1.24 5.22-.21 7.22-2.16 3-7.41 2.24-9.43 1.95-1.87-.27-7.51-1.09-9.87-5.7-.28-.55-1.96-3.83-.56-6.39 1.18-2.15 4.15-2.59 10.08-3.48z"/><linearGradient id="e" gradientUnits="userSpaceOnUse" x1="274.529" y1="386.913" x2="281.068" y2="368.946" gradientTransform="rotate(-2.206 331.823 -363.917)"><stop offset="0" style="stop-color:#e3b8a5"/><stop offset=".771" style="stop-color:#e6e6e6"/><stop offset="1" style="stop-color:#e3b8a5"/></linearGradient><path fill="url(#e)" d="M307.58 369.99c3.23 1.88 3.81 5.86 4.85 13.05.63 4.32.92 6.5-.12 7.27-2.18 1.61-8.93-1.93-11.85-7.47-2.16-4.11-2.98-10.78.35-13.06 1.94-1.33 4.86-.91 6.77.21z"/><linearGradient id="f" gradientUnits="userSpaceOnUse" x1="269.61" y1="362.141" x2="276.066" y2="350.96" gradientTransform="rotate(-2.206 331.823 -363.917)"><stop offset="0" style="stop-color:#e3b8a5"/><stop offset=".771" style="stop-color:#e6e6e6"/><stop offset="1" style="stop-color:#e3b8a5"/></linearGradient><path fill="url(#f)" d="M305.17 353.87c-2.03-1.85-4.21-2.63-5.5-3.09-2.38-.85-6.18-2.21-8.13-.51-1.97 1.73-1.31 5.67-.29 7.96 1.62 3.65 5.05 5.19 8.52 6.75 3.59 1.62 7.93 3.57 9.72 1.9 2.21-2.08-.1-9.17-4.32-13.01z"/><linearGradient id="g" gradientUnits="userSpaceOnUse" x1="285.906" y1="395.723" x2="285.906" y2="414.492" gradientTransform="rotate(-2.206 331.823 -363.917)"><stop offset="0" style="stop-color:#d18969;stop-opacity:0"/><stop offset="1" style="stop-color:#9d674f"/></linearGradient><path fill="url(#g)" d="M333.65 410.88c-.84.42-2.06.95-3.62 1.35-.48.1-.84.19-.87.2-1.98.5-6.14-.15-6.14-.15-2.01-.32-3.02-.48-4.29-.97-.79-.31-2.17-.86-3.63-2.08-1-.84-1.67-1.69-2.07-2.28a11.83 11.83 0 0 1-1.62-3.43c.12 1 .46 2.71 1.55 4.33a9.41 9.41 0 0 0 1.26 1.51c.17.16.83.79 1.96 1.45 1.33.78 2.48 1.11 3.56 1.42 1.27.36 2.36.54 3.15.63-5.85.74-10.33-.15-12.94-.88-1.3-.37-3.55-1.1-6.06-2.6-1.2-.72-5.18-3.17-5.97-6.42-.07-.29-.15-.73-.16-.75a16.38 16.38 0 0 1-.22-4.58c-.28 2.25-.13 4.12.07 5.42.23 1.51.59 2.66.78 3.23.22.66.73 2.14 1.72 3.71.74 1.18 2.09 3.33 4.66 4.67 2.33 1.22 4.59 1.21 7.01 1.2.91 0 2.04-.11 4.29-.33 1.05-.1 2.29-.25 4.71-.54 3.08-.37 3.73-.47 4.3-.56.39-.06 1.93-.31 3.89-.8.73-.11 2-.41 3.26-1.34.63-.49 1.09-.99 1.42-1.41z"/><linearGradient id="h" gradientUnits="userSpaceOnUse" x1="271.721" y1="376.871" x2="267.313" y2="382.124" gradientTransform="rotate(-2.206 331.823 -363.917)"><stop offset="0" style="stop-color:#d18969;stop-opacity:0"/><stop offset="1" style="stop-color:#9d674f"/></linearGradient><path fill="url(#h)" d="M308.25 390.06c.51.17 1.03.34 1.54.51.85.45 1.87.34 2.53-.26.76-.68.69-1.68.68-1.8a47 47 0 0 1-3.42-.86c-2.74-.81-4.69-1.41-6.68-2.86-.72-.52-1.75-1.38-2.8-2.72-.44-.39-1.29-1.12-2.39-2-4.81-3.86-7.15-4.77-9.48-7.89-.42-.57-1.1-1.55-1.77-2.94.31 1.8.93 4.1 2.2 6.54 1.01 1.94 2.11 3.34 2.83 4.18 1.58 1.84 3.08 2.96 4.28 3.84 1.42 1.05 2.54 1.69 3.87 2.45 1.1.63 2.82 1.6 5.2 2.59 1.36.55 2.54.95 3.41 1.22z"/><path opacity=".48" fill="#9D674F" d="M356.82 290.22c-.76 1.89-1.59 4.14-2.38 6.72-1.18 3.89-1.78 6.95-2.16 8.95-.53 2.76-.8 4.77-1.12 7.14-.55 4.14-.99 7.39-1.15 11.72-.15 3.94 0 6.94.12 9.28.12 2.31.31 5.8.97 10.31.88 5.93 2.1 10.37 2.49 11.76 1.75 6.19 3.76 10.69 4.42 12.15 2.43 5.33 4.89 9.19 6.06 10.96.91 1.38 2.72 4.01 5.33 7.12 1.67 1.99 4.43 5.09 8.24 8.49 1.2 1.07 4.46 3.92 9.13 7.06 1.53 1.03 2.85 1.85 3.86 2.45a137.065 137.065 0 0 1-17.1-18.26c-1.37-1.76-5.79-7.44-9.17-13.35-9.65-16.88-10.02-34.25-10.2-43.09-.4-18.7 4.08-33.84 7.94-43.57-.45.51-.97 1.05-1.57 1.59-1.3 1.18-2.61 2-3.71 2.57z"/><linearGradient id="i" gradientUnits="userSpaceOnUse" x1="267.553" y1="348.869" x2="257.284" y2="359.137" gradientTransform="rotate(-2.206 331.823 -363.917)"><stop offset="0" style="stop-color:#d18969;stop-opacity:0"/><stop offset="1" style="stop-color:#9d674f"/></linearGradient><path fill="url(#i)" d="M310.3 364.96c-1.79-.15-4.46-.51-7.54-1.5-2.2-.7-3.51-1.37-8.3-3.78-8.78-4.42-8.88-4.46-9.84-5.03-6.02-3.56-7.93-5.75-8.66-6.77-.12-.16-.22-.32-.22-.32-1.42-2.18-1.89-4.3-2.04-5.82-.42 1.16-.85 2.9-.69 4.99.08 1.03.21 2.71 1.28 4.38.74 1.15 1.61 1.81 2.77 2.6 3.05 2.09 5.65 3.47 6.55 3.94 3.25 1.71 5.61 2.9 8.7 4.45.82.41 2.07 1.04 3.72 1.84 2.92 1.41 4.38 2.05 4.83 2.24.67.29.01 0 4.26 1.64 1.77.68 2.24.87 2.84.71 1.57-.43 2.17-2.76 2.34-3.57z"/><linearGradient id="j" gradientUnits="userSpaceOnUse" x1="390.502" y1="262.201" x2="390.502" y2="369.959" gradientTransform="rotate(-2.206 331.823 -363.917)"><stop offset="0" style="stop-color:#9d674f;stop-opacity:.5"/><stop offset="1" style="stop-color:#9d674f;stop-opacity:0"/></linearGradient><path opacity=".48" fill="url(#j)" d="M388.26 263.55c4.56.06 8.3.59 10.97 1.1 5.44 1.03 8.93 1.74 11.81 4.42 2.78 2.58 3.67 5.78 4.07 7.21 5.83 20.48 14.06 40.21 20.48 60.52 2.18 6.88 5.7 17.08 11.09 29.29-1.64-4.74-2.94-8.6-3.82-11.24-1.08-3.24-1.32-3.98-3.48-10.48-.67-2-1.48-4.44-2.55-7.65-.68-2.04-2.71-8.07-2.74-8.16-1.41-4.21-3.16-9.44-3.21-9.57-3.11-9.28-3.72-11.03-4.43-13.02-.51-1.43-.82-2.23-1.37-3.89-1.03-3.05-1.55-4.58-2.68-8.1-.79-2.46-2.81-8.5-7.78-23.06-.23-.43-.55-.96-.98-1.54-.81-1.09-1.6-1.77-1.86-1.99-1.09-.92-2.08-1.39-2.74-1.7-.75-.35-1.8-.77-3.13-1.04-2.13-.42-4.25-.92-6.38-1.38-.88-.19-1.77-.36-2.65-.53-2.17-.43-5.48-1.1-10.33-2.18.59 1 1.15 1.99 1.71 2.99z"/><linearGradient id="k" gradientUnits="userSpaceOnUse" x1="310.435" y1="267.809" x2="329.558" y2="250.104" gradientTransform="rotate(-2.206 331.823 -363.917)"><stop offset="0" style="stop-color:#9d674f"/><stop offset="1" style="stop-color:#9d674f;stop-opacity:0"/></linearGradient><path opacity=".72" fill="url(#k)" d="M322.76 251.05c3.76 4.11 7.65 6.03 8.91 6.62 3.28 1.53 6.54 3.08 10.31 2.44 7.84-1.33 11.07-9.92 11.23-10.36 1.03 3.6 2.76 9.11 5.43 15.68 3.65 8.98 4.57 8.86 5.33 12.72.19.99.45 1.86.36 2.99-.38 4.88-5.54 8.02-7.49 9.09.63-1.51 1.25-3.01 1.88-4.52a1351.628 1351.628 0 0 0-8.55-19.39c-2.18.13-4.76.07-7.62-.41-3.85-.65-6.62-1.81-7.44-2.16-.84-.36-3.2-1.43-5.91-3.37-.48-.34-2.26-1.64-4.3-3.68-.41-.41-2.22-2.24-3.93-4.64-.74-1.04-1.26-1.91-1.39-2.14-.29-.48-.68-1.14-1.11-2.04-.31-.64-.68-1.42-1.01-2.48-.07-.22-.4-1.27-.56-2.65-.07-.64-.08-1.11.08-1.63.14-.44.35-.77.5-.97.92.12 1.89.22 2.9.29 1.35.09 2.62.13 3.81.12-.48.11-1.16.25-1.99.37-3.11.43-4.07-.12-4.56.4-1.08 1.15 1.8 6.1 5.12 9.72z"/><path opacity=".15" fill="#915F49" d="M290 308.63c1.32-5.53.83-9.91.31-12.49-.62-3.12-1.19-5.75-3.51-7.62-2.85-2.3-6.45-1.9-7.63-1.79-6.21.59-9.63 5.79-10.1 6.54 1.66-4.74 4.69-11.13 10.38-17.01a45.92 45.92 0 0 1 4.47-4.03c.54 1.63 1.08 3.26 1.61 4.9.72 2.18 2.01 6.09 2.07 6.29 1.18 3.58 1.61 4.92 2.89 8.81.71 2.17 1.74 5.3 3.02 9.14-.29 1.17-.77 2.63-1.57 4.2-.63 1.23-1.32 2.25-1.94 3.06z"/><path fill="#9D674F" d="M290.55 292.37a34.495 34.495 0 0 0-5.85-9.44 34.324 34.324 0 0 0-6.26-5.61c.8-.87 1.69-1.78 2.69-2.7.96-.89 1.9-1.68 2.79-2.38.02.05 2.94 8.93 2.96 8.98.02.06 3.64 11.07 3.67 11.15z"/><linearGradient id="l" gradientUnits="userSpaceOnUse" x1="260.8" y1="325.105" x2="255.225" y2="319.53" gradientTransform="rotate(-2.206 331.823 -363.917)"><stop offset="0" style="stop-color:#d18969;stop-opacity:0"/><stop offset="1" style="stop-color:#9d674f"/></linearGradient><path fill="url(#l)" d="M276.66 337.13a80.268 80.268 0 0 0-3.09 5.11c.45-1.81 1.25-4.47 2.69-7.47 1.38-2.89 2.44-4.02 7.31-10.84 3.67-5.13 5.15-7.1 8.03-11.27 1.63-2.37 2.94-4.32 3.78-5.59.39 1.19.78 2.38 1.18 3.57-2.17 3-4.34 6-6.52 9-3.57 4.7-6.51 8.38-8.54 10.87-1.7 2.11-3.09 3.97-4.84 6.62z"/><path fill="#9D674F" d="M303.29 331.05c-1.12-2.82-3.35-7.28-7.72-11.29a29.841 29.841 0 0 0-5.94-4.24c1.11-1.59 2.22-3.2 3.32-4.83.82-1.21 1.63-2.42 2.44-3.62l3.06 9.3c1.62 4.9 3.23 9.79 4.84 14.68z"/><linearGradient id="m" gradientUnits="userSpaceOnUse" x1="267.011" y1="333.092" x2="278.079" y2="333.092" gradientTransform="rotate(-2.206 331.823 -363.917)"><stop offset="0" style="stop-color:#9d674f;stop-opacity:0"/><stop offset="1" style="stop-color:#9d674f"/></linearGradient><path fill="url(#m)" d="M305.01 336.28c-1.26-.57-3.17-1.29-5.56-1.63-3.22-.47-5.56-.02-5.59-.26-.03-.26 2.63-1 5.63-1.16 1.91-.1 3.5.06 4.59.22"/><linearGradient id="n" gradientUnits="userSpaceOnUse" x1="263.471" y1="364.303" x2="257.453" y2="358.284" gradientTransform="rotate(-2.206 331.823 -363.917)"><stop offset="0" style="stop-color:#d18969;stop-opacity:0"/><stop offset="1" style="stop-color:#9d674f"/></linearGradient><path fill="url(#n)" d="M294.53 363.19c-.64-.28-3.79-1.59-5.84-.04-.26.2-.43.4-.73.75a8.761 8.761 0 0 0-1.76 3.5c-.07-.64-.11-1.32-.13-2.03-.06-2.32.18-4.4.53-6.16.69.35 1.38.7 2.06 1.04 1.96 1 3.92 1.97 5.87 2.94z"/><path fill="#34221A" d="M322.56 389.56c-.78.02-1.63.07-2.55.18-1.06.13-2.02.31-2.88.52-.06.02 1.42-.27 2.79-1.22a6.81 6.81 0 0 0 1.83-1.91c0 .01.38 1.15.38 1.16.01.01.42 1.26.43 1.27z"/><path opacity=".06" fill="#E3B8A5" d="M395.01 275.25c.3-.03.79-.11 1.52-.05 1.03.09 1.77.41 2.74.85 1.84.84 2.76 1.26 3.39 1.61 2.37 1.33 4.04 2.68 4.61 3.15.71.6 3.93 3.34 6.7 8.11 2.46 4.23 3.34 7.92 3.85 10.18.31 1.37 1.36 6.26.89 12.3-.18 2.34-.56 4.54-.75 5.58-.54 3.08-1.04 3.89-1.34 5.96-.23 1.6-.38 3.98.19 7.04 2.79 11.7 7.2 25.63 14.36 40.58a200.8 200.8 0 0 0 13.23 23.43c-4.44-2.26-7.1-4.88-8.69-6.8-3.81-4.6-3.77-7.97-8.69-14.17-2.59-3.26-3.92-4.9-6.05-5.48-5.42-1.49-11.2 3.83-13.61 6.05-2.51 2.32-4.27 3.93-4.96 6.71-1.19 4.78 1.59 9.64 2.8 11.76 2.05 3.57 4.37 5.5 3.81 6.24-.44.59-2.36 0-3.69-.71-2.77-1.48-3.02-3.5-5.81-6.8-1.26-1.49-3-3.54-5.61-4.8-2.83-1.36-4.97-.95-8.28-1.01-5.33-.1-10.53-.19-14.33-3.14-4.14-3.22-6.14-9.47-7.87-14.88-.57-1.79-2.01-6.49-3.98-19.78-1.52-10.24-2.28-15.36-2.26-21.14.01-2.49.07-9.78 1.78-18.4.56-2.85 1.86-8.64 2.91-13.1.47-1.98.75-3.13 1.32-5.61 1.77-7.78 1.5-7.49 1.85-8.19 2.03-4.04 6.98-5.17 15.06-7.26.85-.22 4.93-1.24 9.86-.55 1.2.17 2.92 2.51 5.05 2.32z"/><path opacity=".15" fill="#E3B8A5" d="M390.64 404.33a11 11 0 0 1 3.45 1.29c2.3 1.35 3.65 3.34 6.32 9.54 1.97 4.58 2.77 7.05 5.03 12.71.96 2.4 1.77 4.35 2.29 5.58l-1.2 6.18c-1.86-5.66-3.5-10.43-4.78-14.08-2.06-5.89-2.65-7.39-3.37-8.95a54.57 54.57 0 0 0-7.74-12.27z"/><path opacity=".54" fill="#9D674F" d="M390.71 404.52c.84.97 1.95 2.34 3.15 4.07 1.14 1.64 2.92 4.41 5.01 9.09 1.48 3.32 1.97 5.01 4.8 13.38 1.25 3.71 2.27 6.69 2.89 8.48-.43 2.47-.83 5.04-1.17 7.72-.27 2.12-.5 4.19-.69 6.2 0-.4-.01-.96-.04-1.64-.09-2.23-.29-3.87-.34-4.24-.08-.66-.21-1.53-.4-2.55-.3-.2-.74-.49-1.25-.89-1.21-.94-1.97-1.77-2.31-2.13-.75-.79-1.93-1.87-3.75-3.07.96-2.63 1.38-4.92 1.57-6.56.25-2.14.47-4.18-.22-6.28-.1-.3-.23-.65-.59-1.72-.58-1.73-.98-3.02-1.11-3.45-.39-1.26-1.05-3.32-2.24-6.79-.46-1.37-.88-2.62-1.27-3.74-.33-.97-.73-2.13-1.19-3.44-.32-.94-.61-1.77-.85-2.44z"/><path opacity=".58" fill="#34221A" d="M318.43 252.99c.69.42 1.37.84 2.06 1.26 1.35 1.95 3.16 4.22 5.52 6.52 2.69 2.61 5.34 4.51 7.54 5.87.49-.13 1.21-.23 2 0 1.36.4 2.59 1.7 2.51 2.9-.02.33-.13.43-.19.68-.36 1.68 3.16 3.82 3.6 4.09 5.55 3.48 7.16 15.03 7.23 15.99.51 6.7-1.83 9.99-3.71 16.6-3.08 10.83-1.85 19.76-.33 30.84 1.14 8.31 2.63 19.1 9.52 31.03 7.2 12.48 17.3 20.24 17.43 20.12.07-.06-2.4-2.45-5.67-6.97-1.68-2.32-4.83-6.94-7.79-13.36a85.8 85.8 0 0 1-3.57-9.16c-.43-1.34-1.69-5.32-2.74-10.69-.91-4.65-1.24-8.22-1.43-10.38-.53-5.86-.48-10.38-.45-11.85.12-6.34.83-11.02 1.71-16.9.52-3.46.93-5.45 1.28-7.02.78-3.41 1.65-6.24 2.35-8.3-.02-.05-2.02-6.12-2.03-6.17-.01-.05-3.33-10.12-3.37-10.24-.03-.08-3.77-11.44-3.79-11.52-4.18-.43-7.39-1.21-9.14-1.84-1.38-.49-2.67-1.09-2.67-1.09-.31-.14-1.15-.54-2.15-1.1-3.07-1.73-5.25-3.7-6.07-4.45a38.68 38.68 0 0 1-2.3-2.3c-.02-.02-.42-.46-.8-.91-1.36-1.59-2.54-3.34-3.22-4.4-.15.07-.95.44-1.28 1.34-.23.64-.11 1.2-.05 1.41z"/><path fill="#34221A" d="M346.12 266.31a33.774 33.774 0 0 0 4.03 0c2.88 6.48 5.75 12.96 8.63 19.44a83.456 83.456 0 0 0-3.47 8.48c-3.06-9.3-6.13-18.61-9.19-27.92z"/><path opacity=".31" fill="#9D674F" d="M394.67 274.61c.87.99 1.9 2.48 2.41 4.46.68 2.65.05 4.78.27 4.81.23.04 1.15-2.25.85-4.86-.11-1-.36-3.1-1.95-4.01-.58-.32-1.17-.39-1.58-.4z"/><linearGradient id="o" gradientUnits="userSpaceOnUse" x1="307.26" y1="242.386" x2="327.264" y2="237.026" gradientTransform="rotate(-2.206 331.823 -363.917)"><stop offset="0" style="stop-color:#9d674f;stop-opacity:0"/><stop offset="1" style="stop-color:#9d674f"/></linearGradient><path opacity=".85" fill="url(#o)" d="M350.1 235.78c-3.57.84-5.98 1.85-7.55 2.65-.82.41-2.98 1.5-5.91 2.03-.48.09-.89.12-1.1.14a18 18 0 0 1-5.76-.39c1.74 1.88 4.29 4.02 7.02 3.65 2.06-.28 3.02-1.88 5.8-4.01 2.7-2.06 5.37-3.3 7.5-4.07z"/><linearGradient id="p" gradientUnits="userSpaceOnUse" x1="434.729" y1="377.769" x2="437.16" y2="376.365"><stop offset="0" style="stop-color:#9d674f"/><stop offset="1" style="stop-color:#d18969;stop-opacity:0"/></linearGradient><path fill="url(#p)" d="M444.11 393.54c-1.06-1.66-2.41-3.82-3.93-6.37-3.47-5.84-5.85-10.41-6.57-11.81-2.01-3.9-4.32-8.69-6.68-14.28 1.19 1.25 2.9 3.18 4.63 5.76 1.76 2.61 2.57 4.44 4.82 8.93 1.04 2.09 2.57 5.1 4.51 8.76.66 1.15 1.87 3.23 2.67 6.26.3 1.13.46 2.09.55 2.75z"/><image overflow="visible" opacity=".64" width="12" height="19" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAATCAYAAACk9eypAAAACXBIWXMAAAsSAAALEgHS3X78AAAA GXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAf1JREFUeNqMk0trE1EYhs9tZjLT JG2oxjRVSuulNlbajSjiShAR3LsV3HhZWN3YTcGV2FW7qHTR31DoryhtaemNIKi0IiimAeOYmGZu 5/jOJIJjp9CPmfmGOe9zvtsZQmDb008u4T5HTmB0d2aioGV7x6Rz+N2r13aYbuhXX8w6xwGM6WYh fBFW5oLZN3BP+b7amn6sHQcInrIK2LWfMi64YfamB0uFw8qXRazZyRE0oyLM9JlQHKYIcMgqDl1D TblEwKv/+NQRWlSIHOW8i3Jxt2f0xq33C69HjgBQMgj24ExEy1ChWYCylJBhNMJGJCMGlJ6+sbGw QTWdR5EI5ZRSg1A2gnpKxqnixRjQbm507UGoAxFIjyOijj7cJkS1dmdf9sSA8w+ef1BKrbdJGn1T kcmi1Tc4KrqyIh4BNnD/4TJ2XeuIAzxkm5Lj8OFpoDEgNBn4K1j8TaCFD6D2iJT5FOoYezWvjgBu rfoVwk0IHUWUD/EvJYMmMh0vz012d8qN2+elhZto8x2kkgEAJx1Ajea3/bnAaTrsf6C+X16XvreK M9WCr4URVOBXtWyunwmN0aTxl99N5lOnz15HLXkASM5zA9f5ePnR1ApLAq48e3vg1iqrXsPGUFs2 xAcS6STW8K9hYGkcyhLq+CndVkN6TvUkP1k0g79z+CPAAGhT63EBfC2tAAAAAElFTkSuQmCC" transform="translate(384 358)"/><image overflow="visible" opacity=".64" width="6" height="9" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAJCAYAAAARml2dAAAACXBIWXMAAAsSAAALEgHS3X78AAAA GXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAK9JREFUeNpiZICCi52ZzJwScsHf Xzw6oF8+/RUTTIJPzbCWlUdAhZmT58/Frmw2FpDg/XUzNZjZ2KX/////8f+/vz/+///7H6yDmZMr lYGJmZ2RifkbEwurgEH5jN9MN+Y2if//+4+H4f+/f9+e3Z/75+snIZBiFlZeQeN/v3+8A6p+9+/X 9/dAix+CJJh+f/7w78/Xz3cU/FO6///7z8iA5Ew1EH2hI5OVgRgAEGAAPvpHa++8HTwAAAAASUVO RK5CYII=" transform="translate(274 295)"/><linearGradient id="q" gradientUnits="userSpaceOnUse" x1="274.989" y1="391.155" x2="274.989" y2="385.82" gradientTransform="rotate(-2.206 331.823 -363.917)"><stop offset="0" style="stop-color:#d18969;stop-opacity:0"/><stop offset="1" style="stop-color:#9d674f"/></linearGradient><path fill="url(#q)" d="M301.97 387.53a32.136 32.136 0 0 0-3.08 5.46 9.57 9.57 0 0 1 3.42-2.43c3.16-1.3 6.05-.44 6.9-.15a47.49 47.49 0 0 1-4.83-1.77c-.84-.36-1.65-.73-2.41-1.11z"/><g opacity=".65"><path fill="#11465D" d="m604.38 312.45-1.97-.48-.34-8.71 1.97.48zm-.67-17.43-1.98-.48-.33-8.71 1.97.48z"/><path fill="#1C7499" d="m61.09 336.62-1.97-.48 542.61-41.6 1.98.48z"/><path fill="#1E7EA6" d="m24.26 343.82-1.97-.48 36.49-15.91 1.97.48z"/><path fill="#0E3A4D" d="m61.76 354.06-1.97-.49-37.5-10.23 1.97.48z"/><path fill="#1D789F" d="m640.88 296.55-36.5 15.9-.34-8.71-542.61 41.6.33 8.72-37.5-10.24 36.49-15.91.34 8.71 542.62-41.6-.34-8.71z"/><path fill="#196788" d="M286.45 140.29v5.37l-8.71.33-.01-5.36zm-17.44.67.01 5.37-8.72.33v-5.36z"/><path fill="#0E3B4E" d="M385.46 494.53v5.36L269.02 146.33l-.01-5.37z"/><path fill="#11475E" d="m394.21 507.69.01 5.37-17.47-12.83v-5.37z"/><path fill="#0F3E52" d="M402.89 493.85v5.37l-8.67 13.84-.01-5.37z"/><path fill="#2497C7" d="m268.99 127.46 17.46 12.83-8.72.34 116.45 353.56 8.71-.34-8.68 13.84-17.46-12.83 8.71-.33-116.45-353.57-8.71.34zm67.4 465.39-.64-1.93 8.71-.34.64 1.93zm-17.43.67-.64-1.93 8.71-.34.64 1.93z"/><path fill="#0E3B4E" d="m327.67 593.18-.64-1.93-.25-544.21.64 1.93z"/><path fill="#0F4054" d="m331.76 11.69-.63-1.93 13.08 36.61.64 1.93z"/><path fill="#124B63" d="m318.7 49.31-.63-1.93 13.06-37.62.63 1.93z"/><path fill="#196788" d="m331.76 11.69 13.09 36.61-8.71.34.25 544.21 8.71-.34-13.05 37.61-13.09-36.6 8.71-.34-.25-544.21-8.72.34z"/></g><radialGradient id="r" cx="331.5" cy="319.5" r="13.5" gradientUnits="userSpaceOnUse"><stop offset=".316" style="stop-color:#0f374a"/><stop offset="1" style="stop-color:#670e2f;stop-opacity:0"/></radialGradient><circle fill="url(#r)" cx="331.5" cy="319.5" r="13.5"/><path d="M355.5 69.53v-4.46h-3.69v-3.08h3.69v-4.46h2.46v4.46h3.7v3.08h-3.7v4.46h-2.46zM367.63 72v-7.23l-5.16-9.95h3.33l3.31 6.79 3.26-6.79h3.27l-5.18 9.97V72h-2.83zm50.87 447.53v-4.46h-3.69v-3.08h3.69v-4.46h2.46v4.46h3.7v3.08h-3.7v4.46h-2.46zm7.21 2.47v-3.14l7.4-11.13h-6.57v-2.91h10.31v2.7l-7.71 11.58h8.01v2.9h-11.44zM571.5 276.53v-4.46h-3.69v-3.08h3.69v-4.46h2.46v4.46h3.7v3.08h-3.7v4.46h-2.46zm7.01 2.47 4.87-8.94-4.42-8.24h3.32l2.79 5.14 2.81-5.14h3.29l-4.42 8.22 4.87 8.96h-3.43l-3.13-5.82-3.13 5.82h-3.42z" fill="#B5004E"/><path fill="#F5FF45" d="M326.28 326v-15.03h2.42l5.04 10.04v-10.04h2.32V326h-2.5l-4.96-9.8v9.8h-2.32z"/><path fill="#990042" d="M27 96V39c0-1.65 1.35-3 3-3h3c1.65 0 3 1.35 3 3v57c0 1.65-1.35 3-3 3h-3c-1.65 0-3-1.35-3-3z"/><path d="M46.02 72.5h3.45l2.67 10.47h.05V72.5h2.45V90h-2.82l-3.3-12.78h-.05V90h-2.45V72.5zm10.68 5.33h2.65v2.65H56.7v-2.65zm0 9.52h2.65V90H56.7v-2.65zm8.7-14.85h3.45l2.67 10.47h.05V72.5h2.45V90H71.2l-3.3-12.78h-.05V90H65.4V72.5zm12.8 0h3.73L84.77 90h-2.75l-.5-3.47v.05H78.4L77.9 90h-2.55l2.85-17.5zm3 11.7-1.23-8.65h-.05l-1.2 8.65h2.48zm5.9-9.2h-2.88v-2.5h8.5V75h-2.88v15H87.1V75zm6.95-2.5h2.75V90h-2.75V72.5zm4.07 0h2.78l1.8 13.58h.05l1.8-13.58h2.52L104.42 90h-3.65l-2.65-17.5zm10.28 0h7.5V75h-4.75v4.63h3.77v2.5h-3.77v5.38h4.75V90h-7.5V72.5zm13.95 16.6c-.72-.77-1.07-1.85-1.07-3.25v-9.2c0-1.4.36-2.48 1.07-3.25.72-.77 1.75-1.15 3.1-1.15s2.38.38 3.1 1.15c.72.77 1.07 1.85 1.07 3.25v9.2c0 1.4-.36 2.48-1.07 3.25-.72.77-1.75 1.15-3.1 1.15s-2.39-.38-3.1-1.15zm4.52-3.07v-9.55c0-1.15-.47-1.72-1.42-1.72s-1.42.58-1.42 1.72v9.55c0 1.15.47 1.72 1.42 1.72s1.42-.58 1.42-1.72zm4.6-13.53h4.08c1.42 0 2.45.33 3.1.99.65.66.97 1.67.97 3.04v1.07c0 1.82-.6 2.97-1.8 3.45v.05c.67.2 1.14.61 1.41 1.23s.41 1.44.41 2.47v3.08c0 .5.02.9.05 1.21.03.31.12.61.25.91h-2.8c-.1-.28-.17-.55-.2-.8s-.05-.7-.05-1.35v-3.2c0-.8-.13-1.36-.39-1.68-.26-.32-.7-.47-1.34-.47h-.95V90h-2.75V72.5zm3.75 7.5c.55 0 .96-.14 1.24-.42.27-.28.41-.76.41-1.42V76.8c0-.63-.11-1.09-.34-1.38-.23-.28-.58-.42-1.06-.42h-1.25v5h1zm6.33-7.5h2.75V90h-2.75V72.5zm5.65 16.61c-.7-.76-1.05-1.85-1.05-3.26v-9.2c0-1.42.35-2.5 1.05-3.26s1.72-1.14 3.05-1.14 2.35.38 3.05 1.14c.7.76 1.05 1.85 1.05 3.26v1.5h-2.6v-1.68c0-1.15-.47-1.72-1.42-1.72s-1.42.58-1.42 1.72v9.58c0 1.13.47 1.7 1.42 1.7s1.42-.57 1.42-1.7v-3.42h-1.38v-2.5h3.98v5.72c0 1.42-.35 2.5-1.05 3.26-.7.76-1.72 1.14-3.05 1.14s-2.35-.38-3.05-1.14zm8.92-16.61h2.75V90h-2.75V72.5zm4.8 0h3.45l2.67 10.47h.05V72.5h2.45V90h-2.82l-3.3-12.78h-.05V90h-2.45V72.5zM46.98 62.11c-.7-.76-1.05-1.85-1.05-3.26V45.5h2.75v13.55c0 .6.12 1.03.36 1.3s.59.4 1.04.4c.45 0 .8-.13 1.04-.4s.36-.7.36-1.3V45.5h2.65v13.35c0 1.42-.35 2.5-1.05 3.26-.7.76-1.72 1.14-3.05 1.14s-2.36-.38-3.05-1.14zm9.65 0c-.68-.76-1.03-1.85-1.03-3.26v-1h2.6v1.2c0 1.13.48 1.7 1.43 1.7.47 0 .82-.14 1.06-.41.24-.28.36-.72.36-1.34 0-.73-.17-1.38-.5-1.94-.33-.56-.95-1.23-1.85-2.01-1.13-1-1.92-1.9-2.38-2.71-.45-.81-.67-1.72-.67-2.74 0-1.38.35-2.45 1.05-3.21.7-.76 1.72-1.14 3.05-1.14 1.32 0 2.31.38 2.99 1.14s1.01 1.85 1.01 3.26v.72h-2.6v-.9c0-.6-.12-1.04-.35-1.31-.23-.27-.58-.41-1.02-.41-.92 0-1.38.56-1.38 1.67 0 .63.17 1.23.51 1.78s.96 1.22 1.86 2c1.15 1 1.94 1.91 2.38 2.72.43.82.65 1.78.65 2.88 0 1.43-.35 2.53-1.06 3.3-.71.77-1.74 1.15-3.09 1.15-1.33 0-2.34-.38-3.02-1.14zm8.74-16.61h7.5V48h-4.75v4.63h3.77v2.5h-3.77v5.38h4.75V63h-7.5V45.5zm9.08 0h4.08c1.42 0 2.45.33 3.1.99.65.66.97 1.67.97 3.04v1.07c0 1.82-.6 2.97-1.8 3.45v.05c.67.2 1.14.61 1.41 1.23s.41 1.44.41 2.47v3.08c0 .5.02.9.05 1.21.03.31.12.61.25.91h-2.8c-.1-.28-.17-.55-.2-.8s-.05-.7-.05-1.35v-3.2c0-.8-.13-1.36-.39-1.68-.26-.32-.7-.47-1.34-.47h-.94V63h-2.75V45.5zM78.2 53c.55 0 .96-.14 1.24-.42.27-.28.41-.76.41-1.42V49.8c0-.63-.11-1.09-.34-1.38-.22-.28-.58-.42-1.06-.42H77.2v5h1zm7.22-4.85h-.9V45.5h2.65v2.38l-1.52 3.28h-1.27l1.04-3.01zm4.35 13.96c-.68-.76-1.03-1.85-1.03-3.26v-1h2.6v1.2c0 1.13.48 1.7 1.43 1.7.47 0 .82-.14 1.06-.41.24-.28.36-.72.36-1.34 0-.73-.17-1.38-.5-1.94-.33-.56-.95-1.23-1.85-2.01-1.13-1-1.92-1.9-2.38-2.71-.45-.81-.67-1.72-.67-2.74 0-1.38.35-2.45 1.05-3.21.7-.76 1.72-1.14 3.05-1.14 1.32 0 2.31.38 2.99 1.14s1.01 1.85 1.01 3.26v.72h-2.6v-.9c0-.6-.12-1.04-.35-1.31-.23-.27-.58-.41-1.02-.41-.92 0-1.38.56-1.38 1.67 0 .63.17 1.23.51 1.78s.96 1.22 1.86 2c1.15 1 1.94 1.91 2.38 2.72.43.82.65 1.78.65 2.88 0 1.43-.35 2.53-1.06 3.3-.71.77-1.74 1.15-3.09 1.15-1.32 0-2.33-.38-3.02-1.14zm12.75-16.61h4.08c1.42 0 2.45.33 3.1.99.65.66.97 1.67.97 3.04v1.07c0 1.82-.6 2.97-1.8 3.45v.05c.67.2 1.14.61 1.41 1.23s.41 1.44.41 2.47v3.08c0 .5.02.9.05 1.21.03.31.12.61.25.91h-2.8c-.1-.28-.17-.55-.2-.8s-.05-.7-.05-1.35v-3.2c0-.8-.13-1.36-.39-1.68-.26-.32-.7-.47-1.34-.47h-.95V63h-2.75V45.5zm3.75 7.5c.55 0 .96-.14 1.24-.42.27-.28.41-.76.41-1.42V49.8c0-.63-.11-1.09-.34-1.38-.23-.28-.58-.42-1.06-.42h-1.25v5h1zm6.33-7.5h2.75V63h-2.75V45.5zm5.65 16.61c-.7-.76-1.05-1.85-1.05-3.26v-9.2c0-1.42.35-2.5 1.05-3.26s1.72-1.14 3.05-1.14 2.35.38 3.05 1.14c.7.76 1.05 1.85 1.05 3.26v1.5h-2.6v-1.68c0-1.15-.47-1.72-1.42-1.72s-1.42.58-1.42 1.72v9.58c0 1.13.47 1.7 1.42 1.7s1.42-.57 1.42-1.7v-3.42h-1.38v-2.5h3.98v5.72c0 1.42-.35 2.5-1.05 3.26-.7.76-1.72 1.14-3.05 1.14s-2.35-.38-3.05-1.14zm8.92-16.61h2.75v7.13h2.95V45.5h2.75V63h-2.75v-7.88h-2.95V63h-2.75V45.5zm12.65 2.5h-2.88v-2.5h8.5V48h-2.88v15h-2.75V48zm10.95-2.5h2.75v7.13h2.95V45.5h2.75V63h-2.75v-7.88h-2.95V63h-2.75V45.5zm12.63 0h3.73l2.85 17.5h-2.75l-.5-3.47v.05h-3.13l-.5 3.42h-2.55l2.85-17.5zm3 11.7-1.23-8.65h-.05l-1.2 8.65h2.48zm4.9-11.7h3.45l2.67 10.47h.05V45.5h2.45V63h-2.82l-3.3-12.78h-.05V63h-2.45V45.5zm10.67 0h4.2c1.37 0 2.39.37 3.07 1.1.68.73 1.03 1.81 1.03 3.23v8.85c0 1.42-.34 2.49-1.03 3.23s-1.71 1.1-3.07 1.1h-4.2V45.5zm4.15 15c.45 0 .8-.13 1.04-.4s.36-.7.36-1.3v-9.1c0-.6-.12-1.03-.36-1.3s-.59-.4-1.04-.4h-1.4v12.5h1.4z" fill="#333"/></g></switch></svg> | 0 |
data/mdn-content/files/en-us/web/api/xrinputsource | data/mdn-content/files/en-us/web/api/xrinputsource/handedness/index.md | ---
title: "XRInputSource: handedness property"
short-title: handedness
slug: Web/API/XRInputSource/handedness
page-type: web-api-instance-property
browser-compat: api.XRInputSource.handedness
---
{{APIRef("WebXR Device API")}}{{SecureContext_Header}}
The read-only {{domxref("XRInputSource")}} property
**`handedness`** indicates which of the user's hands the WebXR
input source is associated with, or if it's not associated with a hand at all.
## Value
A string indicating whether the input controller is held in one of
the user's hands, and if it is, which hand. The value is one of the following:
- `none`
- : The input controller is not associated with one of the user's hands.
- `left`
- : The input controller is being held in, worn on, or is attached to the user's left hand.
- `right`
- : The input controller is being held in, worn on, or is attached to the user's right hand.
## Usage notes
If the input source is not a device associated with a user's hand (whether by being
held, attached, or worn), the value of `handedness` is `none`.
This may indicate, for example, an input source which isn't hand-held, such as controls
built into a headset or an input device attached to the head or body.
## Examples
One important usage scenario for `handedness` is to determine which hand a controller is in so you can draw a representation of that hand (or the device that hand is controlling) in virtual space.
```js
function updateInputSources(session, frame, refSpace) {
for (const source of session.inputSources) {
if (source.gripSpace) {
const gripPose = frame.getPose(source.gripSpace, refSpace);
if (gripPose) {
myRenderHandObject(gripPose, inputSource.handedness);
}
}
}
}
```
This function, which would be called every animation frame (or possibly just periodically, depending on the degree of smoothness required and any performance constraints), scans the list of input sources looking for any which have a {{domxref("XRInputSource.gripSpace", "gripSpace")}} which isn't `null`. If a `gripSpace` is present, that means the input source is a hand-held device of some sort, so it should be rendered visibly if possible.
If `gripSpace` is non-`null`, the function proceeds to get the pose for the `gripSpace` transformed into the current reference space. Assuming that's then valid, a function called `myRenderHandObject()` is called with the grip's pose and the value of `handedness`. It then draws the appropriate model positioned and formed for the correct hand.
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- [WebXR Device API](/en-US/docs/Web/API/WebXR_Device_API)
- [Inputs and input sources](/en-US/docs/Web/API/WebXR_Device_API/Inputs)
- [Using gamepads in WebXR applications](/en-US/docs/Web/WebXR%20Device%20API/Gamepads)
| 0 |
data/mdn-content/files/en-us/web/api | data/mdn-content/files/en-us/web/api/imagetrack/index.md | ---
title: ImageTrack
slug: Web/API/ImageTrack
page-type: web-api-interface
status:
- experimental
browser-compat: api.ImageTrack
---
{{APIRef("WebCodecs API")}}{{SeeCompatTable}}
The **`ImageTrack`** interface of the {{domxref('WebCodecs API','','','true')}} represents an individual image track.
{{InheritanceDiagram}}
## Instance properties
- {{domxref("ImageTrack.animated")}} {{ReadOnlyInline}} {{Experimental_Inline}}
- : Returns a {{jsxref("boolean")}} indicating whether the track is animated and therefore has multiple frames.
- {{domxref("ImageTrack.frameCount")}} {{ReadOnlyInline}} {{Experimental_Inline}}
- : Returns an integer indicating the number of frames in the track.
- {{domxref("ImageTrack.repetitionCount")}} {{ReadOnlyInline}} {{Experimental_Inline}}
- : Returns an integer indicating the number of times that the animation repeats.
- {{domxref("ImageTrack.selected")}} {{ReadOnlyInline}} {{Experimental_Inline}}
- : Returns a {{jsxref("boolean")}} indicating whether the track is selected for decoding.
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api/imagetrack | data/mdn-content/files/en-us/web/api/imagetrack/selected/index.md | ---
title: "ImageTrack: selected property"
short-title: selected
slug: Web/API/ImageTrack/selected
page-type: web-api-instance-property
status:
- experimental
browser-compat: api.ImageTrack.selected
---
{{APIRef("WebCodecs API")}}{{SeeCompatTable}}
The **`selected`** property of the {{domxref("ImageTrack")}} interface returns `true` if the track is selected for decoding.
## Value
A {{jsxref("boolean")}}, if `true` the track is selected for decoding.
## Examples
The following example prints the value of `selected` to the console.
```js
let track = imageDecoder.tracks.selectedTrack;
console.log(track.selected); // this is the selected track so should return true.
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api/imagetrack | data/mdn-content/files/en-us/web/api/imagetrack/repetitioncount/index.md | ---
title: "ImageTrack: repetitionCount property"
short-title: repetitionCount
slug: Web/API/ImageTrack/repetitionCount
page-type: web-api-instance-property
status:
- experimental
browser-compat: api.ImageTrack.repetitionCount
---
{{APIRef("WebCodecs API")}}{{SeeCompatTable}}
The **`repetitionCount`** property of the {{domxref("ImageTrack")}} interface returns the number of repetitions of this track.
## Value
An integer.
## Examples
The following example prints the value of `repetitionCount` to the console.
```js
let track = imageDecoder.tracks.selectedTrack;
console.log(track.repetitionCount);
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api/imagetrack | data/mdn-content/files/en-us/web/api/imagetrack/framecount/index.md | ---
title: "ImageTrack: frameCount property"
short-title: frameCount
slug: Web/API/ImageTrack/frameCount
page-type: web-api-instance-property
status:
- experimental
browser-compat: api.ImageTrack.frameCount
---
{{APIRef("WebCodecs API")}}{{SeeCompatTable}}
The **`frameCount`** property of the {{domxref("ImageTrack")}} interface returns the number of frames in the track.
## Value
An integer.
## Examples
The following example prints the value of `frameCount` to the console.
```js
let track = imageDecoder.tracks.selectedTrack;
console.log(track.frameCount);
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api/imagetrack | data/mdn-content/files/en-us/web/api/imagetrack/animated/index.md | ---
title: "ImageTrack: animated property"
short-title: animated
slug: Web/API/ImageTrack/animated
page-type: web-api-instance-property
status:
- experimental
browser-compat: api.ImageTrack.animated
---
{{APIRef("WebCodecs API")}}{{SeeCompatTable}}
The **`animated`** property of the {{domxref("ImageTrack")}} interface returns `true` if the track is animated and therefore has multiple frames.
## Value
A {{jsxref("boolean")}}, if `true` this is an animated track.
## Examples
The following example prints the value of `animated` to the console.
```js
let track = imageDecoder.tracks.selectedTrack;
console.log(track.animated);
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api | data/mdn-content/files/en-us/web/api/htmltablecellelement/index.md | ---
title: HTMLTableCellElement
slug: Web/API/HTMLTableCellElement
page-type: web-api-interface
browser-compat: api.HTMLTableCellElement
---
{{ APIRef("HTML DOM") }}
The **`HTMLTableCellElement`** interface provides special properties and methods (beyond the regular {{domxref("HTMLElement")}} interface it also has available to it by inheritance) for manipulating the layout and presentation of table cells, either header cells ({{HTMLElement("th")}})) or data cells ({{HTMLElement("td")}}), in an HTML document.
{{InheritanceDiagram}}
## Instance properties
_Inherits properties from its parent, {{domxref("HTMLElement")}}._
- {{domxref("HTMLTableCellElement.abbr")}}
- : A string which can be used on `<th>` elements (not on {{HTMLElement("td")}}), specifying an alternative label for the header cell. This alternate label can be used in other contexts, such as when describing the headers that apply to a data cell. This is used to offer a shorter term for use by screen readers in particular, and is a valuable accessibility tool. Usually the value of `abbr` is an abbreviation or acronym, but can be any text that's appropriate contextually.
- {{domxref("HTMLTableCellElement.cellIndex")}} {{ReadOnlyInline}}
- : A long integer representing the cell's position in the {{domxref("HTMLTableRowElement.cells", "cells")}} collection of the {{HTMLElement("tr")}} the cell is contained within. If the cell doesn't belong to a `<tr>`, it returns `-1`.
- {{domxref("HTMLTableCellElement.colSpan")}}
- : An unsigned long integer indicating the number of columns this cell must span; this lets the cell occupy space across multiple columns of the table. It reflects the [`colspan`](/en-US/docs/Web/HTML/Element/td#colspan) attribute.
- {{domxref("HTMLTableCellElement.headers")}} {{ReadOnlyInline}}
- : A {{domxref("DOMTokenList")}} describing a list of `id` of {{HTMLElement("th")}} elements that represents headers associated with the cell. It reflects the [`headers`](/en-US/docs/Web/HTML/Element/td#headers) attribute.
- {{domxref("HTMLTableCellElement.rowSpan")}}
- : An unsigned long integer indicating the number of rows this cell must span; this lets a cell occupy space across multiple rows of the table. It reflects the [`rowspan`](/en-US/docs/Web/HTML/Element/td#rowspan) attribute.
- {{domxref("HTMLTableCellElement.scope")}}
- : A string indicating the scope of a {{HTMLElement("th")}} cell. Header cells can be configured, using the `scope` property, the apply to a specified row or column, or to the not-yet-scoped cells within the current row group (that is, the same ancestor {{HTMLElement("thead")}}, {{HTMLElement("tbody")}}, or {{HTMLElement("tfoot")}} element). If no value is specified for `scope`, the header is not associated directly with cells in this way. Permitted values for `scope` are:
- `col`
- : The header cell applies to the following cells in the same column (or columns, if `colspan` is used as well), until either the end of the column or another `<th>` in the column establishes a new scope.
- `colgroup`
- : The header cell applies to all cells in the current column group that do not already have a scope applied to them. This value is only allowed if the cell is in a column group.
- `row`
- : The header cell applies to the following cells in the same row (or rows, if `rowspan` is used as well), until either the end of the row or another `<th>` in the same row establishes a new scope.
- `rowgroup`
- : The header cell applies to all cells in the current row group that do not already have a scope applied to them. This value is only allowed if the cell is in a row group.
- The empty string (`""`)
- : The header cell has no predefined scope; the user agent will establish the scope based on contextual clues.
## Instance methods
_No specific method; inherits methods from its parent, {{domxref("HTMLElement")}}_.
## Deprecated properties
> **Warning:** These properties have been deprecated and should no longer be used. They are documented primarily to help understand older code bases.
- {{domxref("HTMLTableCellElement.align")}} {{deprecated_inline}}
- : A string containing an enumerated value reflecting the [`align`](/en-US/docs/Web/HTML/Element/td#align) attribute. It indicates the alignment of the element's contents with respect to the surrounding context. The possible values are `"left"`, `"right"`, and `"center"`.
- {{domxref("HTMLTableCellElement.axis")}} {{deprecated_inline}}
- : A string containing a name grouping cells in virtual. It reflects the obsolete [`axis`](/en-US/docs/Web/HTML/Element/td#axis) attribute.
- {{domxref("HTMLTableCellElement.bgColor")}} {{deprecated_inline}}
- : A string containing the background color of the cells. It reflects the obsolete [`bgColor`](/en-US/docs/Web/HTML/Element/td#bgcolor) attribute.
- {{domxref("HTMLTableCellElement.ch")}} {{deprecated_inline}}
- : A string containing one single character. This character is the one to align all the cell of a column on. It reflects the [`char`](/en-US/docs/Web/HTML/Element/td#char) and default to the decimal points associated with the language, e.g. `'.'` for English, or `','` for French. This property was optional and was not very well supported.
- {{domxref("HTMLTableCellElement.chOff")}} {{deprecated_inline}}
- : A string containing an integer indicating how many characters must be left at the right (for left-to-right scripts; or at the left for right-to-left scripts) of the character defined by `HTMLTableCellElement.ch`. This property was optional and was not very well supported.
- {{domxref("HTMLTableCellElement.height")}} {{deprecated_inline}}
- : A string containing a length of pixel of the hinted height of the cell. It reflects the obsolete [`height`](/en-US/docs/Web/HTML/Element/td#height) attribute.
- {{domxref("HTMLTableCellElement.noWrap")}} {{deprecated_inline}}
- : A boolean value reflecting the [`nowrap`](/en-US/docs/Web/HTML/Element/td#nowrap) attribute and indicating if cell content can be broken in several lines.
- {{domxref("HTMLTableCellElement.vAlign")}} {{deprecated_inline}}
- : A string representing an enumerated value indicating how the content of the cell must be vertically aligned. It reflects the [`valign`](/en-US/docs/Web/HTML/Element/td#valign) attribute and can have one of the following values: `"top"`, `"middle"`, `"bottom"`, or `"baseline"`. Use the CSS {{cssxref("vertical-align")}} property instead.
- {{domxref("HTMLTableCellElement.width")}} {{deprecated_inline}}
- : A string specifying the number of pixels wide the cell should be drawn, if possible. This property reflects the also obsolete [`width`](/en-US/docs/Web/HTML/Element/td#width) attribute. Use the CSS {{cssxref("width")}} property instead.
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- The HTML elements implementing this interface: {{HTMLElement("th")}} and {{HTMLElement("td")}}.
| 0 |
data/mdn-content/files/en-us/web/api | data/mdn-content/files/en-us/web/api/cdatasection/index.md | ---
title: CDATASection
slug: Web/API/CDATASection
page-type: web-api-interface
browser-compat: api.CDATASection
---
{{APIRef("DOM")}}
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.
{{InheritanceDiagram}}
## Instance properties
_This interface has no specific properties and implements those of its parent
{{DOMxRef("Text")}}._
## Instance methods
_This interface has no specific methods and implements those of its parent
{{DOMxRef("Text")}}._
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{domxref("Document.createCDATASection()")}}
| 0 |
data/mdn-content/files/en-us/web/api | data/mdn-content/files/en-us/web/api/headers/index.md | ---
title: Headers
slug: Web/API/Headers
page-type: web-api-interface
browser-compat: api.Headers
---
{{APIRef("Fetch API")}}
The **`Headers`** interface of the [Fetch API](/en-US/docs/Web/API/Fetch_API) allows you to perform various actions on [HTTP request and response headers](/en-US/docs/Web/HTTP/Headers). These actions include retrieving, setting, adding to, and removing headers from the list of the request's headers.
A `Headers` object has an associated header list, which is initially empty and consists of zero or more name and value pairs. You can add to this using methods like {{domxref("Headers.append","append()")}} (see [Examples](#examples).) In all methods of this interface, header names are matched by case-insensitive byte sequence.
For security reasons, some headers can only be controlled by the user agent. These headers include the {{Glossary("Forbidden_header_name", "forbidden header names")}} and {{Glossary("Forbidden_response_header_name", "forbidden response header names")}}.
A Headers object also has an associated guard, which takes a value of `immutable`, `request`, `request-no-cors`, `response`, or `none`. This affects whether the {{domxref("Headers.set","set()")}}, {{domxref("Headers.delete","delete()")}}, and {{domxref("Headers.append","append()")}} methods will mutate the header. For more information see {{Glossary("Guard")}}.
You can retrieve a `Headers` object via the {{domxref("Request.headers")}} and {{domxref("Response.headers")}} properties, and create a new `Headers` object using the {{domxref("Headers.Headers", "Headers()")}} constructor.
An object implementing `Headers` can directly be used in a {{jsxref("Statements/for...of", "for...of")}} structure, instead of {{domxref('Headers.entries()', 'entries()')}}: `for (const p of myHeaders)` is equivalent to `for (const p of myHeaders.entries())`.
> **Note:** you can find out more about the available headers by reading our [HTTP headers](/en-US/docs/Web/HTTP/Headers) reference.
{{AvailableInWorkers}}
## Constructor
- {{domxref("Headers.Headers()", "Headers()")}}
- : Creates a new `Headers` object.
## Instance methods
- {{domxref("Headers.append()")}}
- : Appends a new value onto an existing header inside a `Headers` object, or adds the header if it does not already exist.
- {{domxref("Headers.delete()")}}
- : Deletes a header from a `Headers` object.
- {{domxref("Headers.entries()")}}
- : Returns an {{jsxref("Iteration_protocols","iterator")}} allowing to go through all key/value pairs contained in this object.
- {{domxref("Headers.forEach()")}}
- : Executes a provided function once for each key/value pair in this `Headers` object.
- {{domxref("Headers.get()")}}
- : Returns a {{jsxref("String")}} sequence of all the values of a header within a `Headers` object with a given name.
- {{domxref("Headers.getSetCookie()")}}
- : Returns an array containing the values of all {{httpheader("Set-Cookie")}} headers associated with a response.
- {{domxref("Headers.has()")}}
- : Returns a boolean stating whether a `Headers` object contains a certain header.
- {{domxref("Headers.keys()")}}
- : Returns an {{jsxref("Iteration_protocols", "iterator")}} allowing you to go through all keys of the key/value pairs contained in this object.
- {{domxref("Headers.set()")}}
- : Sets a new value for an existing header inside a `Headers` object, or adds the header if it does not already exist.
- {{domxref("Headers.values()")}}
- : Returns an {{jsxref("Iteration_protocols", "iterator")}} allowing you to go through all values of the key/value pairs contained in this object.
> **Note:** To be clear, the difference between {{domxref("Headers.set()")}} and {{domxref("Headers.append()")}} is that if the specified header does already exist and does accept multiple values, {{domxref("Headers.set()")}} will overwrite the existing value with the new one, whereas {{domxref("Headers.append()")}} will append the new value onto the end of the set of values. See their dedicated pages for example code.
> **Note:** All of the Headers methods will throw a {{jsxref("TypeError")}} if you try to pass in a reference to a name that isn't a [valid HTTP Header name](https://fetch.spec.whatwg.org/#concept-header-name). The mutation operations will throw a `TypeError` if the header has an immutable {{Glossary("Guard")}}. In any other failure case they fail silently.
> **Note:** When Header values are iterated over, they are automatically sorted in lexicographical order, and values from duplicate header names are combined.
## Examples
In the following snippet, we create a new header using the `Headers()` constructor, add a new header to it using `append()`, then return that header value using `get()`:
```js
const myHeaders = new Headers();
myHeaders.append("Content-Type", "text/xml");
myHeaders.get("Content-Type"); // should return 'text/xml'
```
The same can be achieved by passing an array of arrays or an object literal to the constructor:
```js
let myHeaders = new Headers({
"Content-Type": "text/xml",
});
// or, using an array of arrays:
myHeaders = new Headers([["Content-Type", "text/xml"]]);
myHeaders.get("Content-Type"); // should return 'text/xml'
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- [ServiceWorker API](/en-US/docs/Web/API/Service_Worker_API)
- [HTTP access control (CORS)](/en-US/docs/Web/HTTP/CORS)
- [HTTP](/en-US/docs/Web/HTTP)
| 0 |
data/mdn-content/files/en-us/web/api/headers | data/mdn-content/files/en-us/web/api/headers/get/index.md | ---
title: "Headers: get() method"
short-title: get()
slug: Web/API/Headers/get
page-type: web-api-instance-method
browser-compat: api.Headers.get
---
{{APIRef("Fetch API")}}
The **`get()`** method of the {{domxref("Headers")}} interface
returns a byte string of all the values of a header within a `Headers` object
with a given name. If the requested header doesn't exist in the `Headers`
object, it returns `null`.
For security reasons, some headers can only be controlled by the user agent. These
headers include the {{Glossary("Forbidden_header_name", "forbidden header names")}}
and {{Glossary("Forbidden_response_header_name", "forbidden response header names")}}.
{{AvailableInWorkers}}
## Syntax
```js-nolint
get(name)
```
### Parameters
- `name`
- : The name of the HTTP header whose values you want to retrieve from the
`Headers` object. If the given name is not the name of an HTTP header, this
method throws a {{jsxref("TypeError")}}. The name is case-insensitive.
### Return value
A {{jsxref("String")}} sequence representing the values of the retrieved header or
`null` if this header is not set.
## Examples
Creating an empty `Headers` object is simple:
```js
const myHeaders = new Headers(); // Currently empty
myHeaders.get("Not-Set"); // Returns null
```
You could add a header to this using {{domxref("Headers.append")}}, then retrieve it
using `get()`:
```js
myHeaders.append("Content-Type", "image/jpeg");
myHeaders.get("Content-Type"); // Returns "image/jpeg"
```
If the header has multiple values associated with it, the byte string will contain all
the values, in the order they were added to the Headers object:
```js
myHeaders.append("Accept-Encoding", "deflate");
myHeaders.append("Accept-Encoding", "gzip");
myHeaders.get("Accept-Encoding"); // Returns "deflate, gzip"
myHeaders
.get("Accept-Encoding")
.split(",")
.map((v) => v.trimStart()); // Returns [ "deflate", "gzip" ]
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- [ServiceWorker API](/en-US/docs/Web/API/Service_Worker_API)
- [HTTP access control (CORS)](/en-US/docs/Web/HTTP/CORS)
- [HTTP](/en-US/docs/Web/HTTP)
| 0 |
data/mdn-content/files/en-us/web/api/headers | data/mdn-content/files/en-us/web/api/headers/has/index.md | ---
title: "Headers: has() method"
short-title: has()
slug: Web/API/Headers/has
page-type: web-api-instance-method
browser-compat: api.Headers.has
---
{{APIRef("Fetch API")}}
The **`has()`** method of the {{domxref("Headers")}} interface
returns a boolean stating whether a `Headers` object contains a certain
header.
For security reasons, some headers can only be controlled by the user agent. These
headers include the {{Glossary("Forbidden_header_name", "forbidden header names")}}
and {{Glossary("Forbidden_response_header_name", "forbidden response header names")}}.
{{AvailableInWorkers}}
## Syntax
```js-nolint
has(name)
```
### Parameters
- `name`
- : The name of the HTTP header you want to test for. If the given name is not a valid
HTTP header name, this method throws a {{jsxref("TypeError")}}.
### Return value
A boolean value.
## Examples
Creating an empty `Headers` object is simple:
```js
const myHeaders = new Headers(); // Currently empty
```
You could add a header to this using {{domxref("Headers.append")}}, then test for the
existence of it using `has()`:
```js
myHeaders.append("Content-Type", "image/jpeg");
myHeaders.has("Content-Type"); // Returns true
myHeaders.has("Accept-Encoding"); // Returns false
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- [ServiceWorker API](/en-US/docs/Web/API/Service_Worker_API)
- [HTTP access control (CORS)](/en-US/docs/Web/HTTP/CORS)
- [HTTP](/en-US/docs/Web/HTTP)
| 0 |
data/mdn-content/files/en-us/web/api/headers | data/mdn-content/files/en-us/web/api/headers/set/index.md | ---
title: "Headers: set() method"
short-title: set()
slug: Web/API/Headers/set
page-type: web-api-instance-method
browser-compat: api.Headers.set
---
{{APIRef("Fetch API")}}
The **`set()`** method of the {{domxref("Headers")}} interface
sets a new value for an existing header inside a `Headers` object, or adds
the header if it does not already exist.
The difference between `set()` and {{domxref("Headers.append")}} is that if
the specified header already exists and accepts multiple values, `set()`
overwrites the existing value with the new one, whereas {{domxref("Headers.append")}}
appends the new value to the end of the set of values.
For security reasons, some headers can only be controlled by the user agent. These
headers include the {{Glossary("Forbidden_header_name", "forbidden header names")}}
and {{Glossary("Forbidden_response_header_name", "forbidden response header names")}}.
{{AvailableInWorkers}}
## Syntax
```js-nolint
set(name, value)
```
### Parameters
- `name`
- : The name of the HTTP header you want to set to a new value. If the given name is not
the name of an HTTP header, this method throws a {{jsxref("TypeError")}}.
- `value`
- : The new value you want to set.
### Return value
None ({{jsxref("undefined")}}).
## Examples
Creating an empty `Headers` object is simple:
```js
const myHeaders = new Headers(); // Currently empty
```
You could add a header to this using {{domxref("Headers.append")}}, then set a new
value for this header using `set()`:
```js
myHeaders.append("Content-Type", "image/jpeg");
myHeaders.set("Content-Type", "text/html");
```
If the specified header does not already exist, `set()` will create it and
set its value to the specified value. If the specified header does already exist and
does accept multiple values, `set()` will overwrite the existing value with
the new one:
```js
myHeaders.set("Accept-Encoding", "deflate");
myHeaders.set("Accept-Encoding", "gzip");
myHeaders.get("Accept-Encoding"); // Returns 'gzip'
```
You'd need {{domxref("Headers.append")}} to append the new value onto the values, not
overwrite it.
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- [ServiceWorker API](/en-US/docs/Web/API/Service_Worker_API)
- [HTTP access control (CORS)](/en-US/docs/Web/HTTP/CORS)
- [HTTP](/en-US/docs/Web/HTTP)
| 0 |
data/mdn-content/files/en-us/web/api/headers | data/mdn-content/files/en-us/web/api/headers/append/index.md | ---
title: "Headers: append() method"
short-title: append()
slug: Web/API/Headers/append
page-type: web-api-instance-method
browser-compat: api.Headers.append
---
{{APIRef("Fetch API")}}
The **`append()`** method of the {{domxref("Headers")}}
interface appends a new value onto an existing header inside a `Headers`
object, or adds the header if it does not already exist.
The difference between {{domxref("Headers.set", "set()")}} and `append()` is
that if the specified header already exists and accepts multiple values,
`set()` will overwrite the existing value with the new one, whereas
`append()` will append the new value onto the end of the set of values.
For security reasons, some headers can only be controlled by the user agent. These
headers include the {{Glossary("Forbidden_header_name", "forbidden header names")}}
and {{Glossary("Forbidden_response_header_name", "forbidden response header names")}}.
{{AvailableInWorkers}}
## Syntax
```js-nolint
append(name, value)
```
### Parameters
- `name`
- : The name of the HTTP header you want to add to the `Headers` object.
- `value`
- : The value of the HTTP header you want to add.
### Return value
None ({{jsxref("undefined")}}).
## Examples
Creating an empty `Headers` object is simple:
```js
const myHeaders = new Headers(); // Currently empty
```
You could add a header to this using `append()`:
```js
myHeaders.append("Content-Type", "image/jpeg");
myHeaders.get("Content-Type"); // Returns 'image/jpeg'
```
If the specified header already exists, `append()` will change its value to
the specified value. If the specified header already exists and accepts multiple values,
`append()` will append the new value to the end of the value set:
```js
myHeaders.append("Accept-Encoding", "deflate");
myHeaders.append("Accept-Encoding", "gzip");
myHeaders.get("Accept-Encoding"); // Returns 'deflate, gzip'
```
To overwrite the old value with a new one, use {{domxref("Headers.set")}}.
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- [ServiceWorker API](/en-US/docs/Web/API/Service_Worker_API)
- [HTTP access control (CORS)](/en-US/docs/Web/HTTP/CORS)
- [HTTP](/en-US/docs/Web/HTTP)
| 0 |
data/mdn-content/files/en-us/web/api/headers | data/mdn-content/files/en-us/web/api/headers/getsetcookie/index.md | ---
title: "Headers: getSetCookie() method"
short-title: getSetCookie()
slug: Web/API/Headers/getSetCookie
page-type: web-api-instance-method
browser-compat: api.Headers.getSetCookie
---
{{APIRef("Fetch API")}}
The **`getSetCookie()`** method of the {{domxref("Headers")}} interface returns an array containing the values of all {{httpheader("Set-Cookie")}} headers associated with a response. This allows {{domxref("Headers")}} objects to handle having multiple `Set-Cookie` headers, which wasn't possible prior to its implementation.
This method is intended for use on server environments (for example Node.js). Browsers block frontend JavaScript code from accessing the {{httpheader("Set-Cookie")}} header, as required by the Fetch spec, which defines `Set-Cookie` as a [forbidden response-header name](https://fetch.spec.whatwg.org/#forbidden-response-header-name) that [must be filtered out](https://fetch.spec.whatwg.org/#ref-for-forbidden-response-header-name%E2%91%A0) from any response exposed to frontend code.
{{AvailableInWorkers}}
## Syntax
```js-nolint
getSetCookie()
```
### Parameters
None.
### Return value
An array of strings representing the values of all the different `Set-Cookie` headers associated with a response.
If no `Set-Cookie` headers are set, the method will return an empty array (`[ ]`).
## Examples
As alluded to above, running code like the following on the client won't return any results — `Set-Cookie` is filtered out from {{domxref("Headers")}} retrieved over the network.
```js
fetch("https://example.com").then((response) => {
console.log(response.headers.getSetCookie());
// No header values returned
});
```
However, the following could be used to query multiple `Set-Cookie` values. This is much more useful on the server, but it would also work on the client.
```js
const headers = new Headers({
"Set-Cookie": "name1=value1",
});
headers.append("Set-Cookie", "name2=value2");
headers.getSetCookie();
// Returns ["name1=value1", "name2=value2"]
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- [HTTP](/en-US/docs/Web/HTTP)
- {{httpheader("Set-Cookie")}}
| 0 |
data/mdn-content/files/en-us/web/api/headers | data/mdn-content/files/en-us/web/api/headers/keys/index.md | ---
title: "Headers: keys() method"
short-title: keys()
slug: Web/API/Headers/keys
page-type: web-api-instance-method
browser-compat: api.Headers.keys
---
{{APIRef("Fetch API")}}
The **`Headers.keys()`** method returns an
{{jsxref("Iteration_protocols",'iterator')}} allowing to go through all keys contained
in this object. The keys are {{jsxref("String")}} objects.
{{AvailableInWorkers}}
## Syntax
```js-nolint
keys()
```
### Parameters
None.
### Return value
Returns an {{jsxref("Iteration_protocols","iterator")}}.
## Examples
```js
// Create a test Headers object
const myHeaders = new Headers();
myHeaders.append("Content-Type", "text/xml");
myHeaders.append("Vary", "Accept-Language");
// Display the keys
for (const key of myHeaders.keys()) {
console.log(key);
}
```
The result is:
```plain
content-type
vary
```
## Browser compatibility
{{Compat}}
## See also
- [ServiceWorker API](/en-US/docs/Web/API/Service_Worker_API)
- [HTTP access control (CORS)](/en-US/docs/Web/HTTP/CORS)
- [HTTP](/en-US/docs/Web/HTTP)
| 0 |
data/mdn-content/files/en-us/web/api/headers | data/mdn-content/files/en-us/web/api/headers/headers/index.md | ---
title: "Headers: Headers() constructor"
short-title: Headers()
slug: Web/API/Headers/Headers
page-type: web-api-constructor
browser-compat: api.Headers.Headers
---
{{APIRef("Fetch API")}}
The **`Headers()`** constructor creates a new
{{domxref("Headers")}} object.
{{AvailableInWorkers}}
## Syntax
```js-nolint
new Headers()
new Headers(init)
```
### Parameters
- `init` {{optional_inline}}
- : An object containing any [HTTP headers](/en-US/docs/Web/HTTP/Headers)
that you want to pre-populate your `Headers` object with. This can be a
simple object literal with {{jsxref("String")}} values, an array of name-value pairs, where each pair is a 2-element string array; or an existing
`Headers` object. In the last case, the new `Headers` object
copies its data from the existing `Headers` object.
## Examples
Creating an empty `Headers` object is simple:
```js
const myHeaders = new Headers(); // Currently empty
```
You could add a header to this using {{domxref("Headers.append")}}:
```js
myHeaders.append("Content-Type", "image/jpeg");
myHeaders.get("Content-Type"); // Returns 'image/jpeg'
```
Or you can add the headers you want as the `Headers` object is created. In
the following snippet we create a new {{domxref("Headers")}} object, adding some headers
by passing the constructor an init object as an argument:
```js
const httpHeaders = {
"Content-Type": "image/jpeg",
"X-My-Custom-Header": "Zeke are cool",
};
const myHeaders = new Headers(httpHeaders);
```
You can now create another `Headers` object, passing it the first
`Headers` object as its init object:
```js
const secondHeadersObj = new Headers(myHeaders);
secondHeadersObj.get("Content-Type"); // Would return 'image/jpeg' — it inherits it from the first headers object
```
You can also add the headers you want as the `Headers` object is created by using a two-dimensional array to add multiple headers with the same values. In
the following snippet we create a new {{domxref("Headers")}} object with multiple `Set-Cookie` headers
by passing the constructor an init array as an argument:
```js
const headers = [
["Set-Cookie", "greeting=hello"],
["Set-Cookie", "name=world"],
];
const myHeaders = new Headers(headers);
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- [ServiceWorker API](/en-US/docs/Web/API/Service_Worker_API)
- [HTTP access control (CORS)](/en-US/docs/Web/HTTP/CORS)
- [HTTP](/en-US/docs/Web/HTTP)
| 0 |
data/mdn-content/files/en-us/web/api/headers | data/mdn-content/files/en-us/web/api/headers/values/index.md | ---
title: "Headers: values() method"
short-title: values()
slug: Web/API/Headers/values
page-type: web-api-instance-method
browser-compat: api.Headers.values
---
{{APIRef("Fetch API")}}
The **`Headers.values()`** method returns an
{{jsxref("Iteration_protocols",'iterator')}} allowing to go through all values contained
in this object. The values are {{jsxref("String")}} objects.
{{AvailableInWorkers}}
## Syntax
```js-nolint
values()
```
### Parameters
None.
### Return value
Returns an {{jsxref("Iteration_protocols","iterator")}}.
## Examples
```js
// Create a test Headers object
const myHeaders = new Headers();
myHeaders.append("Content-Type", "text/xml");
myHeaders.append("Vary", "Accept-Language");
// Display the values
for (const value of myHeaders.values()) {
console.log(value);
}
```
The result is:
```plain
text/xml
Accept-Language
```
## Browser compatibility
{{Compat}}
## See also
- [ServiceWorker API](/en-US/docs/Web/API/Service_Worker_API)
- [HTTP access control (CORS)](/en-US/docs/Web/HTTP/CORS)
- [HTTP](/en-US/docs/Web/HTTP)
| 0 |
data/mdn-content/files/en-us/web/api/headers | data/mdn-content/files/en-us/web/api/headers/delete/index.md | ---
title: "Headers: delete() method"
short-title: delete()
slug: Web/API/Headers/delete
page-type: web-api-instance-method
browser-compat: api.Headers.delete
---
{{APIRef("Fetch API")}}
The **`delete()`** method of the {{domxref("Headers")}}
interface deletes a header from the current `Headers` object.
This method throws a {{jsxref("TypeError")}} for the following reasons:
- The value of the name parameter is not the name of an HTTP header.
- The value of {{Glossary("Guard")}} is `immutable`.
For security reasons, some headers can only be controlled by the user agent. These
headers include the {{Glossary("Forbidden_header_name", "forbidden header names")}}
and {{Glossary("Forbidden_response_header_name", "forbidden response header names")}}.
{{AvailableInWorkers}}
## Syntax
```js-nolint
delete(name)
```
### Parameters
- `name`
- : The name of the HTTP header you want to delete from the `Headers` object.
### Return value
None ({{jsxref("undefined")}}).
## Examples
Creating an empty `Headers` object is simple:
```js
const myHeaders = new Headers(); // Currently empty
```
You could add a header to this using {{domxref("Headers.append")}}:
```js
myHeaders.append("Content-Type", "image/jpeg");
myHeaders.get("Content-Type"); // Returns 'image/jpeg'
```
You can then delete it again:
```js
myHeaders.delete("Content-Type");
myHeaders.get("Content-Type"); // Returns null, as it has been deleted
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- [ServiceWorker API](/en-US/docs/Web/API/Service_Worker_API)
- [HTTP access control (CORS)](/en-US/docs/Web/HTTP/CORS)
- [HTTP](/en-US/docs/Web/HTTP)
| 0 |
data/mdn-content/files/en-us/web/api/headers | data/mdn-content/files/en-us/web/api/headers/foreach/index.md | ---
title: "Headers: forEach() method"
short-title: forEach()
slug: Web/API/Headers/forEach
page-type: web-api-instance-method
browser-compat: api.Headers.forEach
---
{{APIRef("Fetch API")}}
The **`Headers.forEach()`** method executes a callback function once per each key/value pair in the [`Headers`](/en-US/docs/Web/API/Headers) object.
{{AvailableInWorkers}}
## Syntax
```js-nolint
forEach(callbackFn)
forEach(callbackFn, thisArg)
```
### Parameters
- `callbackFn`
- : Function to execute for each entry in the map. It takes the following arguments:
- `value`
- : Value of the currently visited header entry.
- `key`
- : Name of the currently visited header entry.
- `object`
- : The Headers object being iterated.
- `thisArg` {{Optional_Inline}}
- : Value to use as `this` when executing `callback`.
### Return value
{{jsxref("undefined")}}.
## Description
The `Headers.forEach()` method executes the provided callback once for each key of the Headers which actually exist. It is not invoked for keys which have been deleted. However, it is executed for keys which are present but have the value undefined.
## Examples
### Printing the contents of Headers object
The following code logs a line for each key/value in the `myHeaders` object.
```js
// Create a new test Headers object
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Cookie", "This is a demo cookie");
myHeaders.append("compression", "gzip");
// Display the key/value pairs
myHeaders.forEach((value, key) => {
console.log(`${key} ==> ${value}`);
});
```
The result is:
```plain
compression ==> gzip
content-type ==> application/json
cookie ==> This is a demo cookie
```
## Browser compatibility
{{compat}}
## See also
- [`Map.prototype.forEach()`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/forEach)
- [ServiceWorker API](/en-US/docs/Web/API/Service_Worker_API)
- [HTTP access control (CORS)](/en-US/docs/Web/HTTP/CORS)
- [HTTP](/en-US/docs/Web/HTTP)
| 0 |
data/mdn-content/files/en-us/web/api/headers | data/mdn-content/files/en-us/web/api/headers/entries/index.md | ---
title: "Headers: entries() method"
short-title: entries()
slug: Web/API/Headers/entries
page-type: web-api-instance-method
browser-compat: api.Headers.entries
---
{{APIRef("Fetch API")}}
The **`Headers.entries()`** method returns an
{{jsxref("Iteration_protocols",'iterator')}} allowing to go through all key/value pairs
contained in this object. Both the key and value of each pair are
{{jsxref("String")}} objects.
{{AvailableInWorkers}}
## Syntax
```js-nolint
entries()
```
### Parameters
None.
### Return value
Returns an {{jsxref("Iteration_protocols","iterator")}}.
## Examples
```js
// Create a test Headers object
const myHeaders = new Headers();
myHeaders.append("Content-Type", "text/xml");
myHeaders.append("Vary", "Accept-Language");
// Display the key/value pairs
for (const pair of myHeaders.entries()) {
console.log(`${pair[0]}: ${pair[1]}`);
}
```
The result is:
```plain
content-type: text/xml
vary: Accept-Language
```
## Browser compatibility
{{Compat}}
## See also
- [ServiceWorker API](/en-US/docs/Web/API/Service_Worker_API)
- [HTTP access control (CORS)](/en-US/docs/Web/HTTP/CORS)
- [HTTP](/en-US/docs/Web/HTTP)
| 0 |
data/mdn-content/files/en-us/web/api | data/mdn-content/files/en-us/web/api/xsltprocessor/index.md | ---
title: XSLTProcessor
slug: Web/API/XSLTProcessor
page-type: web-api-interface
browser-compat: api.XSLTProcessor
---
{{APIRef("XSLT")}}
An **`XSLTProcessor`** applies an [XSLT](/en-US/docs/Web/XSLT) stylesheet transformation to an XML document to
produce a new XML document as output. It has methods to load the XSLT stylesheet, to
manipulate `<xsl:param>` parameter values, and to apply the
transformation to documents.
## Constructor
- {{domxref("XSLTProcessor.XSLTProcessor", "XSLTProcessor()")}}
- : Create a new `XSLTProcessor`.
## Instance methods
- {{domxref("XSLTProcessor.importStylesheet()")}}
- : Imports the XSLT stylesheet.
If the given node is a document node, you can pass in a full XSL Transform or a [literal result element transform](https://www.w3.org/TR/xslt/#result-element-stylesheet);
otherwise, it must be an `<xsl:stylesheet>` or `<xsl:transform>` element.
- {{domxref("XSLTProcessor.transformToFragment()")}}
- : Transforms the node source by applying the XSLT stylesheet imported using the {{domxref("XSLTProcessor.importStylesheet()")}} function.
The owner document of the resulting document fragment is the owner node.
- {{domxref("XSLTProcessor.transformToDocument()")}}
- : Transforms the node source applying the XSLT stylesheet given importing using the {{domxref("XSLTProcessor.importStylesheet()")}} function.
- {{domxref("XSLTProcessor.setParameter()")}}
- : Sets a parameter (`<xsl:param>`) value in the XSLT stylesheet that was imported.
- {{domxref("XSLTProcessor.getParameter()")}}
- : Gets the value of a parameter from the XSLT stylesheet.
- {{domxref("XSLTProcessor.removeParameter()")}}
- : Removes the parameter if it was previously set.
This will make the `XSLTProcessor` use the default value for the parameter as specified in the XSLT stylesheet.
- {{domxref("XSLTProcessor.clearParameters()")}}
- : Removes all set parameters from the `XSLTProcessor`.
The `XSLTProcessor` will then use the default values specified in the XSLT stylesheet.
- {{domxref("XSLTProcessor.reset()")}}
- : Removes all parameters and stylesheets from the `XSLTProcessor`.
## Instance properties
_This are no properties for this interface._
## Examples
### Instantiating an `XSLTProcessor`
```js
async function init() {
const parser = new DOMParser();
const xsltProcessor = new XSLTProcessor();
// Load the XSLT file, example1.xsl
const xslResponse = await fetch("example1.xsl");
const xslText = await xslResponse.text();
const xslStylesheet = parser.parseFromString(xslText, "application/xml");
xsltProcessor.importStylesheet(xslStylesheet);
// process the file
// ...
}
```
### Creating an XML document based on part of a document's DOM
For the actual transformation, `XSLTProcessor` requires an XML document, which is used in conjunction with the imported XSL file to produce the final result. The XML document can be a separate XML file loaded using {{domxref("fetch()")}}, or it can be part of the existing page.
To process part of a page's DOM, it is necessary to first create an XML document in memory. Assuming that the DOM to be processed is contained by an element with the id `example`, that DOM can be "cloned" using the in-memory XML document's {{domxref('Document.importNode()')}} method. {{domxref('Document.importNode()')}} allows transferring a DOM fragment between documents, in this case from an HTML document to an XML document. The first parameter references the DOM node to clone. By making the second parameter "true", it will clone all descendants as well (a deep clone). The cloned DOM can then be inserted into the XML document using {{domxref('Node.appendChild()')}}, as shown below.
```js
// Create a new XML document in memory
const xmlRef = document.implementation.createDocument("", "", null);
// We want to move a part of the DOM from an HTML document to an XML document.
// importNode is used to clone the nodes we want to process via XSLT - true makes it do a deep clone
const myNode = document.getElementById("example");
const clonedNode = xmlRef.importNode(myNode, true);
// Add the cloned DOM into the XML document
xmlRef.appendChild(clonedNode);
```
Once the stylesheet has been imported, `XSLTProcessor` has to perform two methods for the actual transformation, namely {{domxref('XSLTProcessor.transformToDocument()')}} and {{domxref('XSLTProcessor.transformToFragment()')}}. {{domxref('XSLTProcessor.transformToDocument()')}} returns a full XML document while {{domxref('XSLTProcessor.transformToFragment()')}} returns a document fragment that can be easily added to an existing document. Both take in the XML document as the first parameter that will be transformed. {{domxref('XSLTProcessor.transformToFragment()')}} requires a second parameter, namely the document object that will own the generated fragment. If the generated fragment will be inserted into the current HTML document, passing in document is enough.
### Creating an XML document From a String 'XML Soup'
You can use the {{domxref("DOMParser")}} to create an XML document from a string of XML.
```js
const parser = new DOMParser();
const doc = parser.parseFromString(aStr, "text/xml");
```
### Performing the transformation
```js
const fragment = xsltProcessor.transformToFragment(xmlRef, document);
```
### Basic Example
The basic example will load an XML file and apply a XSL transformation on it. These are the same files used in the [Generating HTML](/en-US/docs/Web/API/XSLTProcessor/Generating_HTML) example. The XML file describes an article and the XSL file formats the information for display.
#### XML
```xml
<?xml version="1.0"?>
<myNS:Article xmlns:myNS="http://devedge.netscape.com/2002/de">
<myNS:Title>My Article</myNS:Title>
<myNS:Authors>
<myNS:Author company="Foopy Corp.">Mr. Foo</myNS:Author>
<myNS:Author>Mr. Bar</myNS:Author>
</myNS:Authors>
<myNS:Body>
The <b>rain</b> in <u>Spain</u> stays mainly in the plains.
</myNS:Body>
</myNS:Article>
```
#### XSLT
```xml
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:myNS="http://devedge.netscape.com/2002/de">
<xsl:output method="html" />
<xsl:template match="/">
<html>
<head>
<title>
<xsl:value-of select="/myNS:Article/myNS:Title"/>
</title>
<style>
.myBox {margin:10px 155px 0 50px; border: 1px dotted #639ACE; padding:0 5px 0 5px;}
</style>
</head>
<body>
<p class="myBox">
<span class="title">
<xsl:value-of select="/myNS:Article/myNS:Title"/>
</span> <br />
Authors: <br />
<xsl:apply-templates select="/myNS:Article/myNS:Authors/myNS:Author"/>
</p>
<p class="myBox">
<xsl:apply-templates select="//myNS:Body"/>
</p>
</body>
</html>
</xsl:template>
<xsl:template match="myNS:Author">
-- <xsl:value-of select="." />
<xsl:if test="@company">
:: <b> <xsl:value-of select="@company" /> </b>
</xsl:if>
<br />
</xsl:template>
<xsl:template match="myNS:Body">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
```
The example loads both the .xsl (`xslStylesheet`) and the .xml (`xmlDoc`) files into memory. The .xsl file is then imported (`xsltProcessor.importStylesheet(xslStylesheet)`) and the transformation run (`xsltProcessor.transformToFragment(xmlDoc, document)`). This allows fetching of data after the page has been loaded, without initiating a fresh page load.
#### JavaScript
```js
async function init() {
const parser = new DOMParser();
const xsltProcessor = new XSLTProcessor();
// Load the XSLT file, example1.xsl
const xslResponse = await fetch("example1.xsl");
const xslText = await xslResponse.text();
const xslStylesheet = parser.parseFromString(xslText, "application/xml");
xsltProcessor.importStylesheet(xslStylesheet);
// Load the XML file, example1.xml
const xmlResponse = await fetch("example1.xml");
const xmlText = await xmlResponse.text();
const xmlDoc = parser.parseFromString(xmlText, "application/xml");
const fragment = xsltProcessor.transformToFragment(xmlDoc, document);
document.getElementById("example").textContent = "";
document.getElementById("example").appendChild(fragment);
}
init();
```
### Advanced example
This advanced example sorts several divs based on their content. The example allows sorting the content multiple times, alternating between ascending and descending order. The JavaScript loads the .xsl file only on the first sort and sets the `xslloaded` variable to true once it has finished loading the file. Using the {{domxref("XSLTProcessor.getParameter()")}} method, the code can figure whether to sort in ascending or descending order. It defaults to ascending if the parameter is empty (the first time the sorting happens, as there is no value for it in the XSLT file). The sorting value is set using {{domxref("XSLTProcessor.setParameter()")}}.
The XSLT file has a parameter called `myOrder` that JavaScript sets to change the sorting method. The `xsl:sort` element's order attribute can access the value of the parameter using `$myOrder`. However, the value needs to be an XPATH expression and not a string, so `{$myOrder}` is used. Using {} evaluates the content as an XPath expression.
Once the transformation is complete, the result is appended to the document, as shown in this example.
#### XHTML
```html
<div id="example">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
<div>10</div>
</div>
```
#### JavaScript
```js
let xslRef;
let xslloaded = false;
const parser = new DOMParser();
const xsltProcessor = new XSLTProcessor();
let myDOM;
let xmlRef = document.implementation.createDocument("", "", null);
async function sort() {
if (!xslloaded) {
const response = await fetch("example2.xsl");
const xslText = await response.text();
xslRef = parser.parseFromString(xslText, "application/xml");
xsltProcessor.importStylesheet(xslRef);
xslloaded = true;
}
// Create a new XML document in memory
xmlRef = document.implementation.createDocument("", "", null);
// We want to move a part of the DOM from an HTML document to an XML document.
// importNode is used to clone the nodes we want to process via XSLT - true makes it do a deep clone
const myNode = document.getElementById("example");
const clonedNode = xmlRef.importNode(myNode, true);
// After cloning, we append
xmlRef.appendChild(clonedNode);
// Set the sorting parameter in the XSL file
const sortVal = xsltProcessor.getParameter(null, "myOrder");
if (sortVal === "" || sortVal === "descending") {
xsltProcessor.setParameter(null, "myOrder", "ascending");
} else {
xsltProcessor.setParameter(null, "myOrder", "descending");
}
// Initiate the transformation
const fragment = xsltProcessor.transformToFragment(xmlRef, document);
// Clear the contents
document.getElementById("example").textContent = "";
myDOM = fragment;
// Add the new content from the transformation
document.getElementById("example").appendChild(fragment);
}
```
#### XSLT
```xml
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes" />
<xsl:param name="myOrder" />
<xsl:template match="/">
<xsl:apply-templates select="/div//div">
<xsl:sort select="." data-type="number" order="{$myOrder}" />
</xsl:apply-templates>
</xsl:template>
<xsl:template match="div">
<xsl:copy-of select="." />
</xsl:template>
</xsl:stylesheet>
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- [XSLT](/en-US/docs/Web/XSLT)
- [What kind of language is XSLT?](https://developer.ibm.com/technologies/web-development/) at [IBM developer](https://developer.ibm.com/)
- [XSLT Tutorial](https://www.zvon.org/xxl/XSLTutorial/Books/Book1/index.html) at [zvon.org](https://www.zvon.org/)
- [XPath Tutorial](https://www.zvon.org/xxl/XPathTutorial/General/examples.html) at [zvon.org](https://www.zvon.org/)
| 0 |
data/mdn-content/files/en-us/web/api/xsltprocessor | data/mdn-content/files/en-us/web/api/xsltprocessor/generating_html/index.md | ---
title: Generating HTML
slug: Web/API/XSLTProcessor/Generating_HTML
page-type: guide
---
{{APIRef("XSLT")}}
One common application of XSLT in the browser is transforming XML into HTML on the client. This example will transform the input document (example2.xml), which contains information about an article, into an HTML document.
The `<body>` element of the article now contains HTML elements (a `<b>` and `<u>` tag). The XML document contains both HTML elements and XML elements, but only one namespace is needed, namely for the XML elements. Since there is no HTML namespace, and using the XHTML namespace would force the XSL to create an XML document that would not behave like an HTML document, the `xsl:output` in the XSL Stylesheet will make sure the resulting document will be handled as HTML. For the XML elements, our own namespace is needed, `http://devedge.netscape.com/2002/de`, and it is given the prefix myNS `(xmlns:myNS="http://devedge.netscape.com/2002/de")`.
## XML file
```xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="example2.xsl"?>
<myNS:Article xmlns:myNS="http://devedge.netscape.com/2002/de">
<myNS:Title>My Article</myNS:Title>
<myNS:Authors>
<myNS:Author company="Foopy Corp.">Mr. Foo</myNS:Author>
<myNS:Author>Mr. Bar</myNS:Author>
</myNS:Authors>
<myNS:Body>
The <b>rain</b> in <u>Spain</u> stays mainly in the plains.
</myNS:Body>
</myNS:Article>
```
The XSL Stylesheet used will need to have two namespaces - one for the XSLT elements and one for our own XML elements used in the XML document. The output of the XSL Stylesheet is set to `HTML` by using the `xsl:output` element. By setting the output to be HTML and not having a namespace on the resulting elements (colored in blue), those elements will be treated as HTML elements.
## XSL stylesheet with 2 namespaces
```xml
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:myNS="http://devedge.netscape.com/2002/de">
<xsl:output method="html"/>
…
</xsl:stylesheet version="1.0">
```
A template matching the root node of the XML document is created and used to create the basic structure of the HTML page.
## Creating the basic HTML document
```xml
…
<xsl:template match="/">
<html>
<head>
<title>
<xsl:value-of select="/myNS:Article/myNS:Title"/>
</title>
<style>
.myBox {margin:10px 155px 0 50px; border: 1px dotted #639ACE; padding:0 5px 0 5px;}
</style>
</head>
<body>
<p class="myBox">
<span class="title">
<xsl:value-of select="/myNS:Article/myNS:Title"/>
</span> </br>
Authors: <br />
<xsl:apply-templates select="/myNS:Article/myNS:Authors/myNS:Author"/>
</p>
<p class="myBox">
<xsl:apply-templates select="//myNS:Body"/>
</p>
</body>
</html>
</xsl:template>
…
```
Three more `xsl:template`'s are needed to complete the example. The first `xsl:template` is used for the author nodes, while the second one processes the body node. The third template has a general matching rule which will match any node and any attribute. It is needed in order to preserve the HTML elements in the XML document, since it matches all of them and copies them out into the HTML document the transformation creates.
## Final 3 templates
```xml
…
<xsl:template match="myNS:Author">
-- <xsl:value-of select="." />
<xsl:if test="@company">
:: <b> <xsl:value-of select="@company" /> </b>
</xsl:if>
<br />
</xsl:template>
```
```xml
<xsl:template match="myNS:Body">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
…
```
The final XSLT stylesheet looks as follows:
## Final XSLT stylesheet
```xml
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:myNS="http://devedge.netscape.com/2002/de">
<xsl:output method="html" />
<xsl:template match="/">
<html>
<head>
<title>
<xsl:value-of select="/myNS:Article/myNS:Title"/>
</title>
<style>
.myBox {margin:10px 155px 0 50px; border: 1px dotted #639ACE; padding:0 5px 0 5px;}
</style>
</head>
<body>
<p class="myBox">
<span class="title">
<xsl:value-of select="/myNS:Article/myNS:Title"/>
</span> <br />
Authors: <br />
<xsl:apply-templates select="/myNS:Article/myNS:Authors/myNS:Author"/>
</p>
<p class="myBox">
<xsl:apply-templates select="//myNS:Body"/>
</p>
</body>
</html>
</xsl:template>
<xsl:template match="myNS:Author">
-- <xsl:value-of select="." />
<xsl:if test="@company">
:: <b> <xsl:value-of select="@company" /> </b>
</xsl:if>
<br />
</xsl:template>
<xsl:template match="myNS:Body">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
```
| 0 |
data/mdn-content/files/en-us/web/api/xsltprocessor | data/mdn-content/files/en-us/web/api/xsltprocessor/removeparameter/index.md | ---
title: "XSLTProcessor: removeParameter() method"
short-title: removeParameter()
slug: Web/API/XSLTProcessor/removeParameter
page-type: web-api-instance-method
browser-compat: api.XSLTProcessor.removeParameter
---
{{APIRef("XSLT")}}
The `removeParameter()` method of the {{domxref("XSLTProcessor")}} interface removes the parameter (`<xsl:param>`) and its value from the stylesheet imported in the processor.
## Syntax
```js-nolint
removeParameter(namespaceURI, localName)
```
### Parameters
- `namespaceURI`
- : The namespace associated with the parameter name. A ["null"](/en-US/docs/Web/JavaScript/Reference/Operators/null) value is treated the same as the empty string (`""`).
- `localName`
- : The name of the parameter in the associated namespace.
### Return value
None ({{jsxref("undefined")}}).
## Examples
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{domxref("XSLTProcessor.getParameter()")}}
- {{domxref("XSLTProcessor.setParameter()")}}
- {{domxref("XSLTProcessor.clearParameters()")}}
- {{domxref("XSLTProcessor.reset()")}}
| 0 |
data/mdn-content/files/en-us/web/api/xsltprocessor | data/mdn-content/files/en-us/web/api/xsltprocessor/clearparameters/index.md | ---
title: "XSLTProcessor: clearParameters() method"
short-title: clearParameters()
slug: Web/API/XSLTProcessor/clearParameters
page-type: web-api-instance-method
browser-compat: api.XSLTProcessor.clearParameters
---
{{APIRef("XSLT")}}
The `clearParameters()` method of the {{domxref("XSLTProcessor")}} interface removes all parameters (`<xsl:param>`) and their values from the stylesheet imported in the processor. The `XSLTProcessor` will then use the default values specified in the XSLT stylesheet.
## Syntax
```js-nolint
clearParameters()
```
### Parameters
None.
### Return value
None ({{jsxref("undefined")}}).
## Examples
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{domxref("XSLTProcessor.getParameter()")}}
- {{domxref("XSLTProcessor.setParameter()")}}
- {{domxref("XSLTProcessor.removeParameter()")}}
- {{domxref("XSLTProcessor.reset()")}}
| 0 |
data/mdn-content/files/en-us/web/api/xsltprocessor | data/mdn-content/files/en-us/web/api/xsltprocessor/xsltprocessor/index.md | ---
title: "XSLTProcessor: XSLTProcessor() constructor"
short-title: XSLTProcessor()
slug: Web/API/XSLTProcessor/XSLTProcessor
page-type: web-api-constructor
browser-compat: api.XSLTProcessor.XSLTProcessor
---
{{APIRef("XSLT")}}
The **`XSLTProcessor()`** constructor creates a new {{domxref("XSLTProcessor")}} object instance.
## Syntax
```js-nolint
new XSLTProcessor()
```
### Parameters
None.
### Return value
A new {{domxref("XSLTProcessor")}} object instance.
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api/xsltprocessor | data/mdn-content/files/en-us/web/api/xsltprocessor/basic_example/index.md | ---
title: XSLT Basic Example
slug: Web/API/XSLTProcessor/Basic_Example
page-type: guide
---
{{APIRef("XSLT")}}
This first example demonstrates the basics of setting up an XSLT transformation in a browser.
The example takes an XML document that contains information about an article (title, list of authors and body text) and presents it in a human-readable form.
The XML document (**example.xml**) is shown below.
```xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="example.xsl"?>
<Article>
<Title>My Article</Title>
<Authors>
<Author>Mr. Foo</Author>
<Author>Mr. Bar</Author>
</Authors>
<Body>This is my article text.</Body>
</Article>
```
The `?xml-stylesheet` processing instruction in the XML file specifies the XSLT stylesheet to apply in its `href` attribute.
This XSL stylesheet file (**example.xsl**) is shown below:
```xml
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="/">
Article - <xsl:value-of select="/Article/Title"/>
Authors: <xsl:apply-templates select="/Article/Authors/Author"/>
</xsl:template>
<xsl:template match="Author">
- <xsl:value-of select="." />
</xsl:template>
</xsl:stylesheet>
```
An XSLT stylesheet starts with the `xsl:stylesheet` element, which contains all the _templates_ used to create the final output.
The example above has two templates - one that matches the root node and one that matches `Author` nodes.
The template that matches the root node outputs the article's title and then says to process all templates (via `apply-templates`) that match `Author` nodes which are children of the `Authors` node.
To try out the example:
1. Create a directory in your file system and inside it create the files `example.xml` and `example.xsl` listed above
2. [Start a local server](/en-US/docs/Learn/Common_questions/Tools_and_setup/set_up_a_local_testing_server#running_a_simple_local_http_server) in the directory containing the files.
This allows you to browse the files in the directory as though they were hosted on the internet.
> **Warning:** Opening the XML file directly from the file system will not work, because loading the stylesheet from the file system is a [cross-origin request](/en-US/docs/Web/HTTP/CORS), and will be disallowed by default.
> Hosting the XML and stylesheet on the same local server ensures that they have the same origin.
3. Open **example.xml** from the browser.
4. The browser output is then as shown below:
```plain
Browser Output :
Article - My Article
Authors:
- Mr. Foo
- Mr. Bar
```
| 0 |
data/mdn-content/files/en-us/web/api/xsltprocessor | data/mdn-content/files/en-us/web/api/xsltprocessor/reset/index.md | ---
title: "XSLTProcessor: reset() method"
short-title: reset()
slug: Web/API/XSLTProcessor/reset
page-type: web-api-instance-method
browser-compat: api.XSLTProcessor.reset
---
{{APIRef("XSLT")}}
The `reset()` method of the {{domxref("XSLTProcessor")}} interface removes all parameters (`<xsl:param>`) and the XSLT stylesheet from the processor. The `XSLTProcessor` will then be in its original state when it was created.
## Syntax
```js-nolint
reset()
```
### Parameters
None.
### Return value
None ({{jsxref("undefined")}}).
## Examples
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{domxref("XSLTProcessor.getParameter()")}}
- {{domxref("XSLTProcessor.setParameter()")}}
- {{domxref("XSLTProcessor.removeParameter()")}}
- {{domxref("XSLTProcessor.clearParameters()")}}
| 0 |
data/mdn-content/files/en-us/web/api/xsltprocessor | data/mdn-content/files/en-us/web/api/xsltprocessor/transformtofragment/index.md | ---
title: "XSLTProcessor: transformToFragment() method"
short-title: transformToFragment()
slug: Web/API/XSLTProcessor/transformToFragment
page-type: web-api-instance-method
browser-compat: api.XSLTProcessor.transformToFragment
---
{{APIRef("XSLT")}}
The `transformToFragment()` method of the {{domxref("XSLTProcessor")}} interface transforms a provided {{DOMxRef("Node")}} source to a {{domxref("DocumentFragment")}} using the XSLT stylesheet associated with the `XSLTProcessor`.
## Syntax
```js-nolint
transformToFragment(source, document)
```
### Parameters
- `source`
- : The {{DOMxRef("Node")}} source to apply the XSLT stylesheet to.
- `document`
- : The {{DOMxRef("Document")}} the document fragment will be associated with. (Any document fragment is associated with a document it can be added to).
### Return value
A {{domxref("DocumentFragment")}}.
## Examples
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{domxref("XSLTProcessor.transformToDocument()")}}
| 0 |
data/mdn-content/files/en-us/web/api/xsltprocessor | data/mdn-content/files/en-us/web/api/xsltprocessor/transformtodocument/index.md | ---
title: "XSLTProcessor: transformToDocument() method"
short-title: transformToDocument()
slug: Web/API/XSLTProcessor/transformToDocument
page-type: web-api-instance-method
browser-compat: api.XSLTProcessor.transformToDocument
---
{{APIRef("XSLT")}}
The `transformToDocument()` method of the {{domxref("XSLTProcessor")}} interface transforms the provided {{DOMxRef("Node")}} source to a {{domxref("Document")}} using the XSLT stylesheet associated with `XSLTProcessor`.
## Syntax
```js-nolint
transformToDocument(source)
```
### Parameters
- `source`
- : The {{DOMxRef("Node")}} source to apply the XSLT stylesheet to.
### Return value
A {{domxref("Document")}}. The actual interface depends on the [output method](https://www.w3.org/TR/1999/REC-xslt-19991116#output) of the stylesheet:
| Output method | Result interface |
| ------------- | ------------------------------------------------------------------------------------------------------ |
| `html` | {{domxref("HTMLDocument")}} |
| `xml` | {{domxref("XMLDocument")}} |
| `text` | {{domxref("XMLDocument")}} with a single root element `<transformiix:result>` with the text as a child |
## Examples
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{domxref("XSLTProcessor.transformToDocument()")}}
| 0 |
data/mdn-content/files/en-us/web/api/xsltprocessor | data/mdn-content/files/en-us/web/api/xsltprocessor/getparameter/index.md | ---
title: "XSLTProcessor: getParameter() method"
short-title: getParameter()
slug: Web/API/XSLTProcessor/getParameter
page-type: web-api-instance-method
browser-compat: api.XSLTProcessor.getParameter
---
{{APIRef("XSLT")}}
The `getParameter()` method of the {{domxref("XSLTProcessor")}} interface returns the value of a parameter (`<xsl:param>`) from the stylesheet imported in the processor.
## Syntax
```js-nolint
getParameter(namespaceURI, localName)
```
### Parameters
- `namespaceURI`
- : The namespace associated with the parameter name. A ["null"](/en-US/docs/Web/JavaScript/Reference/Operators/null) value is treated the same as the empty string (`""`).
- `localName`
- : The name of the parameter in the associated namespace.
### Return value
An object that is the value associated with the parameter. It can be of any type.
> **Note:** Firefox supports any kind of parameter. Chrome, Edge and Safari only support string parameters.
## Examples
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{domxref("XSLTProcessor.setParameter()")}}
- {{domxref("XSLTProcessor.removeParameter()")}}
- {{domxref("XSLTProcessor.clearParameters()")}}
- {{domxref("XSLTProcessor.reset()")}}
| 0 |
data/mdn-content/files/en-us/web/api/xsltprocessor | data/mdn-content/files/en-us/web/api/xsltprocessor/importstylesheet/index.md | ---
title: "XSLTProcessor: importStylesheet() method"
short-title: importStylesheet()
slug: Web/API/XSLTProcessor/importStylesheet
page-type: web-api-instance-method
browser-compat: api.XSLTProcessor.importStylesheet
---
{{APIRef("XSLT")}}
The `importStylesheet()` method of the {{domxref("XSLTProcessor")}} interface imports an XSLT stylesheet for the processor.
## Syntax
```js-nolint
importStylesheet(style)
```
### Parameters
- `style`
- : The {{DOMxRef("Node")}} to import. It can be an XML document (that is a {{domxref("Document")}} with {{domxref("Document.doctype", "doctype")}}`.`{{domxref("DocumentType.name", "name")}} of `"xml"`) containing an XSLT stylesheet or a [literal result element transform](https://www.w3.org/TR/xslt/#result-element-stylesheet), or an {{domxref("Element")}} representing an `<xsl:stylesheet>` or `<xsl:transform>`.
### Return value
None ({{jsxref("undefined")}}).
## Examples
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api/xsltprocessor | data/mdn-content/files/en-us/web/api/xsltprocessor/introduction/index.md | ---
title: Introduction
slug: Web/API/XSLTProcessor/Introduction
page-type: guide
---
{{APIRef("XSLT")}}
One noticeable trend in W3C standards has been the effort to separate content from style. This would allow the same style to be reused for multiple content, as well as simplify maintenance and allow a quick (only modify one file) way to change the look of content.
CSS (Cascade Style Sheets) was one of the first ways proposed by the W3C. CSS is a simple way to apply style rules to a web document. These style rules define how the document (the content) should be laid out. However, it has several limitations, such as lack of programming structures and ability to create complex layout models. CSS also has limited support for changing the position of an element.
XSL (Extensible Stylesheet Language) Transformations are composed of two parts: XSL elements, which allow the transformation of an XML tree into another markup tree and XPath, a selection language for trees. XSLT takes an XML document (the content) and creates a brand new document based on the rules in the XSL stylesheet. This allows XSLT to add, remove and reorganize elements from the original XML document and thus allows more fine-grain control of the resulting document's structure.
Transformations in XSLT are based on rules that consist of templates. Each template matches (using XPath) a certain fragment of the input XML document and then applies the substitution part on that fragment to create the new resulting document.
| 0 |
data/mdn-content/files/en-us/web/api/xsltprocessor | data/mdn-content/files/en-us/web/api/xsltprocessor/setparameter/index.md | ---
title: "XSLTProcessor: setParameter() method"
short-title: setParameter()
slug: Web/API/XSLTProcessor/setParameter
page-type: web-api-instance-method
browser-compat: api.XSLTProcessor.setParameter
---
{{APIRef("XSLT")}}
The `setParameter()` method of the {{domxref("XSLTProcessor")}} interface sets the value of a parameter (`<xsl:param>`) in the stylesheet imported in the processor.
## Syntax
```js-nolint
setParameter(namespaceURI, localName, value)
```
### Parameters
- `namespaceURI`
- : The namespace associated with the parameter name. A ["null"](/en-US/docs/Web/JavaScript/Reference/Operators/null) value is treated the same as the empty string (`""`).
- `localName`
- : The name of the parameter in the associated namespace.
- `value`
- : The value of the parameter.
> **Note:** Firefox supports any kind of parameter. Chrome, Edge and Safari only support string parameters.
### Return value
None ({{jsxref("undefined")}}).
## Examples
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{domxref("XSLTProcessor.getParameter()")}}
- {{domxref("XSLTProcessor.removeParameter()")}}
- {{domxref("XSLTProcessor.clearParameters()")}}
- {{domxref("XSLTProcessor.reset()")}}
| 0 |
data/mdn-content/files/en-us/web/api | data/mdn-content/files/en-us/web/api/characterdata/index.md | ---
title: CharacterData
slug: Web/API/CharacterData
page-type: web-api-interface
browser-compat: api.CharacterData
---
{{APIRef("DOM")}}
The **`CharacterData`** abstract interface represents a {{domxref("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 {{domxref("Text")}}, {{domxref("Comment")}}, {{domxref("CDATASection")}}, or {{domxref("ProcessingInstruction")}}, which aren't abstract.
{{InheritanceDiagram}}
## Instance properties
_This interface also inherits properties from its parents, {{domxref("Node")}} and {{domxref("EventTarget")}}._
- {{domxref("CharacterData.data")}}
- : A string representing the textual data contained in this object.
- {{domxref("CharacterData.length")}} {{ReadOnlyInline}}
- : Returns a number representing the size of the string contained in the object.
- {{domxref("CharacterData.nextElementSibling")}} {{ReadOnlyInline}}
- : Returns the first {{domxref("Element")}} that _follows_ this node, and is a sibling.
- {{domxref("CharacterData.previousElementSibling")}} {{ReadOnlyInline}}
- : Returns the first {{domxref("Element")}} that _precedes_ this node, and is a sibling.
## Instance methods
_This interface also inherits methods from its parents, {{domxref("Node")}} and {{domxref("EventTarget")}}._
- {{domxref("CharacterData.after()")}}
- : Inserts a set of {{domxref("Node")}} objects or strings in the children list of the
`CharacterData`'s parent, just after the `CharacterData` object.
- {{domxref("CharacterData.appendData()")}}
- : Appends the given string to the `CharacterData.data` string; when this method returns, `data` contains the concatenated string.
- {{domxref("CharacterData.before()")}}
- : Inserts a set of {{domxref("Node")}} objects or strings in the children list of the
`CharacterData`'s parent, just before the `CharacterData` object.
- {{domxref("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.
- {{domxref("CharacterData.insertData()")}}
- : Inserts the specified characters, at the specified offset, in the `CharacterData.data` string; when this method returns, `data` contains the modified string.
- {{domxref("CharacterData.remove()")}}
- : Removes the object from its parent children list.
- {{domxref("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.
- {{DOMxRef("CharacterData.replaceWith()")}}
- : Replaces the characters in the children list of its parent with a set of {{domxref("Node")}} objects or strings.
- {{domxref("CharacterData.substringData()")}}
- : Returns a string containing the part of `CharacterData.data` of the specified length and starting at the specified offset.
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- [The DOM overview page](/en-US/docs/Web/API/Document_Object_Model).
- The concrete interfaces implemented it: {{domxref("Text")}}, {{domxref("CDATASection")}}, {{domxref("ProcessingInstruction")}}, and {{domxref("Comment")}}.
| 0 |
data/mdn-content/files/en-us/web/api/characterdata | data/mdn-content/files/en-us/web/api/characterdata/insertdata/index.md | ---
title: "CharacterData: insertData() method"
short-title: insertData()
slug: Web/API/CharacterData/insertData
page-type: web-api-instance-method
browser-compat: api.CharacterData.insertData
---
{{APIRef("DOM")}}
The **`insertData()`** method of the {{domxref("CharacterData")}} interface
inserts the provided data into this `CharacterData` node's current data,
at the provided offset from the start of the existing data.
The provided data is spliced into the existing data.
## Syntax
```js-nolint
characterData.insertData(offset, data)
```
### Parameters
- `offset`
- : The offset number of characters to insert the provided data at.
`0` is the first character of the string.
- `data`
- : The data to insert.
### Return value
None.
## Exceptions
- `IndexSizeError` {{domxref("DOMException")}}
- : Thrown if offset is negative or greater than the length of the contained data.
## Example
```html
<span>Result: </span>A string.
```
```js
const span = document.querySelector("span");
const textnode = span.nextSibling;
textnode.insertData(2, "long ");
```
{{EmbedLiveSample("Example", "100%", 50)}}
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{domxref("CharacterData.appendData()")}}, {{domxref("CharacterData.deleteData()")}}, {{domxref("CharacterData.replaceData()")}}
- {{domxref("CharacterData.data")}}
| 0 |
data/mdn-content/files/en-us/web/api/characterdata | data/mdn-content/files/en-us/web/api/characterdata/remove/index.md | ---
title: "CharacterData: remove() method"
short-title: remove()
slug: Web/API/CharacterData/remove
page-type: web-api-instance-method
browser-compat: api.CharacterData.remove
---
{{APIRef("DOM")}}
The **`remove()`** method of the {{domxref("CharacterData")}} removes the text contained in the node.
## Syntax
```js-nolint
remove()
```
### Parameters
None.
## Example
### Using `remove()`
```html
<span>Result: </span>A long string.
```
```js
const span = document.querySelector("span");
const textnode = span.nextSibling;
textnode.remove(); // Removes the text
```
{{EmbedLiveSample("Example", "100%", 50)}}
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{domxref("Element.remove()")}}
- {{domxref("CharacterData.deleteData()")}}
| 0 |
data/mdn-content/files/en-us/web/api/characterdata | data/mdn-content/files/en-us/web/api/characterdata/replacedata/index.md | ---
title: "CharacterData: replaceData() method"
short-title: replaceData()
slug: Web/API/CharacterData/replaceData
page-type: web-api-instance-method
browser-compat: api.CharacterData.replaceData
---
{{APIRef("DOM")}}
The **`replaceData()`** method of the {{domxref("CharacterData")}} interface removes a certain number of characters of the existing text in a given `CharacterData` node and replaces those characters with the text provided.
## Syntax
```js-nolint
characterData.replaceData(offset, count, data)
```
### Parameters
- `offset`
- : The number of characters from the start of the data to insert at.
`0` is the first character of the string.
- `count`
- : The number of characters to replace with the provided data.
- `data`
- : The data to insert.
### Return value
None.
## Exceptions
- `IndexSizeError` {{domxref("DOMException")}}
- : Thrown if `offset` or `count` is negative or `offset` is greater than the length of the contained data.
## Example
```html
<span>Result: </span>A long string.
```
```js
const span = document.querySelector("span");
const textnode = span.nextSibling;
textnode.replaceData(2, 4, "replaced");
```
{{EmbedLiveSample("Example", "100%", 50)}}
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{domxref("CharacterData.appendData()")}}
- {{domxref("CharacterData.deleteData()")}}
- {{domxref("CharacterData.insertData()")}}
- {{domxref("CharacterData.data")}}
| 0 |
data/mdn-content/files/en-us/web/api/characterdata | data/mdn-content/files/en-us/web/api/characterdata/nextelementsibling/index.md | ---
title: "CharacterData: nextElementSibling property"
short-title: nextElementSibling
slug: Web/API/CharacterData/nextElementSibling
page-type: web-api-instance-property
browser-compat: api.CharacterData.nextElementSibling
---
{{APIRef("DOM")}}
The read-only **`nextElementSibling`** property of the {{domxref("CharacterData")}} interface
returns the first {{domxref("Element")}} node following the specified one in its parent's
children list, or `null` if the specified element is the last one in the list.
## Value
A {{domxref("Element")}} object, or `null` if no sibling has been found.
## Example
```html
TEXT
<div id="div-01">Here is div-01</div>
TEXT2
<div id="div-02">Here is div-02</div>
<pre>Here is the result area</pre>
```
```js
// Initially, set node to the Text node with `TEXT`
let node = document.getElementById("div-01").previousSibling;
let result = "Next element siblings of TEXT:\n";
while (node) {
result += `${node.nodeName}\n`;
node = node.nextElementSibling; // The first node is a CharacterData, the others Element objects
}
document.querySelector("pre").textContent = result;
```
{{EmbedLiveSample("Example", "100%", "230")}}
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{domxref("CharacterData.previousElementSibling")}}
| 0 |
data/mdn-content/files/en-us/web/api/characterdata | data/mdn-content/files/en-us/web/api/characterdata/data/index.md | ---
title: "CharacterData: data property"
short-title: data
slug: Web/API/CharacterData/data
page-type: web-api-instance-property
browser-compat: api.CharacterData.data
---
{{APIRef("DOM")}}
The **`data`** property of the {{domxref("CharacterData")}} interface represent the value of the current object's data.
## Value
A string with the character information contained in the {{domxref("CharacterData")}} node.
## Example
> **Note:** {{domxref("CharacterData")}} is an abstract interface.
> The examples below use two concrete interfaces implementing it, {{domxref("Text")}} and {{domxref("Comment")}}.
### Reading a comment using data
```html
<!-- This is an HTML comment -->
<output id="result"></output>
```
```js
const comment = document.body.childNodes[1];
const output = document.getElementById("result");
output.value = comment.data;
```
{{EmbedLiveSample("Reading_a_comment_using_data", "100%", 50)}}
### Setting the content of a text node using data
```html
<span>Result: </span>Not set.
```
```js
const span = document.querySelector("span");
const textnode = span.nextSibling;
textnode.data = "This text has been set using 'textnode.data'.";
```
{{EmbedLiveSample("Setting_the_content_of_a_text_node_using_data", "100%", 50)}}
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{domxref("CharacterData.length")}} returning the length of the data contained in the {{domxref("CharacterData")}} node.
| 0 |
data/mdn-content/files/en-us/web/api/characterdata | data/mdn-content/files/en-us/web/api/characterdata/length/index.md | ---
title: "CharacterData: length property"
short-title: length
slug: Web/API/CharacterData/length
page-type: web-api-instance-property
browser-compat: api.CharacterData.length
---
{{APIRef("DOM")}}
The read-only **`CharacterData.length`** property
returns the number of characters in the contained data, as a positive integer.
## Value
A positive integer with the length of the {{domxref("CharacterData.data")}} string.
## Example
> **Note:** {{domxref("CharacterData")}} is an abstract interface.
> The examples below use {{domxref("Text")}}, a concrete interface implementing it.
```html
Length of the string in the <code>Text</code> node: <output></output>
```
```js
const output = document.querySelector("output");
const textnode = new Text("This text has been set using 'textnode.data'.");
output.value = textnode.length;
```
{{EmbedLiveSample("Example", "100%", 50)}}
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api/characterdata | data/mdn-content/files/en-us/web/api/characterdata/appenddata/index.md | ---
title: "CharacterData: appendData() method"
short-title: appendData()
slug: Web/API/CharacterData/appendData
page-type: web-api-instance-method
browser-compat: api.CharacterData.appendData
---
{{APIRef("DOM")}}
The **`appendData()`** method of the {{domxref("CharacterData")}} interface
adds the provided data to the end of the node's current data.
## Syntax
```js-nolint
appendData(data)
```
### Parameters
- `data`
- : The data to append to the current node.
### Return value
None.
## Example
```html
<span>Result: </span>A text
```
```js
const span = document.querySelector("span");
const textnode = span.nextSibling;
textnode.appendData(" - appended text.");
```
{{EmbedLiveSample("Example", "100%", 50)}}
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{domxref("CharacterData.deleteData()")}}, {{domxref("CharacterData.insertData()")}}, {{domxref("CharacterData.replaceData()")}}
- {{domxref("CharacterData.data")}}
| 0 |
data/mdn-content/files/en-us/web/api/characterdata | data/mdn-content/files/en-us/web/api/characterdata/previouselementsibling/index.md | ---
title: "CharacterData: previousElementSibling property"
short-title: previousElementSibling
slug: Web/API/CharacterData/previousElementSibling
page-type: web-api-instance-property
browser-compat: api.Element.previousElementSibling
---
{{APIRef("DOM")}}
The read-only **`previousElementSibling`** of the {{domxref("CharacterData")}} interface
returns the first {{domxref("Element")}} before the current node in its parent's children list,
or `null` if there is none.
## Value
A {{domxref("Element")}} object, or `null` if no sibling has been found.
## Example
```html
<div id="div-01">Here is div-01</div>
TEXT
<div id="div-02">Here is div-02</div>
SOME TEXT
<div id="div-03">Here is div-03</div>
<pre>Result</pre>
```
```js
// Initially set node to the Text node with `SOME TEXT`
let node = document.getElementById("div-02").nextSibling;
let result = "Previous element siblings of SOME TEXT:\n";
while (node) {
result += `${node.nodeName}\n`;
node = node.previousElementSibling;
}
document.querySelector("pre").textContent = result;
```
{{EmbedLiveSample("Example", "100%", "200")}}
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{domxref("CharacterData.nextElementSibling")}}
| 0 |
data/mdn-content/files/en-us/web/api/characterdata | data/mdn-content/files/en-us/web/api/characterdata/after/index.md | ---
title: "CharacterData: after() method"
short-title: after()
slug: Web/API/CharacterData/after
page-type: web-api-instance-method
browser-compat: api.CharacterData.after
---
{{APIRef("DOM")}}
The **`after()`** method of the {{domxref("CharacterData")}} interface
inserts a set of {{domxref("Node")}} objects or strings in the children list of the
object's parent, just after the object itself.
Strings are inserted as {{domxref("Text")}} nodes; the string is being passed as argument to the {{domxref("Text/Text", "Text()")}} constructor.
## Syntax
```js-nolint
after(...nodes)
```
### Parameters
- `nodes`
- : A set of {{domxref("Node")}} or strings to insert.
### Exceptions
- `HierarchyRequestError` {{DOMxRef("DOMException")}}
- : Thrown when the new nodes cannot be inserted at the specified point in the hierarchy,
that is if one of the following conditions is met:
- If the insertion of one of the added node would lead to a cycle, that is if one of them is an ancestor of this {{domxref("CharacterData")}} node.
- If one of the added node is not a {{domxref("DocumentFragment")}}, a {{domxref("DocumentType")}}, an {{domxref("Element")}}, or a {{domxref("CharacterData")}}.
- If this {{domxref("CharacterData")}} node is actually a {{domxref("Text")}} node, and its parent is a {{domxref("Document")}}.
- If the parent of this {{domxref("CharacterData")}} node is a {{domxref("Document")}} and one of the nodes to insert is a {{domxref("DocumentFragment")}} with more than one {{domxref("Element")}} child, or that has a {{domxref("Text")}} child.
## Examples
The `after()` method allows you to insert new nodes after a `CharacterData` node.
```js
const h1TextNode = document.querySelector("h1").firstChild;
h1TextNode.after(" #h1");
h1TextNode.parentElement.childNodes;
// NodeList [#text "CharacterData.after()", #text " #h1"]
h1TextNode.data;
// "CharacterData.after()"
```
> **Note:** If you rather want to append text to the current node,
> the [`appendData()`](/en-US/docs/Web/API/CharacterData/appendData) method lets you append to the current node's data.
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{domxref("CharacterData.appendData()")}}
- {{domxref("CharacterData.before()")}}
- {{domxref("Element.append()")}}
- {{domxref("Node.appendChild()")}}
- {{domxref("Element.insertAdjacentElement()")}}
| 0 |
data/mdn-content/files/en-us/web/api/characterdata | data/mdn-content/files/en-us/web/api/characterdata/substringdata/index.md | ---
title: "CharacterData: substringData() method"
short-title: substringData()
slug: Web/API/CharacterData/substringData
page-type: web-api-instance-method
browser-compat: api.CharacterData.substringData
---
{{APIRef("DOM")}}
The **`substringData()`** method of the {{domxref("CharacterData")}} interface
returns a portion of the existing data,
starting at the specified index
and extending for a given number of characters afterwards.
## Syntax
```js-nolint
domString = characterData.substringData(offset, count)
```
### Parameters
- `offset`
- : The index of the first character to include in the returned substring.
`0` is the first character of the string.
- `count`
- : The number of characters to return.
### Return value
A string with the substring.
## Exceptions
- `IndexSizeError` {{domxref("DOMException")}}
- : Thrown if `offset` + `count` is larger than the length of the contained data.
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api/characterdata | data/mdn-content/files/en-us/web/api/characterdata/before/index.md | ---
title: "CharacterData: before() method"
short-title: before()
slug: Web/API/CharacterData/before
page-type: web-api-instance-method
browser-compat: api.CharacterData.before
---
{{APIRef("DOM")}}
The **`before()`** method of the {{domxref("CharacterData")}} interface
inserts a set of {{domxref("Node")}} objects and strings
in the children list of the `CharacterData`'s parent, just before the `CharacterData` node.
Strings are inserted as {{domxref("Text")}} nodes; the string is being passed as argument to the {{domxref("Text/Text", "Text()")}} constructor.
## Syntax
```js-nolint
before(...nodes)
```
### Parameters
- `nodes`
- : A set of {{domxref("Node")}} or strings to insert.
### Exceptions
- `HierarchyRequestError` {{DOMxRef("DOMException")}}
- : Thrown when the new nodes cannot be inserted at the specified point in the hierarchy, that is if one of the following conditions is met:
- If the insertion of one of the added node would lead to a cycle, that is if one of them is an ancestor of this {{domxref("CharacterData")}} node.
- If one of the added node is not a {{domxref("DocumentFragment")}}, a {{domxref("DocumentType")}}, an {{domxref("Element")}}, or a {{domxref("CharacterData")}}.
- If this {{domxref("CharacterData")}} node is actually a {{domxref("Text")}} node, and its parent is a {{domxref("Document")}}.
- If the parent of this {{domxref("CharacterData")}} node is a {{domxref("Document")}} and one of the nodes to insert is a {{domxref("DocumentFragment")}} with more than one {{domxref("Element")}} child, or that has a {{domxref("Text")}} child.
## Examples
The `before()` method allows you to insert new nodes before a
`CharacterData` node leaving the current node's data unchanged.
```js
const h1TextNode = document.querySelector("h1").firstChild;
h1TextNode.before("h1# ");
h1TextNode.parentElement.childNodes;
// NodeList [#text "h1# ", #text "CharacterData.before()"]
h1TextNode.data;
// "CharacterData.before()"
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{domxref("CharacterData.appendData()")}}
- {{domxref("CharacterData.after()")}}
- {{domxref("Element.append()")}}
- {{domxref("Node.appendChild()")}}
- {{domxref("Element.insertAdjacentElement()")}}
| 0 |
data/mdn-content/files/en-us/web/api/characterdata | data/mdn-content/files/en-us/web/api/characterdata/replacewith/index.md | ---
title: "CharacterData: replaceWith() method"
short-title: replaceWith()
slug: Web/API/CharacterData/replaceWith
page-type: web-api-instance-method
browser-compat: api.CharacterData.replaceWith
---
{{APIRef("DOM")}}
The **`replaceWith()`** method of the {{domxref("CharacterData")}} interface
replaces this node in the children list of its parent
with a set of {{domxref("Node")}} objects or string.
Strings are inserted as {{domxref("Text")}} nodes; the string is being passed as argument to the {{domxref("Text/Text", "Text()")}} constructor.
## Syntax
```js-nolint
replaceWith(...nodes)
```
### Parameters
- `nodes` {{optional_inline}}
- : A comma-separated list of {{domxref("Node")}} objects or strings that will replace the current node.
> **Note:** If there no argument is passed, this method acts just remove the node from the DOM tree.
### Return value
None ({{jsxref("undefined")}}).
### Exceptions
- `HierarchyRequestError` {{DOMxRef("DOMException")}}
- : Thrown when the node cannot be inserted at the specified point in the hierarchy.
## Examples
```html
<p id="myText">Some text</p>
```
```js
let text = document.getElementById("myText").firstChild;
let em = document.createElement("em");
em.textContent = "Italic text";
text.replaceWith(em); // Replace `Some text` by `Italic text`
```
{{EmbedLiveSample("Examples", "100%", 30)}}
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{domxref("CharacterData.replaceData()")}}
| 0 |
data/mdn-content/files/en-us/web/api/characterdata | data/mdn-content/files/en-us/web/api/characterdata/deletedata/index.md | ---
title: "CharacterData: deleteData() method"
short-title: deleteData()
slug: Web/API/CharacterData/deleteData
page-type: web-api-instance-method
browser-compat: api.CharacterData.deleteData
---
{{APIRef("DOM")}}
The **`deleteData()`** method of the {{domxref("CharacterData")}} interface
removes all or part of the data from this `CharacterData` node.
## Syntax
```js-nolint
characterData.deleteData(offset, count)
```
### Parameters
- `offset`
- : The number of bytes from the start of the data to remove from.
`0` is the first character of the string.
- `count`
- : The number of bytes to remove.
### Return value
None.
## Exceptions
- `IndexSizeError` {{domxref("DOMException")}}
- : Thrown if `offset` is greater than the length of the contained data.
## Example
```html
<span>Result: </span>A long string.
```
```js
const span = document.querySelector("span");
const textnode = span.nextSibling;
textnode.deleteData(1, 5);
```
{{EmbedLiveSample("Example", "100%", 50)}}
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{domxref("CharacterData.appendData()")}}, {{domxref("CharacterData.insertData()")}}, {{domxref("CharacterData.replaceData()")}}
- {{domxref("CharacterData.data")}}
| 0 |
data/mdn-content/files/en-us/web/api | data/mdn-content/files/en-us/web/api/rtcpeerconnectioniceevent/index.md | ---
title: RTCPeerConnectionIceEvent
slug: Web/API/RTCPeerConnectionIceEvent
page-type: web-api-interface
browser-compat: api.RTCPeerConnectionIceEvent
---
{{APIRef("WebRTC")}}
The **`RTCPeerConnectionIceEvent`** interface represents events that occur in relation to {{Glossary("ICE")}} candidates with the target, usually an {{domxref("RTCPeerConnection")}}.
Only one event is of this type: {{domxref("RTCPeerConnection.icecandidate_event", "icecandidate")}}.
{{InheritanceDiagram}}
## Instance properties
_A {{domxref("RTCPeerConnectionIceEvent")}} being an {{domxref("Event")}}, this event also implements these properties_.
- {{domxref("RTCPeerConnectionIceEvent.candidate")}} {{ReadOnlyInline}}
- : Contains the {{domxref("RTCIceCandidate")}} containing the candidate associated with the event, or `null` if this event indicates that there are no further candidates to come.
## Constructors
- {{domxref("RTCPeerConnectionIceEvent.RTCPeerConnectionIceEvent()", "RTCPeerConnectionIceEvent()")}}
- : Returns a new `RTCPeerConnectionIceEvent`. It takes two parameters, the first being a string representing the type of the event; the second a dictionary containing the {{domxref("RTCIceCandidate")}} it refers to.
## Instance methods
_A {{domxref("RTCPeerConnectionIceEvent")}} being an {{domxref("Event")}}, this event also implements these properties. There is no specific {{domxref("RTCDataChannelEvent")}} method._
## Examples
```js
pc.onicecandidate = (ev) => {
console.log(
`The ICE candidate (trsp addr: '${ev.candidate.candidate}') added to connection.`,
);
};
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- [WebRTC](/en-US/docs/Web/API/WebRTC_API)
- Its usual target: {{domxref("RTCPeerConnection")}}.
| 0 |
data/mdn-content/files/en-us/web/api/rtcpeerconnectioniceevent | data/mdn-content/files/en-us/web/api/rtcpeerconnectioniceevent/candidate/index.md | ---
title: "RTCPeerConnectionIceEvent: candidate property"
short-title: candidate
slug: Web/API/RTCPeerConnectionIceEvent/candidate
page-type: web-api-instance-property
browser-compat: api.RTCPeerConnectionIceEvent.candidate
---
{{APIRef("WebRTC")}}
The read-only **`candidate`** property
of the {{domxref("RTCPeerConnectionIceEvent")}} interface returns the
{{domxref("RTCIceCandidate")}} associated with the event.
## Value
An {{domxref("RTCIceCandidate")}} object representing the ICE candidate that has been
received, or `null` to indicate that there are no further candidates for this
negotiation session.
## Example
```js
pc.onicecandidate = (ev) => {
alert(
`The ICE candidate (transport address: '${ev.candidate.candidate}') has been added to this connection.`,
);
};
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{domxref("RTCPeerConnection.icecandidate_event", "icecandidate")}}
- {{domxref("RTCPeerConnection")}}
| 0 |
data/mdn-content/files/en-us/web/api/rtcpeerconnectioniceevent | data/mdn-content/files/en-us/web/api/rtcpeerconnectioniceevent/rtcpeerconnectioniceevent/index.md | ---
title: "RTCPeerConnectionIceEvent: RTCPeerConnectionIceEvent() constructor"
short-title: RTCPeerConnectionIceEvent()
slug: Web/API/RTCPeerConnectionIceEvent/RTCPeerConnectionIceEvent
page-type: web-api-constructor
browser-compat: api.RTCPeerConnectionIceEvent.RTCPeerConnectionIceEvent
---
{{APIRef("WebRTC")}}
The **`RTCPeerConnectionIceEvent()`** constructor creates a new
{{domxref("RTCPeerConnectionIceEvent")}} object.
## Syntax
```js-nolint
new RTCPeerConnectionIceEvent(type, options)
```
### Parameters
- `type`
- : A string with the name of the event.
It is case-sensitive and browsers always set it to `icecandidate`.
- `options` {{optional_inline}}
- : An object that, _in addition of the properties defined in {{domxref("Event/Event", "Event()")}}_, can have the following properties:
- `candidate`
- : A {{domxref("RTCIceCandidate")}} representing the ICE candidate being concerned by the event.
If `null`, the event indicates the end of candidate gathering.
- `url`
- : A string containing the URL of the STUN or TURN server which was used to gather the candidate.
If the candidate was not gathered by a {{Glossary("STUN")}} or {{Glossary("TURN")}} server,
this value must be `null`, which is also the default value.
### Return value
A new {{domxref("RTCPeerConnectionIceEvent")}} object, configured as specified in the provided options.
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- [WebRTC](/en-US/docs/Web/API/WebRTC_API)
- Its usual target: {{domxref("RTCPeerConnection")}}.
| 0 |
data/mdn-content/files/en-us/web/api | data/mdn-content/files/en-us/web/api/webglbuffer/index.md | ---
title: WebGLBuffer
slug: Web/API/WebGLBuffer
page-type: web-api-interface
browser-compat: api.WebGLBuffer
---
{{APIRef("WebGL")}}
The **WebGLBuffer** interface is part of the [WebGL API](/en-US/docs/Web/API/WebGL_API) and represents an opaque buffer object storing data such as vertices or colors.
{{InheritanceDiagram}}
## Description
The `WebGLBuffer` object does not define any methods or properties of its own and its content is not directly accessible. When working with `WebGLBuffer` objects, the following methods of the {{domxref("WebGLRenderingContext")}} are useful:
- {{domxref("WebGLRenderingContext.bindBuffer()")}}
- {{domxref("WebGLRenderingContext.createBuffer()")}}
- {{domxref("WebGLRenderingContext.deleteBuffer()")}}
- {{domxref("WebGLRenderingContext.isBuffer()")}}
## Examples
### Creating a buffer
```js
const canvas = document.getElementById("canvas");
const gl = canvas.getContext("webgl");
const buffer = gl.createBuffer();
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{domxref("WebGLRenderingContext.bindBuffer()")}}
- {{domxref("WebGLRenderingContext.createBuffer()")}}
- {{domxref("WebGLRenderingContext.deleteBuffer()")}}
- {{domxref("WebGLRenderingContext.isBuffer()")}}
- Other buffers: {{domxref("WebGLFramebuffer")}}, {{domxref("WebGLRenderbuffer")}}
| 0 |
data/mdn-content/files/en-us/web/api | data/mdn-content/files/en-us/web/api/midiaccess/index.md | ---
title: MIDIAccess
slug: Web/API/MIDIAccess
page-type: web-api-interface
browser-compat: api.MIDIAccess
---
{{securecontext_header}}{{APIRef("Web MIDI API")}}
The **`MIDIAccess`** interface of the [Web MIDI API](/en-US/docs/Web/API/Web_MIDI_API) provides methods for listing MIDI input and output devices, and obtaining access to those devices.
{{InheritanceDiagram}}
## Instance properties
- {{domxref("MIDIAccess.inputs")}} {{ReadOnlyInline}}
- : Returns an instance of {{domxref("MIDIInputMap")}} which provides access to any available MIDI input ports.
- {{domxref("MIDIAccess.outputs")}} {{ReadOnlyInline}}
- : Returns an instance of {{domxref("MIDIOutputMap")}} which provides access to any available MIDI output ports.
- {{domxref("MIDIAccess.sysexEnabled")}} {{ReadOnlyInline}}
- : A boolean attribute indicating whether system exclusive support is enabled on the current MIDIAccess instance.
### Events
- {{domxref("MIDIAccess.statechange_event")}}
- : Called whenever a new MIDI port is added or an existing port changes state.
## Examples
The {{domxref("Navigator.requestMIDIAccess()")}} method returns a promise that resolves with a {{domxref("MIDIAccess")}} object. Information about the input and output ports is returned.
When a port changes state, information about that port is printed to the console.
```js
navigator.requestMIDIAccess().then((access) => {
// Get lists of available MIDI controllers
const inputs = access.inputs.values();
const outputs = access.outputs.values();
access.onstatechange = (event) => {
// Print information about the (dis)connected MIDI controller
console.log(event.port.name, event.port.manufacturer, event.port.state);
};
});
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api/midiaccess | data/mdn-content/files/en-us/web/api/midiaccess/sysexenabled/index.md | ---
title: "MIDIAccess: sysexEnabled property"
short-title: sysexEnabled
slug: Web/API/MIDIAccess/sysexEnabled
page-type: web-api-instance-property
browser-compat: api.MIDIAccess.sysexEnabled
---
{{securecontext_header}}{{APIRef("Web MIDI API")}}
The **`sysexEnabled`** read-only property of the {{domxref("MIDIAccess")}} interface indicates whether system exclusive support is enabled on the current MIDIAccess instance.
## Value
A boolean value.
## Examples
The {{domxref("Navigator.requestMIDIAccess()")}} method returns a promise that resolves with a {{domxref("MIDIAccess")}} object. Printing the value of `sysexEnabled` to the console returns a boolean value, which is `true` if system exclusive support is enabled.
```js
navigator.requestMIDIAccess().then((access) => {
console.log(access.sysexEnabled);
});
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api/midiaccess | data/mdn-content/files/en-us/web/api/midiaccess/statechange_event/index.md | ---
title: "MIDIAccess: statechange event"
short-title: statechange
slug: Web/API/MIDIAccess/statechange_event
page-type: web-api-event
browser-compat: api.MIDIAccess.statechange_event
---
{{securecontext_header}}{{APIRef("Web MIDI API")}}
The **`statechange`** event of the {{domxref("MIDIAccess")}} interface is fired when a new MIDI port is added or when an existing port changes state.
## Syntax
Use the event name in methods like {{domxref("EventTarget.addEventListener", "addEventListener()")}}, or set an event handler property.
```js
addEventListener("statechange", (event) => {});
onstatechange = (event) => {};
```
## Event type
A {{domxref("MIDIConnectionEvent")}}. Inherits from {{domxref("Event")}}.
{{InheritanceDiagram("MIDIConnectionEvent")}}
## Event properties
- {{domxref("MIDIConnectionEvent.port")}} {{ReadOnlyInline}}
- : Returns a reference to a {{domxref("MIDIPort")}} instance for a port that has been connected or disconnected.
## Example
The {{domxref("Navigator.requestMIDIAccess()")}} method returns a promise that resolves with a {{domxref("MIDIAccess")}} object. When a port changes state, information about that port is printed to the console.
```js
navigator.requestMIDIAccess().then((access) => {
access.onstatechange = (event) => {
console.log(event.port.name, event.port.manufacturer, event.port.state);
};
});
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api/midiaccess | data/mdn-content/files/en-us/web/api/midiaccess/outputs/index.md | ---
title: "MIDIAccess: outputs property"
short-title: outputs
slug: Web/API/MIDIAccess/outputs
page-type: web-api-instance-property
browser-compat: api.MIDIAccess.outputs
---
{{securecontext_header}}{{APIRef("Web MIDI API")}}
The **`outputs`** read-only property of the {{domxref("MIDIAccess")}} interface provides access to any available MIDI output ports.
## Value
A {{domxref("MIDIOutputMap")}} instance.
## Examples
The {{domxref("Navigator.requestMIDIAccess()")}} method returns a promise that resolves with a {{domxref("MIDIAccess")}} object. Printing the value of `outputs` to the console returns a {{domxref("MIDIOutputMap")}}.
```js
navigator.requestMIDIAccess().then((access) => {
console.log(access.outputs);
});
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api/midiaccess | data/mdn-content/files/en-us/web/api/midiaccess/inputs/index.md | ---
title: "MIDIAccess: inputs property"
short-title: inputs
slug: Web/API/MIDIAccess/inputs
page-type: web-api-instance-property
browser-compat: api.MIDIAccess.inputs
---
{{securecontext_header}}{{APIRef("Web MIDI API")}}
The **`inputs`** read-only property of the {{domxref("MIDIAccess")}} interface provides access to any available MIDI input ports.
## Value
A {{domxref("MIDIInputMap")}} instance.
## Examples
The {{domxref("Navigator.requestMIDIAccess()")}} method returns a promise that resolves with a {{domxref("MIDIAccess")}} object. Printing the value of `inputs` to the console returns a {{domxref("MIDIInputMap")}}.
```js
navigator.requestMIDIAccess().then((access) => {
console.log(access.inputs);
});
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
| 0 |
data/mdn-content/files/en-us/web/api | data/mdn-content/files/en-us/web/api/documentpictureinpictureevent/index.md | ---
title: DocumentPictureInPictureEvent
slug: Web/API/DocumentPictureInPictureEvent
page-type: web-api-interface
status:
- experimental
browser-compat: api.DocumentPictureInPictureEvent
---
{{APIRef("Document Picture-in-Picture API")}}{{SeeCompatTable}}{{SecureContext_Header}}
The **`DocumentPictureInPictureEvent`** interface of the {{domxref("Document Picture-in-Picture API", "Document Picture-in-Picture API", "", "nocode")}} is the event object for the {{domxref("DocumentPictureInPicture/enter_event", "enter")}} event, which fires when the Picture-in-Picture window is opened.
{{InheritanceDiagram}}
## Constructor
- {{domxref("DocumentPictureInPictureEvent.DocumentPictureInPictureEvent", "DocumentPictureInPictureEvent()")}} {{Experimental_Inline}}
- : Creates a new `DocumentPictureInPictureEvent` object instance.
## Instance methods
_Inherits methods from its parent, {{DOMxRef("Event")}}._
## Instance properties
_Inherits properties from its parent, {{DOMxRef("Event")}}._
- {{domxref("DocumentPictureInPictureEvent.window", "window")}} {{ReadOnlyInline}} {{Experimental_Inline}}
- : Returns a {{domxref("Window")}} instance representing the browsing context inside the `DocumentPictureInPicture` window the event was fired on.
## Examples
```js
documentPictureInPicture.addEventListener("enter", (event) => {
const pipWindow = event.window;
console.log("Video player has entered the pip window");
const pipMuteButton = pipWindow.document.createElement("button");
pipMuteButton.textContent = "Mute";
pipMuteButton.addEventListener("click", () => {
const pipVideo = pipWindow.document.querySelector("#video");
if (!pipVideo.muted) {
pipVideo.muted = true;
pipMuteButton.textContent = "Unmute";
} else {
pipVideo.muted = false;
pipMuteButton.textContent = "Mute";
}
});
pipWindow.document.body.append(pipMuteButton);
});
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{domxref("Document Picture-in-Picture API", "Document Picture-in-Picture API", "", "nocode")}}
- [Using the Document Picture-in-Picture API](/en-US/docs/Web/API/Document_Picture-in-Picture_API/Using)
| 0 |
data/mdn-content/files/en-us/web/api/documentpictureinpictureevent | data/mdn-content/files/en-us/web/api/documentpictureinpictureevent/documentpictureinpictureevent/index.md | ---
title: "DocumentPictureInPictureEvent: DocumentPictureInPictureEvent() constructor"
short-title: DocumentPictureInPictureEvent()
slug: Web/API/DocumentPictureInPictureEvent/DocumentPictureInPictureEvent
page-type: web-api-constructor
status:
- experimental
browser-compat: api.DocumentPictureInPictureEvent.DocumentPictureInPictureEvent
---
{{APIRef("Document Picture-in-Picture API")}}{{SeeCompatTable}}{{SecureContext_Header}}
The **`DocumentPictureInPictureEvent()`** constructor creates a new
{{domxref("DocumentPictureInPictureEvent")}} object instance.
## Syntax
```js-nolint
new DocumentPictureInPictureEvent(type, init)
```
### Parameters
- `type`
- : A string representing the type of event. In the case of `DocumentPictureInPictureEvent` this is always `enter`.
- `init`
- : An object containing the following properties:
- `window`
- : A {{domxref("Window")}} instance representing the browsing context inside the `DocumentPictureInPicture` window the event was fired on.
## Examples
A developer would not use this constructor manually. A new `DocumentPictureInPictureEvent` object is constructed when a handler is invoked as a result of the {{domxref("DocumentPictureInPicture.enter_event", "enter")}} event firing.
```js
documentPictureInPicture.addEventListener("enter", (event) => {
const pipWindow = event.window;
console.log("Video player has entered the pip window");
const pipMuteButton = pipWindow.document.createElement("button");
pipMuteButton.textContent = "Mute";
pipMuteButton.addEventListener("click", () => {
const pipVideo = pipWindow.document.querySelector("#video");
if (!pipVideo.muted) {
pipVideo.muted = true;
pipMuteButton.textContent = "Unmute";
} else {
pipVideo.muted = false;
pipMuteButton.textContent = "Mute";
}
});
pipWindow.document.body.append(pipMuteButton);
});
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{domxref("Document Picture-in-Picture API", "Document Picture-in-Picture API", "", "nocode")}}
- [Using the Document Picture-in-Picture API](/en-US/docs/Web/API/Document_Picture-in-Picture_API/Using)
| 0 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.