[svgwg] Are `font-stretch` and `font-width` standard SVG global attributes? (#978)

ddbeck has just created a new issue for https://github.com/w3c/svgwg:

== Are `font-stretch` and `font-width` standard SVG global attributes? ==
## Summary

Over on the [browser-compat-data project](https://github.com/mdn/browser-compat-data), we're trying to accurately reflect the standardization of web platform features. We've found an ambiguous case when it comes to reading the specs for `font-stretch` and `font-width`. We would appreciate the SVG spec editors' guidance on the intended meaning of the spec. Our questions are:

- Is the `font-width` SVG presentation attribute non-standard?
- Is it safe to describe the `font-stretch` SVG presentation attribute in the same terms as the CSS spec (i.e., to treat is as a "legacy" feature)?

## Background

Over in https://github.com/mdn/browser-compat-data/pull/26069, I am trying to more accurately document support information for the `font-stretch` and `font-width` CSS properties. As part of this process, we (the BCD maintainers) found some ambiguities in how to report the standards and deprecation status for the corresponding SVG presentation attributes.

In the table in section [6.6. Presentation attributes](https://svgwg.org/svg2-draft/styling.html#PresentationAttributes), the SVG spec explicitly lists `font-stretch` as a presentation attribute. Meanwhile, the CSS spec has renamed the `font-stretch` property to `font-width`, [declaring the old property name a legacy alias](https://drafts.csswg.org/css-fonts/#font-stretch-desc).

To complicate matters further, Safari shipped the `font-width` property _and_ an SVG attribute of the same name, apparently going against the [SVG spec's note about new CSS properties](https://svgwg.org/svg2-draft/styling.html#:~:text=in%20the%20future%2C%20any%20new%20properties%20that%20apply%20to%20svg%20content%20will%20not%20gain%20presentation%20attributes):

> In the future, any new properties that apply to SVG content will not gain presentation attributes.

## Open questions 

Our main questions follow:

- Is it safe for us to describe the `font-stretch` SVG attribute in the same terms as the CSS spec (i.e., to treat is as a "legacy" feature)?

  In other words, if a CSS spec were to deprecate a property, is it correct for us to also say that the corresponding SVG presentation attribute is also deprecated?

  Our current assumption is yes and that we should read both the CSS and SVG specs together, presuming that they do not intend to contradict each other.

- Is the `font-width` SVG presentation attribute non-standard?

  Given the text of the SVG spec, I would expect that completely new properties would not gain SVG presentation attributes. But since `font-stretch` has been renamed, it's unclear whether this would apply to `font-width` as well.

  Our current assumption is yes, the `font-width` SVG presentation attribute is non-standard based on the note about new properties.

Thanks for any help you can provide on these questions!

Please view or discuss this issue at https://github.com/w3c/svgwg/issues/978 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Saturday, 3 May 2025 19:27:21 UTC