- From: Daniel Holbert via GitHub <noreply@w3.org>
- Date: Wed, 12 Nov 2025 21:52:42 +0000
- To: public-css-archive@w3.org
> Hi [@dholbert](https://github.com/dholbert) , I'm moving the discussion form [PR #12985](https://github.com/w3c/csswg-drafts/pull/12985#discussion_r2512186604) here.
Thanks!
> The latter `'""'` is considered as an invalid value, so it won't be assigned;
This^ does not seem to be accurate (at least in Chrome Canary/Firefox/Safari TP), actually, based on my testcase. See below.
> The failure comes from the fact that `test_invalid_value` assigns `''` to the property to clear out the previous value.
I'm not focusing on that assignment inside of `test_invalid_value`. Rather, I'm focusing specifically on the last part of [animation-name-computed.html](https://github.com/web-platform-tests/wpt/blob/master/css/css-animations/parsing/animation-name-computed.html) where it literally tests `'""'` and expects it to be an invalid value:
```
test_invalid_value("animation-name", '""');
```
Currently, Chrome Canary & Safari TP & Firefox Nightly all agree that the value **parses successfully**. It's just that Chrome and Safari return the empty string as the serialized value, so it's indistinguishable whether they accepted it or rejected it. But you *can tell* that they accepted it, because it influences the cascade, if you check the computed style. Here's a testcase to do that:
https://bug1998933.bmoattachments.org/attachment.cgi?id=9526306
That testcase has a CSS rule in a `<style>` block to set `animation-name` to 'someStringValue', and then we use script add
```
testDiv.style.animationName = '""';
```
If any browser fully rejected that value as invalid-at-parse-time, then we would still report 'someStringValue' as the final computed style. (This is what happens in Chrome 143.)
But neither Firefox, Safari, nor Chrome 144 Canary do that -- they all change the computed style (to `none` in Firefox and Chrome canary, and to the empty string in Safari).
> It seems that Firefox accepts `'""'` as a valid `<string>` value, when it shouldn't as agreed here by Tab and Fantasai.
Not quite.
* That^ description seems to match what **Safari** does -- they accept the empty string and even use it as the computed value for animation-name.
* Chrome also accepts the empty string but treats it as `none` by computed-value time.
* Firefox accepts the empty string and internally treats it as `none` at parse time (because we literally encode the special `none` value as the empty-string, see [here](https://searchfox.org/firefox-main/rev/4fd0fa7e5814c0b51f1dd075821988377bc56cc1/servo/components/style/values/mod.rs#691-693) in the definition of `KeyframesName` which is the underlying type here.
So, I propose:
- we need to adjust `animation-name-computed.html` to not treat `'""'` as invalid, since (for now at least) all the major browsers **do treat it as valid**.
- but we need to decide how it should be handled (at parse time and computed-value time)
--
GitHub Notification of comment by dholbert
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7762#issuecomment-3524073561 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 12 November 2025 21:52:43 UTC