Skip to content

Commit

Permalink
Merge branch 'main' into ff119_credprpops
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdavidmills authored Oct 9, 2023
2 parents 2828ff0 + 7178770 commit 0e5c275
Show file tree
Hide file tree
Showing 32 changed files with 103 additions and 119 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ The actual syntax for HTTP messages (called requests and responses) is not that
pElem.textContent = "We changed the text!";
```

In the house analogy, JavaScript is like the cooker, TV, Microwave, or hairdryer — the things that give your house useful functionality
In the house analogy, JavaScript is like the cooker, TV, Microwave, or hairdryer — the things that give your house useful functionality.

### Tools

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,22 +245,25 @@ An attribute should have:

### Active learning: Adding attributes to an element

Another example of an element is {{htmlelement("a")}}. This stands for _anchor_. An anchor can make the text it encloses into a hyperlink. Anchors can take a number of attributes, but several are as follows:
The `<img>` element can take a number of attributes, including:

- `href`
- : This attribute's value specifies the web address for the link. For example: `href="https://www.mozilla.org/"`.
- `title`
- : The `title` attribute specifies extra information about the link, such as a description of the page that is being linked to. For example, `title="The Mozilla homepage"`. This appears as a tooltip when a cursor hovers over the element.
- `target`
- : The `target` attribute specifies the browsing context used to display the link. For example, `target="_blank"` will display the link in a new tab. If you want to display the linked content in the current tab, just omit this attribute.
- `src`
- : The `src` attribute is a **required** attribute that specifies the location of the image. For example: `src="https://raw.githubusercontent.com/mdn/beginner-html-site/gh-pages/images/firefox-icon.png"`.
- `alt`
- : The `alt` attribute specifies a text description of the image. For example: `alt="The Firefox icon"`.
- `width`
- : The `width` attribute specifies the width of the image with the unit being pixels. For example: `width="300"`.
- `height`
- : The `height` attribute specifies the height of the image with the unit being pixels. For example: `height="300"`.

Edit the line below in the _Input_ area to turn it into a link to your favorite website.
Edit the line below in the _Input_ area to turn it into an image.

1. Add the `<a>` element.
2. Add the `href` attribute and the `title` attribute.
3. Specify the `target` attribute to open the link in the new tab.
1. Find your favorite image online, right click it, and press _Copy Image Link/Address_.
2. Back in the area below, add the `src` attribute and fill it with the link from step 1.
3. Set the `alt` attribute.
4. Add the `width` and `height` attributes.

You will be able to see your changes live in the _Output_ area. You should see a link—that when hovered over—displays the value of the `title` attribute and, when clicked, opens a new tab and navigates to the web address in the `href` attribute. Remember that you need to include a space between the element name and between each attribute.
You will be able to see your changes live in the _Output_ area.

If you make a mistake, you can always reset it using the _Reset_ button. If you get really stuck, press the _Show solution_ button to see the answer.

Expand All @@ -275,7 +278,7 @@ If you make a mistake, you can always reset it using the _Reset_ button. If you
</p>

<textarea id="code" class="input" style="min-height: 100px;width: 95%">
&lt;p&gt;A link to my favorite website.&lt;/p&gt;
&lt;img alt="I should be an image" &gt;
</textarea>

<div class="playable-buttons">
Expand Down Expand Up @@ -319,7 +322,7 @@ function updateCode() {
}

const htmlSolution =
'<p>A link to my <a href="https://www.mozilla.org/" title="The Mozilla homepage" target="_blank">favorite website</a>.</p>';
'<img src="https://raw.githubusercontent.com/mdn/beginner-html-site/gh-pages/images/firefox-icon.png" alt="Firefox icon" width="100" height="100" />';
let solutionEntry = htmlSolution;

reset.addEventListener("click", () => {
Expand Down Expand Up @@ -416,13 +419,13 @@ For reference, the example above also includes a non-disabled form input element

### Omitting quotes around attribute values

If you look at code for a lot of other sites, you might come across a number of strange markup styles, including attribute values without quotes. This is permitted in certain circumstances, but it can also break your markup in other circumstances. For example, if we revisit our link example from earlier, we could write a basic version with _only_ the `href` attribute, like this:
If you look at code for a lot of other sites, you might come across a number of strange markup styles, including attribute values without quotes. This is permitted in certain circumstances, but it can also break your markup in other circumstances. The element in the code snippet below, `<a>`, is called an anchor. Anchors enclose text and turn them into links. The `href` attribute specifies the web address the link points to. You can write this basic version below with _only_ the `href` attribute, like this:

```html
<a href=https://www.mozilla.org/>favorite website</a>
```

However, as soon as we add the `title` attribute in this way, there are problems:
Anchors can also have a `title` attribute, a description of the linked page. However, as soon as we add the `title` in the same fashion as the `href` attribute there are problems:

```html-nolint example-bad
<a href=https://www.mozilla.org/ title=The Mozilla homepage>favorite website</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ browser-compat: webextensions.manifest.optional_permissions
<pre class="brush: json">
"optional_permissions": [
"webRequest"
]</pre
>
]</pre>
</td>
</tr>
</tbody>
Expand Down Expand Up @@ -61,14 +60,17 @@ You can include any of the following here, but not in all browsers: check the co
- `background`
- `bookmarks`
- `browserSettings`
- `browsingData`
- `clipboardRead`
- `clipboardWrite`
- `contentSettings`
- `contextMenus`
- `cookies`
- `debugger`
- `devtools`
- `declarativeNetRequest`
- `declarativeNetRequestFeedback`
- `declarativeNetRequestWithHostAccess`
- `devtools`
- `downloads`
- `downloads.open`
- `find`
Expand All @@ -79,8 +81,11 @@ You can include any of the following here, but not in all browsers: check the co
- `nativeMessaging`
- `notifications`
- `pageCapture`
- `pkcs11`
- `privacy`
- `proxy`
- `scripting`
- `sessions`
- `tabHide`
- `tabs`
- `topSites`
Expand Down
40 changes: 0 additions & 40 deletions files/en-us/mozilla/firefox/experimental_features/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,46 +99,6 @@ HTML password input elements ([`<input type="password">`](/en-US/docs/Web/HTML/E
</tbody>
</table>

### Reflecting ARIA attributes

[ARIA](/en-US/docs/Web/Accessibility/ARIA) reflection is enabled for non-IDREF attributes which allows authors to get and set ARIA attributes on DOM elements directly via JavaScript APIs, rather than by using `setAttribute` and `getAttribute`, (see [Firefox bug 1824980](https://bugzil.la/1824980) for more details.)

<table>
<thead>
<tr>
<th>Release channel</th>
<th>Version added</th>
<th>Enabled by default?</th>
</tr>
</thead>
<tbody>
<tr>
<th>Nightly</th>
<td>114</td>
<td>Yes</td>
</tr>
<tr>
<th>Developer Edition</th>
<td>114</td>
<td>No</td>
</tr>
<tr>
<th>Beta</th>
<td>114</td>
<td>No</td>
</tr>
<tr>
<th>Release</th>
<td>114</td>
<td>No</td>
</tr>
<tr>
<th>Preference name</th>
<td colspan="2"><code>accessibility.ARIAReflection.enabled</code></td>
</tr>
</tbody>
</table>

## CSS

### Hex boxes to display stray control characters
Expand Down
2 changes: 2 additions & 0 deletions files/en-us/mozilla/firefox/releases/118/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ This article provides information about the changes in Firefox 118 that affect d

- The {{cssxref("font-synthesis-position")}} property and `position` value for {{cssxref("font-synthesis")}} shorthand property are now supported. These allow subscript and superscript typefaces to be disabled for fonts that do not have glyphs for them when using {{cssxref("font-variant-position")}} ([Firefox bug 1849010](https://bugzil.la/1849010)).
- Multiple CSS [math functions](/en-US/docs/Web/CSS/CSS_Functions#math_functions) are now supported: [`abs()`](/en-US/docs/Web/CSS/abs), [`sign()`](/en-US/docs/Web/CSS/sign), [`round()`](/en-US/docs/Web/CSS/round), [`mod()`](/en-US/docs/Web/CSS/mod), [`rem()`](/en-US/docs/Web/CSS/rem), [`pow()`](/en-US/docs/Web/CSS/pow), [`sqrt()`](/en-US/docs/Web/CSS/sqrt), [`hypot()`](/en-US/docs/Web/CSS/hypot), [`log()`](/en-US/docs/Web/CSS/log), and [`exp()`](/en-US/docs/Web/CSS/exp) (Firefox bug [1814589](https://bugzil.la/1814589)).
- A new keyword `from-font` in the CSS property [`font-size-adjust`](/en-US/docs/Web/CSS/font-size-adjust) enables picking the desired `<font-metric>` from the first available font (Firefox bug [1708240](https://bugzil.la/1708240)).
- The CSS property [`transform-box`](/en-US/docs/Web/CSS/transform-box) now supports the values `content-box` and `stroke-box`. For the reference box, the `content-box` value uses the [content box](/en-US/docs/Learn/CSS/Building_blocks/The_box_model#parts_of_a_box) and the `stroke-box` value uses the stroke bounding box that contains an SVG's shape (Firefox bug [1819464](https://bugzil.la/1819464)).
- The CSS property [`font-size-adjust`](/en-US/docs/Web/CSS/font-size-adjust) supports the keyword `from-font` that enables picking the desired `<font-metric>` from the first available font (Firefox bug [1708240](https://bugzil.la/1708240)).

### JavaScript
Expand Down
5 changes: 5 additions & 0 deletions files/en-us/mozilla/firefox/releases/119/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,14 @@ This article provides information about the changes in Firefox 119 that affect d
- The relative priority for send streams can now be specified by including the `sendOrder` property inside an options argument passed to [`WebTransport.createBidirectionalStream()`](/en-US/docs/Web/API/WebTransport/createBidirectionalStream) and [`WebTransport.createUnidirectionalStream()`](/en-US/docs/Web/API/WebTransport/createUnidirectionalStream) ([Firefox bug 1816925](https://bugzil.la/1816925)).
- The [`getAuthenticatorData()`](/en-US/docs/Web/API/AuthenticatorAttestationResponse/getAuthenticatorData), [`getPublicKeyAlgorithm()`](/en-US/docs/Web/API/AuthenticatorAttestationResponse/getPublicKeyAlgorithm), and [`getPublicKey()`](/en-US/docs/Web/API/AuthenticatorAttestationResponse/getPublicKey) methods of the [`AuthenticatorAttestationResponse`](/en-US/docs/Web/API/AuthenticatorAttestationResponse) interface are now supported (see [Firefox bug 1816519](https://bugzil.la/1816519) and [Firefox bug 1816520](https://bugzil.la/1816520)).
- The [Credential Properties Extension (`credProps`)](/en-US/docs/Web/API/Web_Authentication_API/WebAuthn_extensions#credprops) of the [Web Authentication API](/en-US/docs/Web/API/Web_Authentication_API) is supported, allowing users to query if credentials are discoverable after creation/registration ([Firefox bug 1844437](https://bugzil.la/1844437)).
- The [`SubtleCrypto.deriveKey()`](/en-US/docs/Web/API/SubtleCrypto/deriveKey) method now supports the [HKDF](/en-US/docs/Web/API/SubtleCrypto/deriveKey#hkdf) algorithm as an option for its [`derivedKeyAlgorithm`](/en-US/docs/Web/API/SubtleCrypto/deriveKey#derivedkeyalgorithm) parameter (see [Firefox bug 1851928](https://bugzil.la/1851928)).
- The {{domxref("PublicKeyCredential.parseCreationOptionsFromJSON_static", "parseCreationOptionsFromJSON()")}}, {{domxref("PublicKeyCredential.parseRequestOptionsFromJSON_static", "parseRequestOptionsFromJSON()")}}, and {{domxref("PublicKeyCredential.toJSON", "toJSON()")}} methods of the {{domxref("PublicKeyCredential")}} interface are now supported.
These are convenience methods for converting objects used for creating and sharing credentials objects to JSON representations that can be serialized/deserialized and shared with a server (see [Firefox bug 1823782](https://bugzil.la/1823782)).

#### DOM

- [ARIA](/en-US/docs/Web/Accessibility/ARIA) reflection is now supported by default for attributes that do not reference other elements; only non-IDREF attributes are reflected. You can now get and set ARIA attributes on DOM elements directly via JavaScript APIs, rather than by using `setAttribute` and `getAttribute`. For example, `buttonElement.ariaPressed = "true";` is now supported in addition to `buttonElement.setAttribute("aria-pressed", "true");` ([Firefox bug 1785412](https://bugzil.la/1785412)).

#### Media, WebRTC, and Web Audio

#### Removals
Expand Down
7 changes: 4 additions & 3 deletions files/en-us/web/api/client/postmessage/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,18 @@ message is received in the "`message`" event on

```js-nolint
postMessage(message)
postMessage(message, options)
postMessage(message, transferables)
```

### Parameters

- `message`
- : The message to send to the client. This can be any [structured-cloneable type](/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm).
- `options` {{optional_inline}}
- : An optional object containing a `transfer` field with an [array](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) of [transferable objects](/en-US/docs/Web/API/Web_Workers_API/Transferable_objects) to transfer ownership of. The ownership of these objects is given to the destination side and they are no longer usable on the sending side.
- `transferables` {{optional_inline}}
- : A sequence of objects that are [transferred](/en-US/docs/Web/API/Web_Workers_API/Transferable_objects) with the message. The
ownership of these objects is given to the destination side and they are no longer
usable on the sending side.
- : An optional [array](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) of [transferable objects](/en-US/docs/Web/API/Web_Workers_API/Transferable_objects) to transfer ownership of. The ownership of these objects is given to the destination side and they are no longer usable on the sending side.

### Return value

Expand Down
3 changes: 0 additions & 3 deletions files/en-us/web/api/contentindex/getall/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ Returns a {{jsxref("Promise")}} that resolves with an {{jsxref('Array')}} of

- `id`
- : A unique {{jsxref('String')}} identifier.
- `title`
- : A {{jsxref('String')}} title for the item.
Used in user-visible lists of content.
- `title`
- : A {{jsxref('String')}} title of the item.
Used in user-visible lists of content.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ A {{jsxref('Promise')}} which resolves with a {{domxref('FileSystemDirectoryHand

- `NotAllowedError` {{domxref("DOMException")}}
- : Thrown if {{domxref('PermissionStatus')}} is not 'granted'.
- {{jsxref("TypeError")}}
- : Thrown if the name specified is not a valid string or contains characters that would
interfere with the native file system.
- `TypeMismatchError` {{domxref("DOMException")}}
- : Thrown if the returned entry is a file and not a directory.
- `NotFoundError` {{domxref("DOMException")}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ browser-compat: api.ServiceWorkerContainer.controllerchange_event

{{APIRef("Service Workers API")}}

The **`controllerchange`** event of the
{{domxref("ServiceWorkerContainer")}} interface fires when the document's associated
{{domxref("ServiceWorkerRegistration")}} acquires a new
{{domxref("ServiceWorkerRegistration.active","active")}} worker.
The **`controllerchange`** event of the {{domxref("ServiceWorkerContainer")}} interface fires when the document's associated {{domxref("ServiceWorkerRegistration")}} acquires a new {{domxref("ServiceWorkerRegistration.active","active")}} worker.

## Syntax

Expand All @@ -30,7 +27,9 @@ A generic {{domxref("Event")}}.
## Example

```js
// TBD
navigator.serviceWorker.addEventListener("controllerchange", () => {
console.log("The controller of current browsing context has changed.");
});
```

## Specifications
Expand Down
12 changes: 6 additions & 6 deletions files/en-us/web/api/subtlecrypto/derivekey/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ deriveKey(algorithm, baseKey, derivedKeyAlgorithm, extractable, keyUsages)
- : An object defining the [derivation algorithm](#supported_algorithms) to use.
- To use [ECDH](#ecdh), pass an
[`EcdhKeyDeriveParams`](/en-US/docs/Web/API/EcdhKeyDeriveParams) object.
- To use [HKDF](#hkdf), pass
an [`HkdfParams`](/en-US/docs/Web/API/HkdfParams) object.
- To use [HKDF](#hkdf), pass an [`HkdfParams`](/en-US/docs/Web/API/HkdfParams) object.
- To use [PBKDF2](#pbkdf2), pass
a [`Pbkdf2Params`](/en-US/docs/Web/API/Pbkdf2Params) object.
- `baseKey`
Expand All @@ -42,12 +41,13 @@ deriveKey(algorithm, baseKey, derivedKeyAlgorithm, extractable, keyUsages)
`CryptoKey` using
[`SubtleCrypto.importKey()`](/en-US/docs/Web/API/SubtleCrypto/importKey).
- `derivedKeyAlgorithm`
- : An object defining the algorithm the derived key will be used for.
- For [HMAC](/en-US/docs/Web/API/SubtleCrypto/sign#hmac): pass an
[`HmacKeyGenParams`](/en-US/docs/Web/API/HmacKeyGenParams) object.
- : An object defining the algorithm the derived key will be used for:
- For [HMAC](/en-US/docs/Web/API/SubtleCrypto/sign#hmac) pass an [`HmacKeyGenParams`](/en-US/docs/Web/API/HmacKeyGenParams) object.
- For [AES-CTR](/en-US/docs/Web/API/SubtleCrypto/encrypt#aes-ctr), [AES-CBC](/en-US/docs/Web/API/SubtleCrypto/encrypt#aes-cbc),
[AES-GCM](/en-US/docs/Web/API/SubtleCrypto/encrypt#aes-gcm), or [AES-KW](/en-US/docs/Web/API/SubtleCrypto/wrapKey#aes-kw): pass an
[AES-GCM](/en-US/docs/Web/API/SubtleCrypto/encrypt#aes-gcm), or [AES-KW](/en-US/docs/Web/API/SubtleCrypto/wrapKey#aes-kw), pass an
[`AesKeyGenParams`](/en-US/docs/Web/API/AesKeyGenParams) object.
- For [HKDF](#hkdf), pass an [`HkdfParams`](/en-US/docs/Web/API/HkdfParams) object.
- For [PBKDF2](#pbkdf2), pass a [`Pbkdf2Params`](/en-US/docs/Web/API/Pbkdf2Params) object.
- `extractable`
- : A boolean value indicating whether it
will be possible to export the key using {{domxref("SubtleCrypto.exportKey()")}} or
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Behind the scenes, the inputs are processed by the user agent and/or the authent

For example, in a `publicKey` object for a `create()` call, we might want to request the use of two extensions:

1. The `credProps` extension. Relying parties set `credProps` to request that the browser tells the relying party whether the credential is resident/discoverable after registration. This is useful when calling `create()` with `publicKey.authenticatorSelection.residentKey = "preferred"`. To request it, you also need to set `publicKey.extensions.credProps = true` when. The browser makes a credential and, depending on the type of authenticator used, it will be discoverable (for example, the FIDO2 authenticator would typically make it discoverable; FIDO1/U2F security key would be non-discoverable). `credProps` is processed by the user agent only.
1. The `credProps` extension. Relying parties set `credProps` to request that the browser tells the relying party whether the credential is resident/discoverable after registration. This is useful when calling `create()` with `publicKey.authenticatorSelection.residentKey = "preferred"`. To request it, you also need to set `publicKey.extensions.credProps = true` when the browser makes a credential and, depending on the type of authenticator used, it will be discoverable (for example, the FIDO2 authenticator would typically make it discoverable; FIDO1/U2F security key would be non-discoverable). `credProps` is processed by the user agent only.
2. The `minPinLength` extension allows relying parties to request the authenticator's minimum PIN length. This requires `extensions.minPinLength` to be set to `true`. `minPinLength` is processed by the authenticator, with the user agent only serving to pass the input data along to it.

```js
Expand Down
Loading

0 comments on commit 0e5c275

Please sign in to comment.