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

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

From: Sylvain Galineau <sylvaing@microsoft.com>
Date: Fri, 13 Jan 2012 19:15:05 +0000
To: Boris Zbarsky <bzbarsky@MIT.EDU>, Tab Atkins Jr. <jackalmage@gmail.com>
CC: "www-style@w3.org" <www-style@w3.org>
Message-ID: <3C4041FF83E1E04A986B6DC50F017829034006B9@TK5EX14MBXC296.redmond.corp.microsoft.com>

[Boris Zbarsky:]
> On 12/14/11 1:49 PM, Tab Atkins Jr. wrote:
> > Yup, which is a good reason why Transitions should act like Animations
> > and not start if the start-state was display:none.
> My point is that the not-computing behavior may not be limited to
> display:none.
> Again, nothing in the spec currently says when styles are actually
> computed.  Transition starts depend on changes to computed style, so
> transitions can only start if the style changes after the first time
> it's computed.
> If we seriously wanted to define this somehow, we would need to define
> _exactly_ when styles are computed.  Doing this and getting UA vendors
> to agree to the definition could be exciting.
This definitely seems challenging. Given something like:

E { display:none; color:red; transition: color 0.25s; }

...then script such as:

e.style.color = "blue";
e.style.display = "block";

The expectation is that no transition occurs because the element was
display:none when the color property was updated.

But if we now did:

e.style.display = "block";
e.style.color = "blue";

..then the expectation is that A transition should occur as the color update occurs after
the element is told to generate visible boxes again. Which puts pretty stringent requirement 
on browsers with respect to when styles are computed. Today only Opera and IE10 seem to align 
with this expectation though I haven't done anywhere enough testing to establish that can be
relied on. 

Received on Friday, 13 January 2012 19:49:02 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:09 UTC