Firefox download custom web font even when there is no text in page
Categories
(Core :: Layout: Text and Fonts, enhancement, P5)
Tracking
()
People
(Reporter: dehghani.m.c, Unassigned)
Details
Hi,
Firefox download custom font for following situation:
@font-face { font-family: 'whatever'; }
<div style="font-family: whatever"></div>
Which is wrong and for empty pages there is no need to downloading fonts.
Updated•6 years ago
|
Comment 1•6 years ago
|
||
The first font in the font-family list is needed in order to resolve the values of CSS units like 'ch' and 'ex', even if no text is present.
Comment 2•6 years ago
|
||
So my feeling is that this should be closed as invalid. Mehdi, do you have a specific reason you think this should behave differently?
Comment 3•6 years ago
|
||
Should we do that even if no ex / ch units are specified?
Comment 4•6 years ago
|
||
I haven't tracked this down fully, but I suspect we need the first font in order to get metrics that are used to compute the normal line height, which is needed to set up the block reflow input for any block frames - even if they're empty.
@Jonathan, I think font should be downloaded only when it actually used. I run some test using Chrome and seems like web kit based browsers doesn't download font unless the tag/html have some content.
When there is no text/content to use downloaded font, would you tell me what is point of downloading that font?
Comment 6•6 years ago
|
||
As mentioned above, the font's metrics are used to compute the normal line-height value, which may be needed even if there's no content.
Obviously, there may be cases where it really isn't needed, but it's not as simple as "there's no text in the element".
Updated•6 years ago
|
That's right, maybe there are other cases that Firefox do unnecessary works, this is one of them.
Updated•3 years ago
|
Updated•3 years ago
|
Description
•