Skip to content

Commit

Permalink
update to htmlsourceelement based on review
Browse files Browse the repository at this point in the history
  • Loading branch information
estelle committed Nov 26, 2024
1 parent 113b694 commit cfdf7d8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion files/en-us/web/api/htmlsourceelement/media/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ browser-compat: api.HTMLSourceElement.media

{{APIRef("HTML DOM")}}

The **`media`** property of the {{domxref("HTMLSourceElement")}} interface is a string representing a list of one or more media formats to which the resource applies.
The **`media`** property of the {{domxref("HTMLSourceElement")}} interface is a string representing the intended destination medium for the resource. The value is a [media query](/en-US/docs/Web/CSS/CSS_media_queries/Using_media_queries), which is a comma separated list of media-types, media-features, and logical operators.

It reflects the `media` attribute of the {{HTMLElement("source")}} element.

Expand Down Expand Up @@ -50,3 +50,4 @@ el.media = "(min-width: 800px)"; // Updates the media value
- {{htmlelement("picture")}}
- {{htmlelement("audio")}}
- {{htmlelement("video")}}
- [Using media queries](/en-US/docs/Web/CSS/CSS_media_queries/Using_media_queries)
6 changes: 4 additions & 2 deletions files/en-us/web/api/htmlsourceelement/srcset/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ browser-compat: api.HTMLSourceElement.srcset

{{APIRef("HTML DOM")}}

The **`srcset`** property of the {{domxref("HTMLSourceElement")}} interface is a string containing a comma-separated list of candidate images and descriptors. Each list item in the comma-separated list includes the URL of an image resource to use as the source for the element and the circumstances under which that image should be used. Each image in the comma selist one or more image URLs and their descriptorseach specifying image resources to use under given circumstances. Each candidate image is a URL followed by the width of the image with a `'w'` or the pixel density with an `'x'`.
The **`srcset`** property of the {{domxref("HTMLSourceElement")}} interface is a string containing a comma-separated list of candidate images.

It reflects the `srcset` attribute of the {{HTMLElement("source")}} element nested in a {{htmlelement("picture")}} element. It has no meaning and is ignored when it is nested in an {{htmlelement("audio")}} or {{htmlelement("video")}} element, which use the {{domxref("HTMLSourceElement.src", "src")}} instead.
Each candidate image includes the URL of an image resource to use as the source for the element and optionally a descriptor indicating the circumstances in which the image should be used. The descriptor is either a number followed by `'w'`, indicating the element width, or a number followed by `'x'`, indicating the device pixel density.

It reflects the `srcset` attribute of the {{HTMLElement("source")}} element nested in a {{htmlelement("picture")}} element. It has no meaning and is ignored when it is nested in an {{htmlelement("audio")}} or {{htmlelement("video")}} element, which use the {{domxref("HTMLSourceElement.src", "src")}} attribute instead.

## Value

Expand Down
3 changes: 1 addition & 2 deletions files/en-us/web/api/htmlsourceelement/type/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ browser-compat: api.HTMLSourceElement.type

{{APIRef("HTML DOM")}}

The **`type`** property of the {{domxref("HTMLSourceElement")}} interface is a string representing the type of media of the resource.
The **`type`** property of the {{domxref("HTMLSourceElement")}} interface is a string representing the {{glossary("MIME type")}} of the media resource.

It reflects the `type` attribute of the {{HTMLElement("source")}} element.

Expand All @@ -29,7 +29,6 @@ A string.
```js
const el = document.getElementById("el");
console.log(el.type); // Output: "video/webp"
el.type = "image/webp"; // Updates the type value
```

## Specifications
Expand Down

0 comments on commit cfdf7d8

Please sign in to comment.