FontFace loading promise will not change state if network request is delayed by Blink loader
Reported by
volodymy...@fireblink.com,
Oct 26
|
|||||
Issue descriptionUserAgent: 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.
,
Oct 27
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.
,
Oct 27
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
,
Oct 29
,
Oct 31
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...!!
,
Dec 12
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by chrishtr@chromium.org
, Oct 26Labels: Needs-Feedback