Re: [csswg-drafts] [css-values-4] Clarify how slashes are used in grammar (#7218)

Slash is already defined in <https://drafts.csswg.org/css-values-4/#component-types>:

> Some property value definitions also include the slash (/), the comma (,), and/or parentheses as literals. These represent their corresponding tokens. 

-----

> This allows to simplify the grammar of syntaxes like border-image, 

Our comma elision rules exist because we use commas *constantly*, and very often around optional things, such that without the rules our grammars were frequently complex and hard to read purely for technical reasons, not reflecting the actual complexity of the grammars. That said, they've still caused occasional confusion for implementors and other readers of our specs, so I don't want to introduce additional rules (especially if the're subtly different) without a clear and large value.

I don't think we're in anywhere near the same situation for slashes. Slashes are rarely used in the first place, and when they are used they're rarely paired with heavy optionality; border-image might be the only real offender here.

As such, I'm moderately opposed to adding any special rules for slash. When and if we ever start using slash heavily and in similar situations as comma, such that expressing their presence correctly frequently results in unwieldy, confusing grammars, we can fix the problem then. For now I don't think there's a reasonable justification for such, especially since they'd require subtly different rules than comma-elision.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7218#issuecomment-1100241345 using your GitHub account


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

Received on Friday, 15 April 2022 17:19:55 UTC