font-face property src when is set from outside is not computed
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
People
(Reporter: tzvetelin.vassilev, Unassigned)
Details
Attachments
(1 file)
624 bytes,
text/html
|
Details |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:127.0) Gecko/20100101 Firefox/127.0
Steps to reproduce:
Define font-face without 'src' property. It is set through the CSSStyleSheet API.
Actual results:
Nothing happens, Firefox do not respect src value when comes from CSSStyleSheet API. Symbols referred from the CSS looks broken.
Expected results:
src to fonts should be applied and symbols should be rendered properly. You can find reproduction sample here - https://willtech.wacom.com/web-issues/firefox/font-based-icons.html
Comment 1•2 months ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::CSS Parsing and Computation' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•2 months ago
|
||
Can confirm on my Windows machine.
On Chrome, 4 icons are shown. Nightly just shows boxes.
cc :jfkthame.
Comment 3•2 months ago
|
||
Here's a similar example just using src:local(...)
that demonstrates that Firefox fails to respond to changes to the src
descriptor: https://codepen.io/jfkthame/pen/bGPGmNw?editors=1010. In Chrome and Safari, it will continually cycle through the different fonts listed, but Firefox remains "stuck" displaying Arial.
Comment 4•2 months ago
|
||
Note: the codepen in comment 3 just looks static in Chrome on Ubuntu (with default font set at least), because it uses fonts that aren't present.
Here's a version of that Codepen, using some fonts that are available on Ubuntu: https://codepen.io/dholbert/pen/XWLmLWq
("DejaVu Serif", "DejaVu Sans", "Ubuntu")
With that, I see this same behavior-difference on my Ubuntu machine. Firefox remains stuck, while Chrome cycles through the listed fonts.
Comment 5•2 months ago
|
||
I think this is just bug 1058408. The tests here are assuming that sheet.rules[0].style.src
(for the @font-face src
descriptor) is a thing that can be inspected and set, but it's simply not present in Firefox right now -- and I think that's because of bug 1058408.
All the various @font-face descriptors are present and inspectable off of this style
object right now in Chrome, but they're all undefined
in Firefox, even when an actual value has been set in CSS. So it's not too surprising that setting them has no effect.
Updated•2 months ago
|
Comment 7•2 months ago
|
||
Here's a testcase that just tries to display the values of these descriptors that are set in CSS (it doesn't bother to set them).
In Firefox, they all show undefined
.
Description
•