Skip to content

Conversation

@youennf
Copy link
Contributor

@youennf youennf commented Apr 15, 2025

Fixes #346


Preview | Diff

index.bs Outdated
<dfn>preferred artwork image</dfn> from <var>metadata</var>'s
{{MediaMetadata/artwork}} of the <a>active media session</a>.
</li>
<li>Let <var>request</var> be a new [=request=] whose URL is the
Copy link
Member

Choose a reason for hiding this comment

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

You should probably use [=request/URL=], [=request/mode=] and such here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

index.bs Outdated
{{MediaMetadata/artwork}} of the <a>active media session</a>.
</li>
<li>Let <var>request</var> be a new [=request=] whose URL is the
<a>preferred artwork image</a>'s {{MediaImage/src}}, destination
Copy link
Member

Choose a reason for hiding this comment

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

This state seems to come out of nowhere? Also, it looks like MediaImage/src is a string that needs to be parsed into a URL first? What happens if that fails?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

src is being parsed when setting the metadata. It is true it is a bit confusing since {{MediaImage/src}} here contains a properly parsed URL and not a USVString. Maybe there is a better way of doing things.

@youennf youennf force-pushed the clarify-fetch-algorithm branch from 4def6b7 to 9dc2811 Compare April 15, 2025 14:32
@youennf youennf requested a review from annevk April 16, 2025 08:23
Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

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

I guess reworking that has to be a follow-up, but you can't just assign the result of the URL parser to a dictionary member that contains a string. It would be better if you had some specification-internal struct (https://infra.spec.whatwg.org/#structs) to hold the data after processing.

Another thing that seems broken is the amount of ambient state. The fetch image algorithm has no parameters, but somehow has access to all kinds of state.

But the change in question here seems reasonable amid the questionable things.

@youennf
Copy link
Contributor Author

youennf commented Apr 17, 2025

@steimelchrome, any thoughts?
I think this matches Chrome behavior as well, validation would be good.

It would be better if you had some specification-internal struct

Yep agreed.
I'll do a follow up based on #360.

The fetch image algorithm has no parameters, but somehow has access to all kinds of state.

Do you mean that this algorithm should take a MediaSession object as input for instance?

@annevk
Copy link
Member

annevk commented Apr 17, 2025

Yeah probably, it needs something to start its operations from and communicate back to.

Copy link
Contributor

@steimelchrome steimelchrome left a comment

Choose a reason for hiding this comment

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

Sorry for the delay was OOO for a bit. Yep, this looks reasonable to me. Thanks!

@youennf youennf merged commit d9f088f into w3c:main Apr 30, 2025
2 checks passed
github-actions bot added a commit that referenced this pull request Apr 30, 2025
…tion and mode. (#359)

SHA: d9f088f
Reason: push, by youennf

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The use of the fetch algorithm for image resources is optional and underspecified

3 participants