Re: [csswg-drafts] [css-animations] Clarify whether `<keyframes-name>` supports the empty string (#7762)

Hi @dholbert , I'm moving the discussion form [PR #12985](https://github.com/w3c/csswg-drafts/pull/12985#discussion_r2512186604) here. 

> Seems to me like we should ensure it's specified. Right now, Chrome Canary/Safari/Firefox all differ on how to serialize animation-name: '' (and specifically whether you get the empty string vs. none in the specified & computed style.) See https://bugzilla.mozilla.org/show_bug.cgi?id=1998933#c6 for testcases and results.

I think there is a confusion here between ```''``` and ```'""'```. The former would clear out the previous specified value, if any, so it has no value (defaulting to the initial value as resolved and computed value). I guess no value is serialized as an empty string and as I said, the computed value would be ```none``` as ````<ident>````; this is Firefox's implemented behavior, as far as I know.  The latter is considered as an invalid value, so it won't be assigned; hence, the specified value would be the previous one, if any.  

> This is a web-exposed behavior; the WPT (https://wpt.fyi/results/css/css-animations/parsing/animation-name-invalid.html ) happens to test the specified-style serialization where Chrome/Safari happen to now agree and diverge from Firefox, and the divergence is why Firefox is currently marked as failing a subtest there.

The failure comes from the fact that ```test_invalid_value``` assigns ````''```` to the property to clear out the previous value. It seems that Firefox accepts ```'""'```  as a valid ```<string>``` value, when it shouldn't as agreed here by Tab and Fantasai. Then Firefox serializes the empty string as ````none```, but the lack of inteop  comes form the fact that Firefox accepts the empty string as valid value. 

> Chrome agrees with Firefox on the computed-style-serialization, though; so if there were a WPT for that (maybe there is?) then Chrome/Firefox would get one result and Safari would get another.

The  [animation-name-computed.html](https://github.com/web-platform-tests/wpt/blob/master/css/css-animations/parsing/animation-name-computed.html) test should be the one to capture such test case. But since the empty string should be invalid, it wouldn't make sense to add it. 

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


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

Received on Tuesday, 11 November 2025 23:32:02 UTC