Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New pages: HTMLSourceElement api pages #36855

Merged
merged 4 commits into from
Nov 26, 2024
Merged

New pages: HTMLSourceElement api pages #36855

merged 4 commits into from
Nov 26, 2024

Conversation

estelle
Copy link
Member

@estelle estelle commented Nov 19, 2024

@estelle estelle requested a review from a team as a code owner November 19, 2024 01:30
@estelle estelle requested review from wbamberg and removed request for a team November 19, 2024 01:30
@github-actions github-actions bot added the Content:WebAPI Web API docs label Nov 19, 2024
@github-actions github-actions bot added the size/m [PR only] 51-500 LoC changed label Nov 19, 2024
Copy link
Contributor

github-actions bot commented Nov 19, 2024


{{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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a list of media formats, is it? It is a media query for the resource (as the example shows).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i copied it from htmllinkelement, which should be updated (not in this PR). changed to:

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, which is a comma separated list of media-types, media-features, and logical operators.

files/en-us/web/api/htmlsourceelement/srcset/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/htmlsourceelement/srcset/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/htmlsourceelement/type/index.md Outdated Show resolved Hide resolved
```js
const el = document.getElementById("el");
console.log(el.type); // Output: "video/webp"
el.type = "image/webp"; // Updates the type value
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This (updating the type for an element) seems like a strange thing to do? Maybe more likely would be to create a new source element from scratch?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed it.

Copy link
Member Author

@estelle estelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

THanks @wbamberg


{{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.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i copied it from htmllinkelement, which should be updated (not in this PR). changed to:

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, which is a comma separated list of media-types, media-features, and logical operators.

```js
const el = document.getElementById("el");
console.log(el.type); // Output: "video/webp"
el.type = "image/webp"; // Updates the type value
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed it.

Copy link
Collaborator

@wbamberg wbamberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 looks great.

@wbamberg wbamberg merged commit da9701a into main Nov 26, 2024
9 checks passed
@wbamberg wbamberg deleted the HTMLSourceElement branch November 26, 2024 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs size/m [PR only] 51-500 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants