Re: [csswg-drafts] [css-grid] Mark up minmax() and fit-content() as functions in the spec? (#7682)

  > As I said, the context-sensitivity is indicated by the functions have a `for` value, versus generally usable functions that don't have a `for` value.

Please tell me if I should open new issue(s) and/or PR(s).

If I am not mistaken, all functions below are defined `for` a single context except `rect()`.

**TLDR:** I suspect that you think most of them should rather be context-free.

In Filter Effects 1, filter functions (`blur()`, `brightness()`, etc) are defined `for` the `filter` property, but `<filter-function>` also expands to `<blur()> | <brightness() | etc`.

In CSS Transforms 1-2, transform functions (`matrix()`, `rotate()`, etc) are defined for the `transform` property, but they are also annotated between `<` and `>` in proses in the spec.

In CSS Shapes 1, shape functions (`circle()`, `ellipse()`, etc) are defined `for` the `<basic-shape>` type, which is not explicitly expanded (I requested this in #7390). 

Among shape functions, the definition of `rect()` changes in CSS Masking 1, where it is used `for` the `clip` property. I [suggested](https://github.com/w3c/fxtf-drafts/pull/468) to inline its definition in the value definition of `clip`.

In CSS Values 5, `crossorigin()`, `integrity()`, `referrerpolicy()`, are defined `for` the `<request-url-modifier>` type.

In CSS Easing 1-2:

  - `cubic-bezier()` is defined `for` the `<cubic-bezier-easing-function>` type
  - `steps()` is defined for the `<step-easing-function>` type
  - `linear()` is not defined `for` the `<linear-easing-function>` type but `<linear-easing-function> = linear(<linear-stop-list>)` is explicitly defined

In CSS Content 3, `leader()` is defined `for` the `<content-list>` type but it is also annotated between `<` and `>` in the value definition of `<content-list>`.

In CSS Overflow 4, `fade()` is defined `for` the `text-overflow` property but it is also annotated between `<` and `>` in the value definition of `text-overflow`.

In CSS Page Floats 3, `snap-block()` and `snap-inline()` are defined `for` the `float` property, but they are also annotated between `<` and `>` in the value definition of `float`.

In CSS Images 4, `type()` is defined `for` the `image-set()` function.

---
  
As a grammar-driven parser implementer, I have to manually define a context-sensitive function definition when it does not appear in the value definition of its context. 

For example, I would have to define: 

  - `<filter-shape> = circle(<shape-radius>? [at <position>]?) | ellipse([<shape-radius>{2}]? [at <position>]?) | etc`
  - `<transform-function> = matrix(<number>#{6}) | translate(<length-percentage> , <length-percentage>?) | etc`
  - `<basic-shape> = circle(<shape-radius>? [at <position>]?) | ellipse([<shape-radius>{2}]? [at <position>]?) | etc`
  - `<cubic-bezier-easing-function> = cubic-bezier(<number [0,1]>, <number>, <number [0,1]>, <number>)`
  - `<step-easing-function> = steps(<integer>, <step-position>?)`
  - etc
  
It would be nice to define in the spec.

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


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

Received on Thursday, 3 August 2023 12:25:35 UTC