Closed Bug 1724907 Opened 3 years ago Closed 3 years ago

font-family: system-ui breaks font fallback mechanism

Categories

(Core :: Layout: Text and Fonts, defect)

Firefox 93
x86_64
macOS
defect

Tracking

()

VERIFIED FIXED
93 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox-esr91 --- unaffected
firefox91 --- unaffected
firefox92 --- verified
firefox93 --- verified

People

(Reporter: RSChiang, Assigned: emilio)

References

(Regression, )

Details

(Keywords: regression)

Attachments

(5 files)

Regressed by: 1226042

Keyword: Nightly-community

Description:

After the recent rollout of system-ui font family on Nightly, elements with either:

  1. system-ui as their only font-family or
  2. system-ui as their preferred font-family while lang attribute is present

would render non-Latin alphabets with the browser default font for that language, instead of the correct system font or the next font specified in CSS font-family fallback list.

The problem is illustrated in the attached screenshot. For the provided text sample, Firefox is expected to use either the coordinated .AppleSystemUIFont as in Safari, or .SF NS (the Latin system font), PingFang TC (CJK system font for zh-TW locale) and so on for their locale. Instead, Arial and Songti SC (the serif CJK font for zh-CN locale) is used for the non-Latin glyphs.

This behavior is not shown in the previous -apple-system implementation.

Flags: needinfo?(jfkthame)
Flags: needinfo?(emilio)
Attached image cf. Firefox 90.0 Stable

Will look, thanks.

Assignee: nobody → emilio
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(emilio)
Flags: needinfo?(jfkthame)

As it's usually not very useful. I don't know how easily we can add a
reliable test for this, let me know if you come up with an idea to do
that.

Thanks for looking into this! As far as I know, Facebook has already made system-ui as their preferred font on web, and the problem will thus be pretty noticeable to ordinary users if it landed on stable.

Kudos for the quick patch ✨

Confirming on try that it behaves as expected.

Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9818a76ba62c
Don't use system-ui as a fallback generic. r=jfkthame
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 93 Branch
Pushed by emilio@crisal.io:
https://hg.mozilla.org/integration/autoland/rev/99e35344e152
Annotate reftest as failing on Android.
Regressed by: 1226042
Has Regression Range: --- → yes

Comment on attachment 9235573 [details]
Bug 1724907 - Don't use system-ui as a fallback generic. r=jfkthame

Beta/Release Uplift Approval Request

  • User impact if declined: system-ui rendering when unsupported characters are used will use wrong fallback.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: comment 0
  • List of other uplifts needed: none
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Very simple patch to use same fallbacks as named families.
  • String changes made/needed: none
Attachment #9235573 - Flags: approval-mozilla-beta?
Attachment #9235609 - Flags: approval-mozilla-beta?
Flags: qe-verify+

Comment on attachment 9235573 [details]
Bug 1724907 - Don't use system-ui as a fallback generic. r=jfkthame

Approved for 92.0b4.

Attachment #9235573 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9235609 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
QA Whiteboard: [qa-triaged]

Reproduced the issue on Firefox 93.0a1 (2021-08-08) under macOS 11.5 by following the infos provided in the first comments.

The issue is fixed and the correct fonts are used on 93.0a1 (2021-08-16) and Firefox 92.0b4 on the same system.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: