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


[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