Re: [csswg-drafts] [Meta] Modular/distributed grammar definitions (#6744)

I actually think the centralization (and attendant maintenance burden) is a good thing, because it means you can find all the instances of a production in one place, rather than having to know all the places it's defined in.  This is the same issue with `partial` in WebIDL, which has both good and bad parts to it.

For instance:

> and makes it more likely for these definitions to get out of sync as tokens are added or removed (case in point: I just added oklab() and oklch() to the <color> grammar because they had not been added there too).

This proposal wouldn't actually help with this; if you can remember to write the `<color> |= ...` line, it's *exactly equivalent* to instead remember to update the `<color> = ` line. If you were going to forget one, you're going to forget the other.

We've seriously considered removing `partial` from WebIDL and instead requiring specs to just update the core definition, but it's always been rejected because there's just *so many* specs altering certain core interfaces like `Document`, so it would end up kinda unreadable. But that's not the case with CSS definitions; our stuff is pretty well centralized and we don't add new productions to things that often.

In the rare cases we have that *are* analogous, like defining all the things that are `<length>`s or whatever, we have a solution already - just say in prose that something is a `<length>`. It being a little clumsy is a bonus, because it encourages us to *mostly* just use the centralized grammar-based approach instead.

In theory, tooling can help with these issues. But there's no reason to rely on tooling when just authoring it directly is similarly easy.

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


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

Received on Tuesday, 19 October 2021 16:52:19 UTC