New issue
Advanced search Search tips

Issue 829674 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Font Loading API loads font file from scratch in addition to preload

Reported by nazar.mo...@gmail.com, Apr 6 2018

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0

Steps to reproduce the problem:
1. Have web page with custom web font
2. Use link[rel=preload][as=font] for font file
3. Call document.fonts.load() with the same font
4. Look at network tab of dev tools for font download requests

What is the expected behavior?
Font file is loaded once.

What went wrong?
Font file is correctly loaded once because of link[rel=preload][as=font] and incorrectly loaded once again from scratch on document.fonts.load() call (regardless if preloaded file was already fully loaded or not).

Did this work before? No 

Does this work in other browsers? N/A

Chrome version: 67.0.3390.0  Channel: canary
OS Version: Ubuntu 18.04
Flash Version: 

Live demo with the same contents as attached file: http://jsbin.com/yalogeqise/edit?html
 
double-file-load.html
422 bytes View Download
Labels: Needs-Triage-M67
Cc: vamshi.kommuri@chromium.org
Labels: Triaged-ET Needs-Feedback
Thanks for filing the issue!

Checked the issue on reported chrome version 67.0.3390.0 and on the latest stable 65.0.3325.181 using ubuntu 14.04 and Ubuntu 17.10 with the below mentioned steps.
1. Launched Chrome 
2. Downloaded the file double-file-load.html and opened in a new tab.
3. Navigated to http://jsbin.com/yalogeqise/edit?html
We observed blank page after navigating to the .html file and didn't observe any fonts in jsbin file too. Attaching the screen cast of the same.

@Reporter: Could you please have a look at the screen cast and let us know if we have missed anything. Any further inputs from your end may help us.
829674.mp4
1.5 MB View Download
Open Dev Tools and go to Network tab. You'll see that `fa-solid-900.woff2` font file is loaded twice.
Зняток екрану з 2018-04-06 10-20-32.png
33.5 KB View Download
Project Member

Comment 4 by sheriffbot@chromium.org, Apr 6 2018

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 5 by f...@opera.com, Apr 6 2018

You need to match the CORS mode of the non-preload resource, so adding 'crossorigin' (or crossorigin=anonymous) to the <link> should eliminate the double load.
Interesting, [crossorigin] attribute helps. However, this is a bit counter-intuitive.
Is this by design or something that should be improved?

Comment 7 by f...@opera.com, Apr 6 2018

AFAICT, <link> is specced this way:

https://html.spec.whatwg.org/multipage/semantics.html#obtaining-a-resource-from-a-link-element

From an ergonomic standpoint I would tend to agree that this may not be optimal/intuitive though. (I.e using the default CORS mode for the destination ['as'] might've been more intuitive/expected.)
Labels: M-67 Target-67 FoundIn-67 OS-Mac OS-Windows
Status: Untriaged (was: Unconfirmed)
Able to reproduce the issue on Mac 10.13.3, Win-10 and Ubuntu 14.04 using chrome reported version #67.0.3390.0.
This is a non-regression issue as it is observed from M60 old builds. 

Hence, marking it as untriaged to get more inputs from dev team.

Thanks...!!

Comment 9 by f...@opera.com, Apr 9 2018

Status: WontFix (was: Untriaged)

Sign in to add a comment