font-display fails for first text with line-height
Categories
(Core :: Layout: Text and Fonts, defect)
Tracking
()
People
(Reporter: tjeu.kayim, Assigned: heycam)
References
()
Details
(Keywords: regression)
Attachments
(2 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0
Steps to reproduce:
Create a document containing several text elements, apply CSS to the body "line-height: 1" and a @font-face with "font-display: block".
See the HTML attachment for a minimal demo.
Tested in Firefox 72.0.1 and Nightly 78.0a1 (2020-05-19).
Actual results:
The first visible text element is showing the fallback font for a brief moment, while the other elements stay hidden until the font is downloaded.
Expected results:
The first element should render the same as the others and adhere "font-display: block".
![]() |
||
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 1•5 years ago
|
||
Here's the same test pointing to a font URL that waits 5 seconds before responding, to make the issue more obvious.
Assignee | ||
Comment 2•5 years ago
|
||
At the time we render the first line in the fallback font, its text run has mSkipDrawing = false
, while the other two text runs have mSkipDrawing = true
.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 3•5 years ago
|
||
Ultimately, the problem is that we set mSkipDrawing = false
on the first text run, in its constructor, before the font group starts loading any fonts. We should be able to ask the font group each time in gfxTextRun::Draw
what its mSkipDrawing
status is.
Comment hidden (obsolete) |
Assignee | ||
Comment 5•5 years ago
|
||
This is actually a regression from when font-display was originally implemented, in bug 1157064.
Assignee | ||
Comment 6•5 years ago
|
||
Assignee | ||
Comment 7•5 years ago
|
||
Comment 9•5 years ago
|
||
bugherder |
Updated•5 years ago
|
Comment 10•5 years ago
|
||
The patch landed in nightly and beta is affected.
:heycam, is this bug important enough to require an uplift?
If not please set status_beta
to wontfix
.
For more information, please visit auto_nag documentation.
Updated•5 years ago
|
Updated•5 years ago
|
Description
•