New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 899224 link

Starred by 1 user

Issue metadata

Status: Unconfirmed
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

FontFace loading promise will not change state if network request is delayed by Blink loader

Reported by volodymy...@fireblink.com, Oct 26

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36

Steps to reproduce the problem:
1. Create a FontFace
2. Call load method on previously created FontFace

What is the expected behavior?
FontFace loading promise becomes resolved or rejected.

What went wrong?
Nothing happened

Did this work before? N/A 

Chrome version: 70.0.3538.77  Channel: stable
OS Version: 10.0
Flash Version: 

This was found in web-extension. Custom FontFace should be added to the content of every tab. And in case of opening a large set of tabs with the same location during small amount of time we faced with warnings in console:
"Active resource loading counts reached to a per-frame limit while the tab is in background. Network requests will be delayed until a previous loading finishes, or the tab is foregrounded. See https://www.chromestatus.com/feature/5527160148197376 for more details"
And when network request for FontFace was delayed, resolve block for promise was not executing.
 
Cc: chrishtr@chromium.org
Labels: Needs-Feedback
Could you please provide an example link that demonstrates the problem?
The bug was discovered in extension. 
The code similar to provided below was not working fine when opening 10-15 tabs almost in the same time. On few tabs font was not loaded.
`const fontUrl = "https://fonts.gstatic.com/s/mali/v1/N0ba2SRONuN4SC3EDw.woff2";
 const fontFace = new FontFace(
   "TestFont",
   `url('${fontUrl}')`,
   { style: "normal", weight: "normal" }
 );
 fontFace.load().then((ff) => {
   document.fonts.add(ff);
   console.log("FontFace loaded.", ff);
 }).catch((error) => {
   console.log("Cannot load font.", error);
 });
`
When moving `document.fonts.add(ff);` out from promise, just before it, font starts loading on all tabs. But still no logs in console for few tabs.   
Project Member

Comment 3 by sheriffbot@chromium.org, Oct 27

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
Labels: Needs-Triage-M70
Cc: krajshree@chromium.org
Labels: Needs-Feedback Triaged-ET
volodymyr.rozhnov@ - Thanks for filing the issue and providing the extension code at comment #2. But it won't be possible from our end to triage the issue until a zip extension file is provided. Hence, requesting you to please provide a sample extension file to test the issue from TE-end.

Thanks...!!
Cc: -chrishtr@chromium.org
Components: -Blink Platform>Extensions

Sign in to add a comment