Closed Bug 1592762 Opened 6 years ago Closed 6 years ago

"font-weight: 1000;" is in the CSS Spec, but font weights above 900 fail in Firefox

Categories

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

72 Branch
defect

Tracking

()

RESOLVED FIXED
mozilla72
Tracking Status
firefox72 --- fixed

People

(Reporter: arrowtypeco, Assigned: jfkthame)

Details

Attachments

(3 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36

Steps to reproduce:

According to the CSS spec:

"values greater than or equal to 1 and less than or equal to 1000 are valid"

(https://drafts.csswg.org/css-fonts-4/#font-weight-numeric-values)

Therefore, I tried to use font-weight: 1000; on a variable font that supports this. I then compared that result to font-variation-settings: 'wght' 1000; to check if there was a difference.

This showed that font-weight1 is not yet fully supported in Firefox, as tested on macOS.

Test results as of Oct 30, 2019:

  • In Firefox 70 on macOS: font-weight values above 900 is ignored and falls back to 900.
  • In Chrome 78 on macOS, this test does work as expected.

Actual results:

In Firefox 70 and 72 on macOS: font-weight values above 900 are ignored and fall back to 900.

Web test:

https://arrowtype.github.io/recursive/font-weight-1000--testing/index.html

(This is also failing in Safari, in a different way, and I'll file a separate bug there.)

Expected results:

font-weight: 1000; and font-variation-settings: 'wght' 1000; should yield equivalent font weight

Attached image screenshot of issue

Here's a screenshot of the web test for this issue.

Component: Untriaged → Layout: Text and Fonts
Product: Firefox → Core

Yes, it looks like we have some obsolete code that clamps the used font-weight value to the old 100..900 range; this is no longer correct. I'm just testing a fix locally, will post a patch once I've checked that it works as expected.

Assignee: nobody → jfkthame
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3

This was simply overlooked when we were extending font-weight for the new values allowed by CSS Fonts 4.

Awesome! Looks like you already found and fixed the bug?

Out of curiosity: how long does that kind of fix tend to take to make it into the stable build, generally?

The fix should appear in Nightly test builds of Firefox 72 within a day or so; then Firefox 72 is due to go to the Beta channel in early December, and to Release in January. (https://wiki.mozilla.org/Release_Management/Calendar)

Pushed by jkew@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/40c9ccbb699f Update clamped range of font-weight in the gfxFontStyle constructor to match new range allowed in CSS Fonts 4. r=jwatt
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: