Re: [csswg-drafts] [css-values] Automatic parsing of value definitions (#2921)

Could I please have a clarification on definitions marked up with `data-dfn-type="function"`? I would like confirmation that this annotation allows the function to be referenced as a production, ie. with its name followed by `()`, both wrapped between `<` and `>`.

I'm asking this because I see [`url()`](https://drafts.csswg.org/css-values-4/#funcdef-url) and [`src()`](https://drafts.csswg.org/css-values-4/#funcdef-src) marked up with this attribute in CSS Values and extracted as follows in `w3c/webref`:

```json
  "<url()>": {
    "prose": "Typically, a <url> is written with the url() or src() functional notations:"
  },
  "<src()>": {
    "prose": "Typically, a <url> is written with the url() or src() functional notations:"
  },
```

But there is no reference of these productions in any definition, not even in the definition of `<url>`, eg. with `<url> = <url()> | <src()>` instead of `url(<string> <url-modifier>*) | src(<string> <url-modifier>*)`.

They may be isolated cases, but it makes me wonder if the only difference with `data-dfn-type="type"` is that `data-dfn-type="function"` is used to define the syntax of a component value that is a function, wheras the former defines the syntax of a component value that is a token. But then why not marking up eg. `<supports-decl>` with `data-dfn-type="simple-block"`? Why does this distinction exist between `type` and `function`?

> While our functions are often uniquely named, they should in fact be treated the same as keywords - potentially context-sensitive.

I believe that the only difference with a function definition marked up with `data-dfn-type="value"` is that a function marked up with `data-dfn-type="function"` should be unique, whereas the former is similar to a keyword, as indicated by the above comment quoted from an issue about mutliple definitions of `fit-content()`, marked up with `data-dfn-type="value"`.

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


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

Received on Tuesday, 28 June 2022 14:28:24 UTC