[csswg-drafts] [css-images-4] Saturate invalid cross-fade values (#5333)

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

== [css-images-4] Saturate invalid cross-fade values ==
Per the `cross-fade` [spec](https://drafts.csswg.org/css-images-4/#cross-fade-function):

> The percentage represents how much of each image is retained when it is blended with the other images. The percentage must be between 0% and 100% inclusive; **any other value is invalid** (emphasis mine).

This language is ambiguous as it doesn't specify what to do with an invalid value.

Currently both Safari and Chrome handle invalid values by saturating them between 0 and 100 percent. For example, using their [older, implemented syntax](https://github.com/w3c/csswg-drafts/issues/2234): 

```css
-webkit-cross-fade(
url('https://mdn.mozillademos.org/files/8543/br.png'),
url('https://mdn.mozillademos.org/files/8545/tr.png'),
-50%)
```

has a computed value of

```css
-webkit-cross-fade(
url('https://mdn.mozillademos.org/files/8543/br.png'),
url('https://mdn.mozillademos.org/files/8545/tr.png'),
0)
```

We should consider standardizing this behavior or specifying something else if that doesn't seem reasonable.

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

Received on Friday, 17 July 2020 18:37:49 UTC