-
Notifications
You must be signed in to change notification settings - Fork 674
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-counter-styles] Clarify what to do when 'symbols' has only one symbol for 'alphabetic' and 'numeric' systems? #5698
Comments
My intention was "parse failure" (that's how that phrasing is consistently interpreted everywhere), but I'm okay with changing to Firefox's behavior and making the spec clearer in that regard. |
I guess an analogous example is https://drafts.css-houdini.org/css-properties-values-api/#initial-value-descriptor @property --foo {
syntax: "<length>";
inherits: false;
initial-value: 1px;
initial-value: 1;
} where the |
Yeah true, so indeed, let's make the whole @counter-style rule invalid as well. |
Is there a difference between "making the whole @counter-style rule invalid" and "the @counter-style rule does not define a counter style"? According to #1862, they make a difference in whether the rule appears in OM. If so, making the rule not define a counter style seems more reasonable. |
Oooh, that's a good question. @Property currently says it makes the rule invalid, which presumably means it doesn't show up in the OM. I don't have time to test whether that actually happens atm, but we shoudl be consistent between these two. |
Shows up in the OM: test |
+1, we should avoid parse-time behavior of one descriptor being affected by another descriptor, any complicated "validation" of the rule as a whole should happen at "@-rule interpretation time" (or whatever we want to call that). I didn't even raise an issue for this for |
Makes sense, I've clarified that paragraph that failing to meet the minimum symbols length just means you don't define a counter style; nothing is invalid. |
The current spec says:
What exactly does "the descriptor is invalid and must be ignored mean"?
Example:
There are two possible way to interpret the spec:
This is a parse failure of the declaration, and the previous
symbols
declaration should be used. So we end up usingsymbols: 'A' 'B'
. This is difficult to implement, though, as the parsing of one descriptor will depend on another descriptor. I'm not sure if anywhere else in CSS has such behavior.The parsing of
symbols
strictly follows the syntax<symbol>+
, so that we end up usingsymbols: 'X'
. It has one symbol, and therefore the @counter-style does not define a counter style. This is Firefox's current behaviorI suggest we revise the spec and clarify that we follow the second behavior, because it's the only implemented behavior, and it's easier to implement.
The text was updated successfully, but these errors were encountered: