Skip to content

Commit

Permalink
Auto merge of rust-lang#87997 - sl4m:update-favicon-order, r=Guillaum…
Browse files Browse the repository at this point in the history
…eGomez

Updates favicon order of precedence as it matters to Chrome

Hi, this updates rust-lang#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">
  • Loading branch information
bors committed Aug 14, 2021
2 parents d0a10b2 + 474ba60 commit 32c3f2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/librustdoc/html/templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
{%- if layout.favicon -%}
<link rel="shortcut icon" href="{{layout.favicon}}"> {#- -#}
{%- else -%}
<link rel="icon" type="image/svg+xml" {# -#}
href="{{static_root_path | safe}}favicon{{page.resource_suffix}}.svg"> {#- -#}
<link rel="alternate icon" type="image/png" {# -#}
href="{{static_root_path | safe}}favicon-16x16{{page.resource_suffix}}.png"> {#- -#}
<link rel="alternate icon" type="image/png" {# -#}
href="{{static_root_path | safe}}favicon-32x32{{page.resource_suffix}}.png"> {#- -#}
<link rel="icon" type="image/svg+xml" {# -#}
href="{{static_root_path | safe}}favicon{{page.resource_suffix}}.svg"> {#- -#}
{%- endif -%}
{{- layout.external_html.in_header | safe -}}
<style type="text/css"> {#- -#}
Expand Down

0 comments on commit 32c3f2d

Please sign in to comment.