- From: Tab Atkins Jr. via GitHub <sysbot+gh@w3.org>
- Date: Wed, 25 Sep 2024 16:13:37 +0000
- To: public-css-archive@w3.org
The grammar has to be followed exactly in the sense that you must get exactly the same observable end result as what the spec says. If you can do so by rewriting grammars to something else and handling them in a different way, but at the end the observable result is the same, great! Whatever you do internally is not our concern; what matters is what behavior we can observe via tests. We often write our grammars in ways intended to be somewhat more human-readable. In the attr selector case, for example, an attr without a comparison (`[foo]`) looks different from one with a comparison (`[foo="bar"]`, while all the comparison ones are only trivially different. It definitely *could* have been written all in one production, and you'll definitely find examples of that in other grammars; the exact choice depends on what the grammar writer felt was more readable at the time. If you ever wonder if you can handle something differently from how it's written in a spec, just ask yourself: does what I'm doing result in different behavior that the user of the page could observe (including with script)? If so, it's not valid; but if your difference is unobservable, feel free to do whatever. -- GitHub Notification of comment by tabatkins Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10944#issuecomment-2374529760 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 25 September 2024 16:13:38 UTC