W3C home > Mailing lists > Public > public-css-archive@w3.org > September 2016

[csswg-drafts] [css-variables] Define handling for 'display' to avoid infinite cycles

From: Brian Birtles via GitHub <sysbot+gh@w3.org>
Date: Tue, 20 Sep 2016 10:31:50 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-178023774-1474367507-sysbot+gh@w3.org>
birtles has just created a new issue for 
https://github.com/w3c/csswg-drafts:

== [css-variables] Define handling for 'display' to avoid infinite 
cycles ==
We define special tainting behavior to avoid cycles with animation 
properties but we have a similar issue for the 'display' property.

```css
:root {
  --foo: block
}
div {
  display: var(--foo);
  animation: change-foo 100s;
}
@keyframes change-foo {
  to, from { --foo: none; }
}
```

In this case, we start off with a `<div>` with `display: block`, run 
the animation which sets `--foo` to `none` so the `<div>` ends up with
 `display: none`. As a result we cancel the animation in `<div>`. 
Since we cancelled the animation, `--foo` goes back to `block`, and 
hence the animation restarts. And so on.

(For what it's worth, this is the reason why `display` is considered 
non-animatable for at least CSS animations and CSS transitions. As a 
result, the corresponding spec text might not necessarily need to 
refer to `display` specifically but rather all non-animatable 
properties.)

Please view or discuss this issue at 
https://github.com/w3c/csswg-drafts/issues/501 using your GitHub 
account
Received on Tuesday, 20 September 2016 10:31:59 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:03 UTC