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

Honor media HTML attribute for link icon #495

Closed
beaufortfrancois opened this issue Mar 3, 2021 · 10 comments
Closed

Honor media HTML attribute for link icon #495

beaufortfrancois opened this issue Mar 3, 2021 · 10 comments
Labels
venue: WHATWG Specifications in a WHATWG Workstream

Comments

@beaufortfrancois
Copy link

Request for Mozilla Position on an Emerging Web Specification

Other information

Browsers don’t currently honor the media attribute for link[rel="icon"] even though the HTML specification says they should.

Icons could be auditory icons, visual icons, or other kinds of icons. If multiple icons are provided, the user agent must select the most appropriate icon according to the type, media, and sizes attributes.

Members of the Google Chrome team are thinking of honoring the link element’s "media" attribute for link[rel="icon"] so that web developers can define multiple equally appropriate icons based on a media query (dark and light modes for instance). The last one that matches will be picked.

@annevk
Copy link
Contributor

annevk commented Mar 3, 2021

@beaufortfrancois if you take the definition literally, it's not just a decision you make when fetching. So resizing the window would have to change the icon. Is that what you are planning on doing? If not, some changes might be needed here. Either way it seems somewhat reasonable to support this.

cc @emilio

@annevk annevk added the venue: WHATWG Specifications in a WHATWG Workstream label Mar 3, 2021
@beaufortfrancois
Copy link
Author

I'm not sure the spec should define which media features should affect the favicon displayed in the browser tab.

As noted in the HTML spec as well,

User agents are not required to update icons when the list of icons changes, but are encouraged to do so.

@domenic
Copy link
Contributor

domenic commented Mar 3, 2021

Wait, what is this issue about then, if not the favicon displayed in the browser tab? What do you think the spec is taking about, if not that?

@annevk
Copy link
Contributor

annevk commented Mar 3, 2021

I don't think "matches the environment" has wiggle room to ignore certain media features.

I also don't think the list of icons actually changes in this case, but the processing model is not as clear as it could be.

@beaufortfrancois
Copy link
Author

@beaufortfrancois if you take the definition literally, it's not just a decision you make when fetching. So resizing the window would have to change the icon. Is that what you are planning on doing? If not, some changes might be needed here. Either way it seems somewhat reasonable to support this.

Indeed, Chrome will update icons when media features change (e.g. dark/light mode change, viewport resize).

@annevk
Copy link
Contributor

annevk commented Mar 4, 2021

Thanks for clarifying. I think this is worth prototyping, but I'm not entirely sure it's worth adding it to the dashboard...

@beaufortfrancois
Copy link
Author

Which dashboard sorry?

@annevk
Copy link
Contributor

annevk commented Mar 4, 2021

https://mozilla.github.io/standards-positions/. More of a thing we need to sort out with requests for positions on relatively minor features.

@beaufortfrancois
Copy link
Author

FYI I've just sent an intent to ship at https://groups.google.com/a/chromium.org/g/blink-dev/c/OwUSsHWokpA

@annevk
Copy link
Contributor

annevk commented Mar 4, 2021

I'll close this next week. If anyone doesn't think this is worth prototyping, now would be a good time to weigh in.

@annevk annevk closed this as completed Mar 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
venue: WHATWG Specifications in a WHATWG Workstream
Projects
None yet
Development

No branches or pull requests

3 participants