Closed Bug 1587385 Opened 5 years ago Closed 5 years ago

downloadable font: download timed out

Categories

(Core :: Layout: Text and Fonts, defect, P3)

71 Branch
defect

Tracking

()

RESOLVED FIXED
mozilla72
Tracking Status
firefox-esr68 --- unaffected
firefox69 --- unaffected
firefox70 --- unaffected
firefox71 --- wontfix
firefox72 --- fixed

People

(Reporter: maggus.staab, Assigned: jfkthame)

Details

(Keywords: regression)

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101 Firefox/71.0

Steps to reproduce:

Actual results:

website gets loaded and the browser console reports errors regarding fonts.

a) there is no information on how/why this error occurs
b) the line numbers in the error message do not link/jump to the offending lines

Expected results:

page and website should load without errors (as it does in Chrome)

Attached image browser-console.png

Hi,

I've managed to reproduce the issue on the latest Firefox Nightly 71.0a1.

Last good revision: 0dfb6920936b6a65f2ef2567d094b0194a6f3d10
First bad revision: 56422b3da6ff7d3ae84db40085cfed2943975d03
Pushlog: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=0dfb6920936b6a65f2ef2567d094b0194a6f3d10&tochange=56422b3da6ff7d3ae84db40085cfed2943975d03

Seems like it was introduced by Bug 1585271

Nicolas could you maybe take a look?

Thank you for reporting!

Status: UNCONFIRMED → NEW
Component: Untriaged → General
Ever confirmed: true
Flags: needinfo?(nchevobbe)
Product: Firefox → DevTools

I'm not sure how this relates to Bug 1585271 (maybe the error was ignored before?), but we can try to see what's happening.

So the message is added from gfx/thebes/gfxUserFontSet.cpp#902-907 which calls layout/style/FontFaceSet.cpp#1204-1294

There are a few things that we aren't doing properly:

  • the error message don't give you an idea what is happening (the netmonitor report the font requests to be successful)
  • the error message location is "unknown", which is super weird (might come from layout/style/FontFaceSet.cpp#1270,1273). it could be left as null so we can avoid to display the location ("unknown" has little value for the user, and on the console side, we can't really discriminate against an arbitrary sourceName)
  • the message is an error, but it should probably be a CSS warning? not sure about that though.
  • there are no tests for this error message? (at least none that I can see)

Jonathan, I see your reviewed code in this file not long ago, could you check if the error message is legit here?

Flags: needinfo?(nchevobbe) → needinfo?(jfkthame)

Failure to report the proper location seems to be a known issue in bug 1450903.

The "timeout" referred to here, I think, must be the webfont loading timeout related to the font-display descriptor, not a network-level timeout fetching the resource. When I shift-reload the page, I generally see these "timeout" errors, and inspecting the page reveals that the Open Sans fonts are not being used; the relevant content is displayed in Helvetica, Helvetica Bold, etc. instead. However, if I then reload the page (without Shift, so caches aren't bypassed), the Open Sans fonts - which by now are in cache - load successfully and the rendering of the content changes accordingly.

Given that the @font-face rules here specify font-display: optional;, this is expected behavior (see https://drafts.csswg.org/css-fonts-4/#valdef-font-face-font-display-optional) if the font resources take over 100ms to fetch. (On my connection here, they seem to be taking around 300-plus ms.)

It's probably useful to report this in some way, but as it stands the message doesn't seem quite appropriate to the situation. If the webfont was not used because it did not finish loading before the font-display timeout, this is not really an error; perhaps it should be an informative note.

Flags: needinfo?(jfkthame)

Bugbug thinks this bug is a regression, but please revert this change in case of error.

Keywords: regression

So if I understand correctly, this is something that needs to be changed on the fonts platform side (maybe near here: https://searchfox.org/mozilla-central/rev/97976753a21c1731e18177de9e5ce78ea3b3da2d/gfx/thebes/gfxUserFontSet.cpp#906).
Moving the bug to that component.

Component: General → Layout: Text and Fonts
Product: DevTools → Core
Priority: -- → P3

This is not an error in the same way as a download failure, and should not be reported as one.
An Info message is sufficient.

Also suppress "unknown" location in messages about @font-face rules, as it is not useful,
pending a proper fix (bug 1450903).

Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ca10c746267a
Give a better info (not error) message if a webfont is not used because of font-display timeout. r=heycam
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72
Assignee: nobody → jfkthame

IIUC, this is just some console spam and doesn't affect the rendering of the site. Given that, it sounds like this fix can just ride Fx72 to release but feel free to nominate for uplift if you feel strongly otherwise.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: