The default bug view has changed. See this FAQ.

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

RESOLVED FIXED

Status

()

Core
Graphics
RESOLVED FIXED
8 years ago
6 years ago

People

(Reporter: jtd, Assigned: jfkthame)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

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.
(Reporter)

Comment 1

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

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

Updated

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?
(Assignee)

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
(Assignee)

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)
(Reporter)

Updated

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

Comment 5

6 years ago
Landed tests:
http://hg.mozilla.org/mozilla-central/rev/7daa4cc9fb07

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