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
2 changes: 1 addition & 1 deletion files/en-us/web/api/element/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ _`Element` inherits methods from its parents {{DOMxRef("Node")}}, and its own pa
- : Sets the value of the attribute with the specified name and namespace, from the current node.
- {{DOMxRef("Element.setCapture()")}} {{Non-standard_Inline}} {{Deprecated_Inline}}
- : Sets up mouse event capture, redirecting all mouse events to this element.
- {{DOMxRef("Element.setHTML()")}} {{SecureContext_Inline}} {{experimental_inline}}
- {{DOMxRef("Element.setHTML()")}} {{SecureContext_Inline}}
- : Parses and [sanitizes](/en-US/docs/Web/API/HTML_Sanitizer_API) a string of HTML into a document fragment, which then replaces the element's original subtree in the DOM.
- {{DOMxRef("Element.setHTMLUnsafe()")}}
- : Parses a string of HTML into a document fragment, without sanitization, which then replaces the element's original subtree in the DOM. The HTML string may include declarative shadow roots, which would be parsed as template elements if the HTML was set using [`Element.innerHTML`](/en-US/docs/Web/API/Element/innerHTML).
Expand Down
4 changes: 1 addition & 3 deletions files/en-us/web/api/element/sethtml/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ title: "Element: setHTML() method"
short-title: setHTML()
slug: Web/API/Element/setHTML
page-type: web-api-instance-method
status:
- experimental
browser-compat: api.Element.setHTML
---

{{APIRef("HTML Sanitizer API")}}{{SeeCompatTable}}
{{APIRef("HTML Sanitizer API")}}

The **`setHTML()`** method of the {{domxref("Element")}} interface provides an XSS-safe method to parse and sanitize a string of HTML and insert it into the DOM as a subtree of the element.

Expand Down
6 changes: 2 additions & 4 deletions files/en-us/web/api/html_sanitizer_api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
title: HTML Sanitizer API
slug: Web/API/HTML_Sanitizer_API
page-type: web-api-overview
status:
- experimental
browser-compat: api.Sanitizer
---

{{DefaultAPISidebar("HTML Sanitizer API")}}{{SeeCompatTable}}
{{DefaultAPISidebar("HTML Sanitizer API")}}

The **HTML Sanitizer API** allows developers to take strings of HTML and filter out unwanted elements, attributes, and other HTML entities when they are inserted into the DOM or a shadow DOM.

Expand Down Expand Up @@ -219,7 +217,7 @@ They may be useful with the unsafe HTML methods and trusted types, depending on

## Interfaces

- {{domxref('Sanitizer')}} {{experimental_inline}}
- {{domxref('Sanitizer')}}
- : A reusable sanitizer configuration object that defines what elements and attributes should be allowed/removed when sanitizing untrusted strings of HTML.
This is used in the methods that insert strings of HTML into the DOM or Document.
- {{domxref('SanitizerConfig')}}
Expand Down
4 changes: 1 addition & 3 deletions files/en-us/web/api/sanitizer/allowattribute/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ title: "Sanitizer: allowAttribute() method"
short-title: allowAttribute()
slug: Web/API/Sanitizer/allowAttribute
page-type: web-api-instance-method
status:
- experimental
browser-compat: api.Sanitizer.allowAttribute
---

{{APIRef("HTML Sanitizer API")}}{{SeeCompatTable}}
{{APIRef("HTML Sanitizer API")}}

The **`allowAttribute()`** method of the {{domxref("Sanitizer")}} interface sets an attribute to be allowed on all elements when the sanitizer is used.

Expand Down
4 changes: 1 addition & 3 deletions files/en-us/web/api/sanitizer/allowelement/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ title: "Sanitizer: allowElement() method"
short-title: allowElement()
slug: Web/API/Sanitizer/allowElement
page-type: web-api-instance-method
status:
- experimental
browser-compat: api.Sanitizer.allowElement
---

{{APIRef("HTML Sanitizer API")}}{{SeeCompatTable}}
{{APIRef("HTML Sanitizer API")}}

The **`allowElement()`** method of the {{domxref("Sanitizer")}} interface sets that the specified element is allowed in the output when the sanitizer is used.

Expand Down
4 changes: 1 addition & 3 deletions files/en-us/web/api/sanitizer/get/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ title: "Sanitizer: get() method"
short-title: get()
slug: Web/API/Sanitizer/get
page-type: web-api-instance-method
status:
- experimental
browser-compat: api.Sanitizer.get
---

{{APIRef("HTML Sanitizer API")}}{{SeeCompatTable}}
{{APIRef("HTML Sanitizer API")}}

The **`get()`** method of the {{domxref("Sanitizer")}} interface returns a {{domxref('SanitizerConfig')}} dictionary instance that represents the current `Sanitizer` configuration.

Expand Down
24 changes: 11 additions & 13 deletions files/en-us/web/api/sanitizer/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
title: Sanitizer
slug: Web/API/Sanitizer
page-type: web-api-interface
status:
- experimental
browser-compat: api.Sanitizer
---

{{APIRef("HTML Sanitizer API")}}{{SeeCompatTable}}
{{APIRef("HTML Sanitizer API")}}

The **`Sanitizer`** interface of the [HTML Sanitizer API](/en-US/docs/Web/API/HTML_Sanitizer_API) defines a configuration object that specifies what elements, attributes and comments are allowed or should be removed when inserting strings of HTML into an {{domxref("Element")}} or {{domxref("ShadowRoot")}}, or when parsing an HTML string into a {{domxref("Document")}}.

Expand All @@ -21,28 +19,28 @@ Note that `Sanitizer` is expected to be more efficient to reuse and modify when

## Constructors

- {{domxref("Sanitizer.Sanitizer", "Sanitizer()")}} {{experimental_inline}}
- {{domxref("Sanitizer.Sanitizer", "Sanitizer()")}}
- : Creates and returns a `Sanitizer` object, optionally with custom sanitization behavior defined in a {{domxref('SanitizerConfig')}}.

## Instance methods

- {{domxref('Sanitizer.allowElement()')}} {{experimental_inline}}
- {{domxref('Sanitizer.allowElement()')}}
- : Sets an element as allowed by the sanitizer, optionally with an array of attributes that are allowed or disallowed.
- {{domxref('Sanitizer.get()')}} {{experimental_inline}}
- {{domxref('Sanitizer.get()')}}
- : Returns the current `Sanitizer` configuration as a {{domxref('SanitizerConfig')}} dictionary instance.
- {{domxref('Sanitizer.removeElement()')}} {{experimental_inline}}
- {{domxref('Sanitizer.removeElement()')}}
- : Sets an element to be removed by the sanitizer.
- {{domxref('Sanitizer.removeUnsafe()')}} {{experimental_inline}}
- {{domxref('Sanitizer.removeUnsafe()')}}
- : Updates the sanitizer configuration so that it will remove any XSS-unsafe HTML.
- {{domxref('Sanitizer.replaceElementWithChildren()')}} {{experimental_inline}}
- {{domxref('Sanitizer.replaceElementWithChildren()')}}
- : Sets an element to be replaced by its child HTML elements.
- {{domxref('Sanitizer.allowAttribute()')}} {{experimental_inline}}
- {{domxref('Sanitizer.allowAttribute()')}}
- : Sets an attribute as allowed on any element.
- {{domxref('Sanitizer.removeAttribute()')}} {{experimental_inline}}
- {{domxref('Sanitizer.removeAttribute()')}}
- : Sets an attribute to be removed from any element.
- {{domxref('Sanitizer.setComments()')}} {{experimental_inline}}
- {{domxref('Sanitizer.setComments()')}}
- : Sets whether comments will be allowed or removed by the sanitizer.
- {{domxref('Sanitizer.setDataAttributes()')}} {{experimental_inline}}
- {{domxref('Sanitizer.setDataAttributes()')}}
- : Sets whether data attributes on elements will be allowed or removed by the sanitizer.

## Examples
Expand Down
4 changes: 1 addition & 3 deletions files/en-us/web/api/sanitizer/removeattribute/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ title: "Sanitizer: removeAttribute() method"
short-title: removeAttribute()
slug: Web/API/Sanitizer/removeAttribute
page-type: web-api-instance-method
status:
- experimental
browser-compat: api.Sanitizer.removeAttribute
---

{{APIRef("HTML Sanitizer API")}}{{SeeCompatTable}}
{{APIRef("HTML Sanitizer API")}}

The **`removeAttribute()`** method of the {{domxref("Sanitizer")}} interface sets an attribute to be removed from all elements when the sanitizer is used.

Expand Down
4 changes: 1 addition & 3 deletions files/en-us/web/api/sanitizer/removeelement/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ title: "Sanitizer: removeElement() method"
short-title: removeElement()
slug: Web/API/Sanitizer/removeElement
page-type: web-api-instance-method
status:
- experimental
browser-compat: api.Sanitizer.removeElement
---

{{APIRef("HTML Sanitizer API")}}{{SeeCompatTable}}
{{APIRef("HTML Sanitizer API")}}

The **`removeElement()`** method of the {{domxref("Sanitizer")}} interface sets the specified element be removed from the output when the sanitizer is used.

Expand Down
4 changes: 1 addition & 3 deletions files/en-us/web/api/sanitizer/removeunsafe/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ title: "Sanitizer: removeUnsafe() method"
short-title: removeUnsafe()
slug: Web/API/Sanitizer/removeUnsafe
page-type: web-api-instance-method
status:
- experimental
browser-compat: api.Sanitizer.removeUnsafe
---

{{APIRef("HTML Sanitizer API")}}{{SeeCompatTable}}
{{APIRef("HTML Sanitizer API")}}

The **`removeUnsafe()`** method of the {{domxref("Sanitizer")}} interface configures the sanitizer configuration so that it will remove all elements, attributes, and event handler content attributes that are considered XSS-unsafe by the browser.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ title: "Sanitizer: replaceElementWithChildren() method"
short-title: replaceElementWithChildren()
slug: Web/API/Sanitizer/replaceElementWithChildren
page-type: web-api-instance-method
status:
- experimental
browser-compat: api.Sanitizer.replaceElementWithChildren
---

{{APIRef("HTML Sanitizer API")}}{{SeeCompatTable}}
{{APIRef("HTML Sanitizer API")}}

The **`replaceElementWithChildren()`** method of the {{domxref("Sanitizer")}} interface sets an element to be replaced by its child HTML elements when the sanitizer is used.
This is primarily used for stripping styles from text.
Expand Down
4 changes: 1 addition & 3 deletions files/en-us/web/api/sanitizer/sanitizer/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ title: "Sanitizer: Sanitizer() constructor"
short-title: Sanitizer()
slug: Web/API/Sanitizer/Sanitizer
page-type: web-api-constructor
status:
- experimental
browser-compat: api.Sanitizer.Sanitizer
---

{{APIRef("HTML Sanitizer API")}}{{SeeCompatTable}}
{{APIRef("HTML Sanitizer API")}}

The **`Sanitizer()`** constructor creates a new {{domxref("Sanitizer")}} object, which can be used to filter unwanted elements and attributes from HTML or documents before they are inserted/parsed into the DOM.

Expand Down
4 changes: 1 addition & 3 deletions files/en-us/web/api/sanitizer/setcomments/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ title: "Sanitizer: setComments() method"
short-title: setComments()
slug: Web/API/Sanitizer/setComments
page-type: web-api-instance-method
status:
- experimental
browser-compat: api.Sanitizer.setComments
---

{{APIRef("HTML Sanitizer API")}}{{SeeCompatTable}}
{{APIRef("HTML Sanitizer API")}}

The **`setComments()`** method of the {{domxref("Sanitizer")}} interface sets whether comments will be allowed or removed by the sanitizer.

Expand Down
4 changes: 1 addition & 3 deletions files/en-us/web/api/sanitizer/setdataattributes/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ title: "Sanitizer: setDataAttributes() method"
short-title: setDataAttributes()
slug: Web/API/Sanitizer/setDataAttributes
page-type: web-api-instance-method
status:
- experimental
browser-compat: api.Sanitizer.setDataAttributes
---

{{APIRef("HTML Sanitizer API")}}{{SeeCompatTable}}
{{APIRef("HTML Sanitizer API")}}

The **`setDataAttributes()`** method of the {{domxref("Sanitizer")}} interface sets whether all [`data-*` attributes](/en-US/docs/Web/HTML/Reference/Global_attributes/data-*) will be allowed by the sanitizer, or if they must be individually specified.

Expand Down
4 changes: 1 addition & 3 deletions files/en-us/web/api/sanitizerconfig/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@
title: SanitizerConfig
slug: Web/API/SanitizerConfig
page-type: web-api-interface
status:
- experimental
browser-compat:
- api.Sanitizer.get
- api.Sanitizer.Sanitizer
---

{{APIRef("HTML Sanitizer API")}}{{SeeCompatTable}}
{{APIRef("HTML Sanitizer API")}}

The **`SanitizerConfig`** dictionary of the [HTML Sanitizer API](/en-US/docs/Web/API/HTML_Sanitizer_API) specifies what elements, attributes and comments are allowed or should be removed when inserting strings of HTML into an {{domxref("Element")}} or {{domxref("ShadowRoot")}}, or when parsing an HTML string into a {{domxref("Document")}}.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@
title: font-stretch
slug: Web/CSS/Reference/At-rules/@font-face/font-stretch
page-type: css-at-rule-descriptor
status:
- deprecated
browser-compat: css.at-rules.font-face.font-stretch
sidebar: cssref
---

{{deprecated_header}}

> [!NOTE]
> The `font-stretch` descriptor was renamed to `font-width` in the [CSS Fonts specification](https://drafts.csswg.org/css-fonts/#font-stretch-desc). To preserve compatibility, the specification retains `font-stretch` as an alias for the `font-width` descriptor.

Expand Down
12 changes: 5 additions & 7 deletions files/en-us/web/css/reference/properties/flex-basis/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,22 +217,20 @@ We include two same-structure flex containers, which will be styled similarly ex
<div class="container basis-0">
<div>heading</div>
<section>
flex-basis: 0;
<div class="content"></div>
<div class="content">flex-basis: 0;</div>
</section>
</div>
<div class="container basis-0-percent">
<div>heading</div>
<section>
flex-basis: 0%;
<div class="content"></div>
<div class="content">flex-basis: 0%;</div>
</section>
</div>
```

#### CSS

We style the containers as inline flex containers that will appear side by side to better enable comparing them. We set the `flex-direction` to `column`. The first container's flex items have a `flex-basis` value of `0`, while the second container's flex items have a `flex-basis` value of `0%`. Neither the flex containers nor their flex items have a height explicitly set, but the heights of `section` elements cannot exceed `200px` and their children have a height of `300px`.
We style the containers as inline flex containers that will appear side by side to better enable comparing them. We set the `flex-direction` to `column`. The first container's flex items have a `flex-basis` value of `0`, while the second container's flex items have a `flex-basis` value of `0%`. Neither the flex containers nor their flex items have a height explicitly set; however, the heights of `section` elements must be at least `200px`, and their children have a height of `300px`.

```css
.container {
Expand All @@ -245,7 +243,7 @@ We style the containers as inline flex containers that will appear side by side
}

section {
border: 1px solid red;
outline: 1px solid red;

overflow: auto;
min-height: 200px;
Expand All @@ -268,7 +266,7 @@ section {

{{EmbedLiveSample('flex_basis_0_vs_0', '100%', '400')}}

In the first container, with `flex-basis: 0`, the `<section>` element has an initial main size of zero, and it grows to the `200px` height limit. In the second container, with `flex-basis: 0%`, the `<section>` element has an initial main size of `300px` because, as the flex container doesn't have a set height, the percentage flex-basis values resolve to the [`content`](#content) value.
In the first container, with `flex-basis: 0`, the `<section>` element has an initial main size of zero, and it grows to the `200px` minimum height. In the second container, with `flex-basis: 0%`, the `<section>` element has an initial main size of `300px` because, as the flex container doesn't have a set height, the percentage flex-basis values resolve to the [`content`](#content) value.

## Specifications

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@
title: font-stretch
slug: Web/CSS/Reference/Properties/font-stretch
page-type: css-property
status:
- deprecated
browser-compat: css.properties.font-stretch
sidebar: cssref
---

{{deprecated_header}}

> [!NOTE]
> The `font-stretch` property was renamed to `font-width` in the [CSS Fonts specification](https://drafts.csswg.org/css-fonts/#font-stretch-prop). To preserve compatibility, the specification retains `font-stretch` as an alias for the `font-width` property.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Third-party usage can be selectively enabled using the `allow` attribute on {{HT
This HTTP response header disables compute pressure completely:

```http
Permissions-Policy: {"compute-pressure": []}
Permissions-Policy: compute-pressure=()
```

## Specifications
Expand Down
Loading