Skip to content

Commit

Permalink
Add experimental features for Fx 122: shadowrootmode, async clipboard (
Browse files Browse the repository at this point in the history
…mdn#31612)

* Add experimental features for Fx 122

* Apply suggestions from code review

Co-authored-by: Brian Thomas Smith <[email protected]>

* Use simpler list

* Apply suggestions from code review

Co-authored-by: Brian Thomas Smith <[email protected]>

* Add Intl.Segmenter

* Apply suggestions from code review

Co-authored-by: Brian Thomas Smith <[email protected]>

* Bold the titles

---------

Co-authored-by: Brian Thomas Smith <[email protected]>
  • Loading branch information
2 people authored and dipikabh committed Jan 17, 2024
1 parent 6da582a commit f238918
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
40 changes: 40 additions & 0 deletions files/en-us/mozilla/firefox/experimental_features/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,46 @@ HTML password input elements ([`<input type="password">`](/en-US/docs/Web/HTML/E
</tbody>
</table>

### Declarative shadow DOM

The {{htmlelement("template")}} element now supports a `shadowrootmode` attribute which can be set to either `open` or `closed`, the same values as the `mode` option of the {{domxref("Element.attachShadow()", "attachShadow()")}} method. It allows the creation of a shadow DOM subtree declaratively. (See [Firefox bug 1712140](https://bugzil.la/1712140) 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>122</td>
<td>Yes</td>
</tr>
<tr>
<th>Developer Edition</th>
<td>122</td>
<td>No</td>
</tr>
<tr>
<th>Beta</th>
<td>122</td>
<td>No</td>
</tr>
<tr>
<th>Release</th>
<td>122</td>
<td>No</td>
</tr>
<tr>
<th>Preference name</th>
<td colspan="2"><code>dom.webcomponents.shadowdom.declarative.enabled</code></td>
</tr>
</tbody>
</table>

## CSS

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

These features are newly shipped in Firefox 122 but are disabled by default. To experiment with them, search for the appropriate preference on the `about:config` page and set it to `true`. You can find more such features on the [Experimental features](/en-US/docs/Mozilla/Firefox/Experimental_features) page.

- **Declarative shadow DOM:** `dom.webcomponents.shadowdom.declarative.enabled`.

The {{htmlelement("template")}} element now supports a `shadowrootmode` attribute which can be set to either `open` or `closed`, the same values as the `mode` option of the {{domxref("Element.attachShadow()", "attachShadow()")}} method. It allows the creation of a shadow DOM subtree declaratively. ([Firefox bug 1712140](https://bugzil.la/1712140))

- **Popover API:** `dom.element.popover.enabled`.

Displaying popovers on top of page content is now supported via HTML attributes or JavaScript API, including styling with the CSS [`:popover-open`](/en-US/docs/Web/CSS/:popover-open) pseudo-class and extended support for the [`::backdrop`](/en-US/docs/Web/CSS/::backdrop) pseudo-element. See the [Popover API](/en-US/docs/Web/API/Popover_API) reference for more details. ([Firefox bug 1823757](https://bugzil.la/1823757))

- **Clipboard read and write:** `dom.events.asyncClipboard.clipboardItem`, `dom.events.asyncClipboard.readText` and `dom.events.asyncClipboard.writeText`.

The async {{domxref('Clipboard API')}} is now fully supported, including [`read()`](/en-US/docs/Web/API/Clipboard/read), [`readText()`](/en-US/docs/Web/API/Clipboard/readText), and [`write()`](/en-US/docs/Web/API/Clipboard/write) methods and the {{domxref('ClipboardItem')}} interface. A paste context menu will appear for the user to confirm when reading clipboard data not provided by the same-origin page. ([Firefox bug 1809106](https://bugzil.la/1809106))

- **`Intl.Segmenter`:** enabled by default only in Firefox Nightly.

The {{jsxref("Intl.Segmenter")}} object allows accurate locale-sensitive text segmentation of a string. For example, to split a text into words in a language that doesn't use spaces to separate them: `Intl.Segmenter("ja-JP", { granularity: "word" })`. ([Firefox bug 1423593](https://bugzil.la/1423593))

## Older versions

{{Firefox_for_developers(121)}}

0 comments on commit f238918

Please sign in to comment.