W3C home > Mailing lists > Public > www-style@w3.org > March 2012

Re: [css3-transitions] Transitions from display:none

From: Dan Beam <dbeam@google.com>
Date: Mon, 19 Mar 2012 18:39:05 -0700
Message-ID: <CANpe7K33BMX9nKKQoVikYKqNvo8OPN8kE-wPuOMaHMLxtiGR4A@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: James Robinson <jamesr@google.com>, "Tab Atkins Jr." <jackalmage@gmail.com>, Sylvain Galineau <sylvaing@microsoft.com>, "www-style@w3.org" <www-style@w3.org>
> But the larger point that the flushing mechanism is not identical is
> absolutely true.  I expect there are other differences as well.
> Need to think a bit about the proposal.

Sorry to revive an old thread, but has there been any progress /
further thought on this issue?

I've noticed various web authors have been using hacks like
setTimeout() and .scrollTop to force a style flush to avoid issues
around code like:

  someNode.hidden = false; // or something else that affects display
  someNode.classList.add('do-a-transition'); // this fails to transition

You can see this behavior still exhibited in both Gecko and WebKit:

  http://jsfiddle.net/C2JtJ/11/show/ (no transition)
  http://jsfiddle.net/C2JtJ/10/show/ (touches .scrollTop, transition works)
  http://jsfiddle.net/C2JtJ/9/show/ (uses setTimeout, transition works
in WebKit and sometimes in Gecko)

I understand that the CSS3 transitions spec reads:

  "Since this specification does not define what property changes are
considered simultaneous, authors should be aware that changing any of
the transition properties a small amount of time after making a change
that might transition can result in behavior that varies between
implementations, since the changes might be considered simultaneous in
some implementations but not others."

But display is not a transitioning (or even transition-able, AFAIK)
property in this case, so is this an implementation defect?

This has lead to the need for stuff like this in our code:


I can only imagine that this will mystify many when CSS transitions
enter the mainstream further.

Dan Beam
Received on Tuesday, 20 March 2012 08:12:42 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:14:12 UTC