Open Bug 1911075 Opened 2 years ago Updated 6 days ago

Rename font-stretch to font-width, and make the old property name an alias

Categories

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

Firefox 130
enhancement

Tracking

()

REOPENED
155 Branch
Tracking Status
relnote-firefox --- 155+
firefox155 --- affected

People

(Reporter: onkarruikar, Assigned: descalante)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-complete, parity-safari, web-feature)

User Story

web-feature: font-width

Attachments

(2 files)

Steps to reproduce:

  1. Try to set font-width: expanded on any HTML element.

Browser version: Firfox nightly 130.0a1 (2024-07-31) (64-bit)

Actual results:

The browser didn't recognize the property name.

Expected results:

The browser should recognize font-width as font-stretch. And font-stretch to continue as a legacy alias.

The font-stretch property has been renamed to font-width in the specification. And font-stretch is now a legacy alias:

The Bugbug bot thinks this bug should belong to the 'Core::Layout: Text and Fonts' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

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

It looks like we haven't implemented the spec resolution in https://github.com/w3c/csswg-drafts/issues/551#issuecomment-1885196273

This might be simple to do. A first step would be updating this code to font-width, and rename related structs. Then add aliases="font-stretch"?

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true

Yeah, this should be a fairly simple change, I expect -- basically a big search-and-replace, plus the aliasing.

One thing to note is that the change applies to both the property and the separate but related @font-face descriptor. We should make sure to update (and alias) both of these at the same time, to avoid creating extra confusion.

One related factor that I don't think has been discussed yet is the Canvas2D API, which also uses the unfortunate stretch-based naming.

We should probably try to get a width alias added there as well, for consistency.

Also, if suitable, it would be great if a warning is logged in console logs or shown in the Developer tools->Elements->styles tab when the old font-stretch name is used.

Attaching a WIP patch that covers much of the global replacement of the "stretch" term with "width"; this builds for me on macOS, but there will no doubt be some residual issues in the other platform back-ends still to be fixed up.

(This does not yet include any aliasing of the old name to the new, which will be required for this to go forward.)

Summary: Rename font-stretch to font-width → Rename font-stretch to font-width, and make the old property name an alias
User Story: (updated)
Keywords: web-feature
Assignee: nobody → descalante
See Also: → 2054950
Pushed by descalante@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/680518e767fa https://hg.mozilla.org/integration/autoland/rev/2495a873d2b5 Rename font-stretch to font-width, and make the old property name an alias. r=jfkthame,geckoview-reviewers,webidl,firefox-style-system-reviewers,layout-reviewers,emilio,owlish,dshin
Pushed by sstanca@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/b806b480b8fb https://hg.mozilla.org/integration/autoland/rev/ceda1e178481 Revert "Bug 1911075 - Rename font-stretch to font-width, and make the old property name an alias. r=jfkthame,geckoview-reviewers,webidl,firefox-style-system-reviewers,layout-reviewers,emilio,owlish,dshin" for causing mochitests failures in test_animation-type-longhand.html.

Reverted this because it was causing mochitests failures in test_animation-type-longhand.html.

Please also check these mochitests-plain failures.

P.S. These wpt failures also.

Flags: needinfo?(descalante)

Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/61487 for changes under testing/web-platform/tests

Upstream PR was closed without merging

[:SerbanS] Thank you for the heads up, the latest patch should fix those failures :)

Flags: needinfo?(descalante)
Pushed by descalante@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/3c89df269fe4 https://hg.mozilla.org/integration/autoland/rev/b41420512927 Rename font-stretch to font-width, and make the old property name an alias. r=jfkthame,geckoview-reviewers,webidl,firefox-style-system-reviewers,layout-reviewers,emilio,owlish,dshin,devtools-reviewers,nchevobbe
Pushed by imoraru@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/9c82154d1651 https://hg.mozilla.org/integration/autoland/rev/2dd23e0ae9a8 Revert "Bug 1911075 - Rename font-stretch to font-width, and make the old property name an alias. r=jfkthame,geckoview-reviewers,webidl,firefox-style-system-reviewers,layout-reviewers,emilio,owlish,dshin,devtools-reviewers,nchevobbe" for causing wr failures on font-face-width-descriptor-aliasing.html.

Revert for causing wr failures on font-face-width-descriptor-aliasing.html.

Flags: needinfo?(descalante)

Upstream PR was closed without merging

Pushed by descalante@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/8dc93c08cab8 https://hg.mozilla.org/integration/autoland/rev/62ae8eb7849e Rename font-stretch to font-width, and make the old property name an alias. r=jfkthame,geckoview-reviewers,webidl,firefox-style-system-reviewers,layout-reviewers,emilio,owlish,dshin,devtools-reviewers,nchevobbe
Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 155 Branch
Flags: needinfo?(descalante)

Upstream PR merged by moz-wptsync-bot

Bug was resolved, but the web-feature font-width (definition file) is not yet marked as supported in Firefox.

Feature bugs are usually automatically closed once the corresponding web-features are marked as supported; this typically happens after the feature reaches release.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---

Added to the Fx155 relnotes. Would have added it sooner but comment 22 caused this bug to go by unnoticed in the places we try to identify possible release note candidates.

Keywords: dev-doc-needed

Associated Pull Requests

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

Attachment

General

Created:
Updated:
Size: