Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark font-stretch as deprecated #26060

Merged
merged 3 commits into from
Feb 27, 2025
Merged

Conversation

ddbeck
Copy link
Collaborator

@ddbeck ddbeck commented Feb 26, 2025

Summary

The spec calls this a "legacy" alias, so I took this to mean it's now deprecated.

Test results and supporting details

https://drafts.csswg.org/css-fonts-4/#font-stretch-prop

It feels a little weird to mark this up, given the strong support for the old name. But given our guidelines, that's how this ought to be.

I didn't make the change for the SVG attribute or css.properties.font.font_stretch_support, since I was less clear on how to handle those based on the spec. Guidance or suggestions welcome.

Related issues

See the corresponding change in web-features: web-platform-dx/web-features#2707.

@github-actions github-actions bot added the data:css Compat data for CSS features. https://developer.mozilla.org/docs/Web/CSS label Feb 26, 2025
@github-actions github-actions bot added the size:s [PR only] 7-24 LoC changed label Feb 26, 2025
Copy link
Member

@Elchi3 Elchi3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the renaming throughout, I would expect the deprecation status for all of the relevant keys here:

  • css.at-rules.font-face.font-stretch (done)
  • css.properties.font-stretch (done)
  • css.properties.font-stretch.percentage (done)
  • css.properties.font.font_stretch_support (missing)
  • svg.global_attributes.font-stretch (missing)

@Elchi3
Copy link
Member

Elchi3 commented Feb 26, 2025

I didn't make the change for the SVG attribute or css.properties.font.font_stretch_support, since I was less clear on how to handle those based on the spec. Guidance or suggestions welcome.

Ah I should have read your PR description. For css.properties.font.font_stretch_support I think it is clear that the spec now changed to font-width, and so the place for font-stretch has now become font-width. For SVG, I would file an issue against the spec probably.

@caugner
Copy link
Contributor

caugner commented Feb 26, 2025

Instead of marking this as deprecated, shouldn't we merge this as an alternate_name into css.properties.font-width?

@github-actions github-actions bot added the data:svg Compat data for SVG features. https://developer.mozilla.org/docs/Web/SVG label Feb 27, 2025
@ddbeck
Copy link
Collaborator Author

ddbeck commented Feb 27, 2025

@Elchi3

For SVG, I would file an issue against the spec probably.

I started down this path, but found that the SVG spec doesn't really define these either—it just links out to other specs. It also says that, "In the future, any new properties that apply to SVG content will not gain presentation attributes." This suggests to me that we can just go ahead and apply to deprecation to svg.global_attributes.font-stretch. Done in cebd0ea.

For css.properties.font.font_stretch_support, since its representing support for font-stretch values I think maybe the correct thing is to rename it. I've done that in 82a1eb9.

@caugner

Instead of marking this as deprecated, shouldn't we merge this as an alternate_name into css.properties.font-width?

There are no guidelines for when to use a separate key versus an alternative_name or prefix. That said, my preference would be for alternative_name and prefix to be used only for non-standard prefixes and aliases (that otherwise have no differences with respect to the standard name, or else have partial_implementation).

This makes it much easier for web-features to consume the data, where we have to represent the relationship between the two features. If it were an alternative name, I'd have to manually set support data for the font-stretch feature.

@ddbeck ddbeck requested a review from Elchi3 February 27, 2025 08:57
@Elchi3
Copy link
Member

Elchi3 commented Feb 27, 2025

I started down this path, but found that the SVG spec doesn't really define these either—it just links out to other specs. It also says that, "In the future, any new properties that apply to SVG content will not gain presentation attributes." This suggests to me that we can just go ahead and apply to deprecation to svg.global_attributes.font-stretch. Done in cebd0ea.

I checked in Safari 18.4 (https://jsfiddle.net/wjv73nb2/) and font-width as an SVG attribute works. See also WebKit/WebKit#31897 where the attribute was added to Source/WebCore/svg/svgattrs.in. So either this was against the spec or the spec is not clear enough about this.

So, I think I'm +1 on deprecating svg.global_attributes.font-stretch and I think I would like to see svg.global_attributes.font-width in #26069 (possibly marked non-standard and/or with an issue filed against SVG asking for clarification)

@Elchi3
Copy link
Member

Elchi3 commented Feb 27, 2025

For css.properties.font.font_stretch_support, since its representing support for font-stretch values I think maybe the correct thing is to rename it. I've done that in 82a1eb9.

This works for me! 👍

@Elchi3 Elchi3 merged commit 2e53904 into mdn:main Feb 27, 2025
7 checks passed
@mdn-bot mdn-bot mentioned this pull request Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:css Compat data for CSS features. https://developer.mozilla.org/docs/Web/CSS data:svg Compat data for SVG features. https://developer.mozilla.org/docs/Web/SVG size:s [PR only] 7-24 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants