The default bug view has changed. See this FAQ.

[@font-face] font family names should hide platform fonts, even when errors occur




8 years ago
6 years ago


(Reporter: jtd, Assigned: jfkthame)



Firefox Tracking Flags

(Not tracked)




(1 attachment, 1 obsolete attachment)



8 years ago
When an @font-face face fails to load for a font family that matches an existing platform font we load the platform font instead of falling back to the next font in the fallback list.

For example:

@font-face {
  font-family: Arial;
  src: url(font.ttf);

body { font-family: Arial, serif; }

In this situation, text on the page should *never* display with Arial, it should either display with font.ttf or with a serif font.  The testcase URL includes @font-face rules with intentionally bad URL's, so the text should appear using a serif face.

The root of the problem here is that the user font set lookup only returns yes/no for whether a font is loaded.  It should return not-found, found-loaded and found-not-yet-loaded.  In the found-not-yet-loaded, the font lookup should skip the platform font lookup.

Comment 1

8 years ago
Created attachment 379080 [details] [diff] [review]

Reftests for testing this, with and without URL's that point at valid font data.


8 years ago
Summary: font family names should hide platform fonts, even when errors occur → [@font-face] font family names should hide platform fonts, even when errors occur
Why was I CCed to this bug here? Does this bug here have something to do with another bug?

Comment 3

6 years ago
I've been working on a patch for bug 623711 that should also fix this.
Assignee: jdaggett → jfkthame
Depends on: 623711

Comment 4

6 years ago
Created attachment 543410 [details] [diff] [review]
reftests, updated

The primary bug here was fixed in bug 623711, but the original reftests didn't quite work as written; updated them so as to pass reliably.

Note that bug 668758 also interacts with this issue (and is one reason for problems with the original tests here); that needs an additional patch and its own tests, but I'd like to go ahead and land these tests and resolve this bug.
Attachment #379080 - Attachment is obsolete: true
Attachment #543410 - Flags: review?(jdaggett)


6 years ago
Attachment #543410 - Flags: review?(jdaggett) → review+

Comment 5

6 years ago
Landed tests:

Marking this as Fixed now that we have tests in place (the actual code fix happened in bug 623711).
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.