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

[css-writing-modes] glyph-orientation-vertical is defined with invalid basic syntax #8032

Open
cdoublev opened this issue Nov 7, 2022 · 3 comments
Labels

Comments

@cdoublev
Copy link
Collaborator

cdoublev commented Nov 7, 2022

Related: #2921 (comment)

The value of glyph-orientation-vertical is defined with auto | 0deg | 90deg | 0 | 90.

Obviously, the numerical values are not keywords but <angle>s or <integer>s of the corresponding value in degrees. But CSS Values does not define the type to which the numeric values correspond, ie. it does not allow solution 3 below.

I see a few solutions:

  1. define glyph-orientation-vertical with auto | <angle [0,0]> | <angle [90deg,90deg]> | <integer [90,90]>, with numeric values being restricted in prose to degrees or unitless values (<angle> allows unitless value)
  2. extend/change the syntax of the bracketed range notation to [lower-upper] and [x,y,z], or something else
  3. extend the definition of CSS basic data types in CSS Values to allow writing numeric types literally

Solution 1 is a quick fix. Because glyph-orientation-vertical is obsolete, no solution may be worth it. But the CSS Properties and Values API may take advantage of solution 2 or 3, eg.:

@property --boolean {
  syntax: 0 | 1, /* Or <integer [0,1]> */
}

The bracketed range has proven to be problematic with dimensions. So my preference is solution 3 but it makes parsing syntax a bit more complex.

@Loirooriol
Copy link
Contributor

The 180deg and 270deg values, the radian and gradian values, and the glyph-orientation-horizontal property are not mapped because they have no known use cases nor significant amounts of dependent content, and are therefore not part of CSS, and have been likewise dropped from SVG.

I understand that's excluding 0rad and 0grad despite representing the same angle as 0deg. So it seems to me this is trying to restrict the grammar to some specific literals and avoid <angle>. Then calc(0deg) wouldn't work either I guess. I think this is your number 3.

@Loirooriol Loirooriol added css-values-4 Current Work css-writing-modes-4 Current Work labels Nov 7, 2022
@Loirooriol
Copy link
Contributor

But I guess this brings the question: is it just 0deg, or also 0.0deg, 0e1deg, +0deg, -0deg, etc?

It seems Gecko and Blink don't support the property at all. WebKit accepts auto, all <angle>, 0 as unitless <angle>, and in quirks mode <number> as unitless <angle>.

@dbaron
Copy link
Member

dbaron commented Nov 7, 2022

Given that this is a legacy case, I'd favor solution 1, although modified to include both integer and angle versions for 0 because angles don't (by default) allow unitless numbers (although some legacy cases do).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 participants