Closed Bug 1906625 Opened 2 months ago Closed 2 months ago

font-face property src when is set from outside is not computed

Categories

(Core :: CSS Parsing and Computation, defect)

Firefox 127
defect

Tracking

()

RESOLVED DUPLICATE of bug 1058408

People

(Reporter: tzvetelin.vassilev, Unassigned)

Details

Attachments

(1 file)

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

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.

Component: Untriaged → CSS Parsing and Computation
Product: Firefox → Core

Can confirm on my Windows machine.
On Chrome, 4 icons are shown. Nightly just shows boxes.
cc :jfkthame.

Status: UNCONFIRMED → NEW
Ever confirmed: true

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.

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.

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.

Status: NEW → RESOLVED
Closed: 2 months ago
Duplicate of bug: 1058408
Resolution: --- → DUPLICATE
Attached file testcase 1

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.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: