[csswg-drafts] [css-images] Define `<zero>` as an alternative for `<angle>` (#8346)

cdoublev has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-images] Define `<zero>` as an alternative for `<angle>` ==
According to [CSS Values 4](https://drafts.csswg.org/css-values-4/#angles), `0` is an invalid `<angle>` if not otherwise defined explicitly:

  > For legacy reasons, some uses of `<angle>` allow a bare `0` to mean `0deg`. This is not true in general, however, and will not occur in future uses of the `<angle>` type.

[`<conic-gradient()>`](https://drafts.csswg.org/css-images-4/#funcdef-conic-gradient) and [`<linear-gradient()>`](https://drafts.csswg.org/css-images-3/#funcdef-linear-gradient) define `0` in prose as a valid `<angle>` representing a gradient paremeter (origin or direction) but not in the [color stop list](https://drafts.csswg.org/css-images-4/#color-stop-syntax) for `<conic-gradient()>`, whereas it is valid in Chrome/FF.

If I am not mistaken, these are the two remaining productions defining `0` as a valid `<angle>` in prose instead of hard-coding it in the basic syntax. For example, `<hue>` in color functions accepts `<number>`, transform functions accept `<zero>`, etc.

I suggest to define `0` as a valid `<angle>` in `<conic-gradient()>` and `<linear-gradient()>` in their basic syntax, which would allow to remove the note in CSS Values.

```diff
  conic-gradient() = conic-gradient(
-   [ [ from <angle> ]? [ at <position> ]? ] || <color-interpolation-method>,
+   [ [ from [<angle> | <zero>] ]? [ at <position> ]? ] || <color-interpolation-method>,
    <angular-color-stop-list>
  )
```

```diff
  <linear-gradient()> = linear-gradient(
-   [ <angle> | to <side-or-corner> ]? ,
+   [ <angle> | <zero> | to <side-or-corner> ]? ,
    <color-stop-list>
  )
```

```diff
-  <angular-color-hint> = <angle-percentage>
-  <color-stop-angle> = <angle-percentage>{1,2}
+  <angular-color-hint> = [<angle-percentage> | <zero>]
+  <color-stop-angle> = [<angle-percentage> | <zero>]{1,2}
```

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8346 using your GitHub account


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

Received on Saturday, 21 January 2023 10:34:57 UTC