Skip to content

Commit 32c3f2d

Browse files
committed
Auto merge of #87997 - sl4m:update-favicon-order, r=GuillaumeGomez
Updates favicon order of precedence as it matters to Chrome Hi, this updates #75438 to fix an order of precedence issue for Chrome. Unfortunately, the last favicon defined wins when it comes to Chrome, hence the primary icon being placed last. I [brought it up](https://bugs.chromium.org/p/chromium/issues/detail?id=1104663) with the Chromium team last year, but so far it's a non-issue. I've created an example website that mimics the behaviour in Chrome. https://sl4m.github.io/chrome-favicon/ This is what I'm seeing at the moment when viewing https://doc.rust-lang.org/core/index.html in Chrome. It's falling back to the PNG. <img width="80" alt="Screenshot 2021-08-12 at 21 11 58" src="https://user-images.githubusercontent.com/47347/129304041-b598213e-fcd3-4df1-addb-e6feac6c35b1.png">
2 parents d0a10b2 + 474ba60 commit 32c3f2d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustdoc/html/templates/page.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@
3131
{%- if layout.favicon -%}
3232
<link rel="shortcut icon" href="{{layout.favicon}}"> {#- -#}
3333
{%- else -%}
34-
<link rel="icon" type="image/svg+xml" {# -#}
35-
href="{{static_root_path | safe}}favicon{{page.resource_suffix}}.svg"> {#- -#}
3634
<link rel="alternate icon" type="image/png" {# -#}
3735
href="{{static_root_path | safe}}favicon-16x16{{page.resource_suffix}}.png"> {#- -#}
3836
<link rel="alternate icon" type="image/png" {# -#}
3937
href="{{static_root_path | safe}}favicon-32x32{{page.resource_suffix}}.png"> {#- -#}
38+
<link rel="icon" type="image/svg+xml" {# -#}
39+
href="{{static_root_path | safe}}favicon{{page.resource_suffix}}.svg"> {#- -#}
4040
{%- endif -%}
4141
{{- layout.external_html.in_header | safe -}}
4242
<style type="text/css"> {#- -#}

0 commit comments

Comments
 (0)