Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .vscode/dictionaries/code-entities.txt
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ fullscreenbutton
fullwide
FunciOES
funcref
funcrefs
fwdred
fwid
gara
Expand Down Expand Up @@ -557,6 +558,7 @@ onsinkchange
ontextformatupdate
ontextupdate
onuncapturederror
onvalidationstatuschange
onwebkitmouseforcewillbegin
onzoomlevelchange
opendocument
Expand Down Expand Up @@ -710,6 +712,7 @@ serviceworker
setenvif
SHA-256-sess
SHA-512-sess
shadowrootcustomelementregistry
shadowrootreferencetarget
sharpyuv
shrd
Expand Down
1 change: 1 addition & 0 deletions .vscode/dictionaries/terms-abbreviations.txt
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ scorpionfish
screenful
scriptable
scriptless
scroll-snappable
scrollers
scrollport
SECAM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ The most common browsers you'll come across are as follows:
- WebKit: [Apple Safari](https://www.apple.com/safari/).
- Mobile/alternative device browsers:
- Chromium (Android): [Google Chrome](https://www.google.com/chrome/go-mobile/), [Opera](https://www.opera.com/opera), [Brave](https://brave.com/download/), [Microsoft Edge](https://www.microsoft.com/en-us/edge/mobile), [Samsung Internet](https://www.samsung.com/us/support/owners/app/samsung-internet), [Vivaldi](https://vivaldi.com/android/).
- Gecko (Android): [Mozilla Firefox](https://www.firefox.com/en-US/browsers/mobile/android/).
- Gecko (Android): [Mozilla Firefox](https://www.firefox.com/en-US/download/android/).
- WebKit (iOS): [Apple Safari](https://www.apple.com/safari/).
> [!NOTE]
> Most of the Android browsers listed above have iOS versions, but these were historically all powered by Apple's WebKit engine under the hood due to Apple's App Store rules. At the time of writing, browsers are starting to create versions of their iOS browsers based on their own rendering engines, due to regulatory changes. See [Apple is finally allowing full versions of Chrome and Firefox to run on the iPhone](https://www.theverge.com/2024/1/25/24050478/apple-ios-17-4-browser-engines-eu).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ All desktop operating systems come with a basic text editor. These editors are a
<td>ChromeOS</td>
<td>
<ul>
<li><a href="https://en.wikipedia.org/wiki/Text_(Chrome_app)">Text</a></li>
<li><a href="https://github.com/GoogleChromeLabs/text-app">Text</a></li>
</ul>
</td>
<td>
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/mozilla/firefox/releases/148/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Firefox 148 was released on [February 24, 2026](https://whattrainisitnow.com/rel

#### Marionette

- Added the `Reporting:GenerateTestReport` command to [generate a test report via the Reporting API](https://www.w3.org/TR/reporting-1/#generate-test-report-command) ([Firefox bug 1909662](https://bugzil.la/1909662)).
- Added the `Reporting:GenerateTestReport` command to [generate a test report via the Reporting API](https://w3c.github.io/reporting/#generate-test-report-command) ([Firefox bug 1909662](https://bugzil.la/1909662)).

## Experimental web features

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ body {
#output {
font-family: "Helvetica", "Arial";
padding: 10px;
border: 2px solid #ccc;
border: 2px solid #cccccc;
border-radius: 5px;
}
```
Expand Down
4 changes: 0 additions & 4 deletions files/en-us/web/api/streams_api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,6 @@ We have created a directory of examples to go along with the Streams API documen
- [Simple writer](https://mdn.github.io/dom-examples/streams/simple-writer/): This example shows how to write to a writable stream, then decode the stream and write the contents to the UI.
- [Unpack chunks of a PNG](https://mdn.github.io/dom-examples/streams/png-transform-stream/): This example shows how [`pipeThrough()`](/en-US/docs/Web/API/ReadableStream/pipeThrough) can be used to transform a ReadableStream into a stream of other data types by transforming a data of a PNG file into a stream of PNG chunks.

Examples from other developers:

- [Progress Indicators with Streams, Service Workers, & Fetch](https://fetch-progress.anthum.com/).

## Specifications

{{Specifications}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ So let's get started by setting up the basis for our WebRTC-powered phone app.
2. Next, create a new app by running `yarn init`. Follow the prompts, providing a name, version, description, etc. to your project.
3. Next, install the required dependencies using the following commands:
- [Express](https://expressjs.com/): `yarn add express`
- [PeerJS](https://peerjs.com/docs/): `yarn add peerjs`
- [PeerJS](https://peerjs.com/): `yarn add peerjs`
- [Peer](https://github.com/peers/peerjs-server): `yarn add peer`

Peer will be used for the peer server and PeerJS will be used to access the PeerJS API and framework. Your `package.json` should something look like this when you've finished installing the dependencies:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ main {
--myColor: #cacaca;
}
main:hover {
--myColor: #abba;
--myColor: #aabbbbaa;
}
@media (width < 750px) {
main {
--myColor: #abba;
--myColor: #aabbbbaa;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ Because `font-width` does not yet have broad browser support, you may want to in
```css
@font-face {
font-family: "MyFont";
src: url("myfont.woff2") format("woff2");
src: url("my-font.woff2") format("woff2");
font-stretch: condensed; /* for browsers that don't support font-width */
font-width: condensed;
}
Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/javascript/guide/memory_management/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ Although JavaScript does not directly expose the garbage collector API, the lang

[`WeakMap`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) and [`WeakSet`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) are data structures whose APIs closely mirror their non-weak counterparts: [`Map`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) and [`Set`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set). `WeakMap` allows you to maintain a collection of key-value pairs, while `WeakSet` allows you to maintain a collection of unique values, both with performant addition, deletion, and querying.

`WeakMap` and `WeakSet` got the name from the concept of _weakly held_ values. If `x` is weakly held by `y`, it means that although you can access the value of `x` via `y`, the mark-and-sweep algorithm won't consider `x` as reachable if nothing else _strongly holds_ to it. Most data structures, except the ones discussed here, strongly holds to the objects passed in so that you can retrieve them at any time. The keys of `WeakMap` and `WeakSet` can be garbage-collected (for `WeakMap` objects, the values would then be eligible for garbage collection as well) as long as nothing else in the program is referencing the key. This is ensured by two characteristics:
`WeakMap` and `WeakSet` got the name from the concept of _weakly held_ values. If `x` is weakly held by `y`, it means that although you can access the value of `x` via `y`, the mark-and-sweep algorithm won't consider `x` as reachable if nothing else _strongly holds_ to it. Most data structures, except the ones discussed here, strongly hold to the objects passed in so that you can retrieve them at any time. The keys of `WeakMap` and `WeakSet` can be garbage-collected (for `WeakMap` objects, the values would then be eligible for garbage collection as well) as long as nothing else in the program is referencing the key. This is ensured by two characteristics:

- `WeakMap` and `WeakSet` can only store objects or symbols. This is because only objects are garbage collected — primitive values can always be forged (that is, `1 === 1` but `{} !== {}`), making them stay in the collection forever. [Registered symbols](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry) (like `Symbol.for("key")`) can also be forged and thus not garbage collectable, but symbols created with `Symbol("key")` are garbage collectable. [Well-known symbols](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol#well-known_symbols) like `Symbol.iterator` come in a fixed set and are unique throughout the lifetime of the program, similar to intrinsic objects such as `Array.prototype`, so they are also allowed as keys.
- `WeakMap` and `WeakSet` can only store objects or symbols. This is because only objects are garbage collected — primitive values can always be forged (that is, `1 === 1` but `{} !== {}`), making them stay in the collection forever. [Registered symbols](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry) (like `Symbol.for("key")`) can also be forged and thus are not garbage collectable, but symbols created with `Symbol("key")` are garbage collectable. [Well-known symbols](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol#well-known_symbols) like `Symbol.iterator` come in a fixed set and are unique throughout the lifetime of the program, similar to intrinsic objects such as `Array.prototype`, so they are also allowed as keys.
- `WeakMap` and `WeakSet` are not iterable. This prevents you from using `Array.from(map.keys()).length` to observe the liveliness of objects, or get hold of an arbitrary key which should otherwise be eligible for garbage collection. (Garbage collection should be as invisible as possible.)

In typical explanations of `WeakMap` and `WeakSet` (such as the one above), it's often implied that the key is garbage-collected first, freeing the value for garbage collection as well. However, consider the case of the value referencing the key:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ TLS secures a network connection in three ways:

In particular, HTTPS is the defense against a [manipulator in the middle (MITM)](/en-US/docs/Web/Security/Attacks/MITM) attack, in which the attacker inserts themselves between the user's browser and the server they are connecting to, and can read and modify the traffic exchanged.

Browsers consider pages delivered over HTTPS as providing a [secure context](/en-US/docs/Web/Security/Secure_Contexts). Many powerful web APIs are only available to code running in a secure context.
Browsers consider pages delivered over HTTPS as providing a [secure context](/en-US/docs/Web/Security/Defenses/Secure_Contexts). Many powerful web APIs are only available to code running in a secure context.

**All websites should serve all their pages and subresources over HTTPS, and implement server authentication.**

Expand Down
6 changes: 3 additions & 3 deletions files/en-us/webassembly/reference/definitions/table/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ A table has to be given an initial size and storage type. This example creates a
Optionally, you can also provide an identifier, which can be used to identify the table elsewhere, and a maximum growth size. For example:

```wat
(table $mytable 2 10 funcref)
(table $my_table 2 10 funcref)
```

The following defines a function type, defines a basic function with that type that returns an `i32`, and forward-declares it using `(elem declare func $f1)` so it can be referenced later on.
Expand Down Expand Up @@ -106,7 +106,7 @@ It is possible to mutate tables at runtime using instructions like [`table.set`]
You can also store external references defined in JavaScript inside a Wasm table, by specifying the [`externref`](/en-US/docs/WebAssembly/Reference/Types/externref) keyword. For example:

```wat
(table $mytable 2 10 externref)
(table $my_table 2 10 externref)
```

### Multiple tables
Expand Down Expand Up @@ -214,7 +214,7 @@ The outputted value is as follows:

{{embedlivesample("basic-usage", "100%", 100)}}

This makes sense, as the exported `accessTable()` function has an index value passed into it. Inside the Wasm module, we call the function availale at that index in the defined table, which returns the value we see output.
This makes sense, as the exported `accessTable()` function has an index value passed into it. Inside the Wasm module, we call the function available at that index in the defined table, which returns the value we see output.

## Specifications

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/webassembly/reference/table/fill/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ When the result is returned, we invoke the exported Wasm `run()` function availa
const outputElem = document.querySelector("p");

const obj = {
output: function (elem, val) {
output(elem, val) {
elem.textContent += `${val} `;
},
};
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/webassembly/reference/table/get/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ When the result is returned, we invoke the exported Wasm `run()` function availa
```js live-sample___basic-usage
let imports = {
funcs: {
output: function (elem, val) {
output(elem, val) {
elem.textContent += `${val} `;
},
},
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/webassembly/reference/table/grow/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ When the result is returned, we invoke the exported Wasm `run()` function availa
const outputElem = document.querySelector("p");

const obj = {
output: function (elem, val) {
output(elem, val) {
elem.textContent += `${val} `;
},
};
Expand Down
4 changes: 2 additions & 2 deletions files/en-us/webassembly/reference/table/set/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ When the result is returned, we invoke the exported Wasm `run()` function availa
const outputElem = document.querySelector("p");

const obj = {
output: function (elem, val) {
output(elem, val) {
elem.textContent += `${val} `;
},
};
Expand All @@ -188,7 +188,7 @@ Next, we define a function `type` called `$ret_i32`, which returns an `i32` valu
Finally, we export the `run()` function, which takes an `externref` named `$elem` as a parameter. Inside the function body, we:

- Use `table.grow` to grow the table size by `1`, with an initial `ref.null` value, checking whether the operation result is `-1`, which would indicate failure.
- Set our table element to contain the `$f1` function using [`table.set`](/en-US/docs/WebAssembly/Reference/Table/set), then call the imported `$output` function, passing it as parameters the `$elem` `externref` passed into the `output()` function, and the value returned by the `$f1` function, which is being referenced from the table using `(call_indirect (type $ret_i32) (i32.const 0))`.
- Set our table element to contain the `$f1` function using `table.set`, then call the imported `$output` function, passing it as parameters the `$elem` `externref` passed into the `output()` function, and the value returned by the `$f1` function, which is being referenced from the table using `(call_indirect (type $ret_i32) (i32.const 0))`.
- Set our table element to contain the `$f2` function using `table.set`, then call the `output()` function again.

```wat live-sample___basic-usage
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/webassembly/reference/table/size/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ When the result is returned, we invoke the exported Wasm `run()` function availa
const outputElem = document.querySelector("p");

const obj = {
output: function (elem, val) {
output(elem, val) {
elem.textContent += `${val} `;
},
};
Expand Down
14 changes: 7 additions & 7 deletions files/en-us/webassembly/reference/types/externref/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ The **`externref`** value type references a JavaScript value, enabling it to be
```js interactive-example
// Define double() function inside obj
const obj = {
double: function (num) {
double(num) {
return num * 2;
},
};
Expand Down Expand Up @@ -84,10 +84,10 @@ First of all, we define our two functions — `double()` and `output()` — insi

```js live-sample___basic-usage
const obj = {
double: function (num) {
double(num) {
return num * 2;
},
output: function (elem, val) {
output(elem, val) {
elem.textContent = val;
},
};
Expand All @@ -109,7 +109,7 @@ WebAssembly.instantiateStreaming(fetch("{%wasm-url%}"), { obj }).then(

Over in our Wasm module, we first import the `double()` and `output()` functions from the imported `obj` namespace, giving them reference names of `$double` and `$output`. Note how the first `param` in each case is given an `externref` type. This is because these params are provided by JavaScript when the exported `outputDouble()` function is called. The `output()` function's second `param` is not an `externref`; it is an `i32`, provided as the result of the `double()` function when called from inside the Wasm module.

Next, we define the exported `outputDouble()` function. Its two `params` — `$num` and `$elem` — are `externref` types, which makes sense, as we are calling it from JavaScript and providing the values there. Inside, we define a local variable called `$doublenum`, call the imported `double()` function, passing it the `$num` `externref` as its parameter, and assign its return value to `$doublenum`. Finally, we complete the `outputDouble()` function by calling the imported `output()` function, passing it the `$elem` `externref` as its first parameter, and the `$doublenum` value as its second parameter.
Next, we define the exported `outputDouble()` function. Its two `params` — `$num` and `$elem` — are `externref` types, which makes sense, as we are calling it from JavaScript and providing the values there. Inside, we define a local variable called `$double_num`, call the imported `double()` function, passing it the `$num` `externref` as its parameter, and assign its return value to `$double_num`. Finally, we complete the `outputDouble()` function by calling the imported `output()` function, passing it the `$elem` `externref` as its first parameter, and the `$double_num` value as its second parameter.

```wat live-sample___basic-usage
(module
Expand All @@ -119,12 +119,12 @@ Next, we define the exported `outputDouble()` function. Its two `params` — `$n
(param $num externref)
(param $elem externref)

(local $doublenum i32)
(local $double_num i32)

(call $double (local.get $num))
(local.set $doublenum)
(local.set $double_num)

(call $output (local.get $elem) (local.get $doublenum))
(call $output (local.get $elem) (local.get $double_num))
)
)
```
Expand Down