w3c / csswg-drafts

CSS Working Group Editor Drafts
https://drafts.csswg.org/
Other
4.44k stars 657 forks source link

[css-inline-3] Define `text-*-edge` aliases in prose instead of with basic syntax? #8173

Open cdoublev opened 1 year ago

cdoublev commented 1 year ago

SVG text-*-edge aliases are defined with this basic syntax:

text-before-edge = text-top 
text-after-edge = text-bottom

I think there is no other keyword aliases defined like this, and there is no definition of what constitues a valid CSS production rule. Imo, the left hand side of a production rule should always be wrapped in <>. Some function productions are also defined without this nesting, but I came across recent commits that normalize them with it.

I would prefer to get these keyword aliases defined in prose instead of a production rule, if they cannot be defined in the value definition of vertical-align.

Obviously, this issue is very low priority.

tabatkins commented 1 year ago

Yeah, tho we don't have a formal definition of our production rule syntax, this particular usage is certainly novel, and imo shouldn't be valid. This should be converted into equivalent prose, like we do for optimizeQuality and optimizeSpeed at the end of https://drafts.csswg.org/css-images-3/#the-image-rendering

cdoublev commented 1 year ago

If I understand correctly, it says that they are mapped whereas the current syntax suggests that they are aliases.

These are now deprecated; a user agent must accept them as valid values but must treat them as having the same behavior as crisp-edges and smooth respectively

If I am not mistaken, mapped values are preserved (for serialization) whereas aliases are replaced at parse time. I guess the difference is not important for implementers. Maybe CSS authors would prefer aliases, so they know they are using a legacy value.

But how various legacy rules/properties/functions are handled (aliased or mapped) is inconsistent and this creates confusion.

fantasai commented 1 year ago

That's not actually using class=prod, I don't think it's even trying to use valdef syntax? Just seems like weirdly marked up prose, and yes, probably should be fixed.