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

On 4/17/12 11:10 PM, James Robinson wrote:
> Yes, I'm assuming that a UA can tell if an element is inside a
> display:none subtree or not and that this has some predictable impact on
> the computed style.

I don't think this is necessarily a good assumption, fwiw.  For example, 
both Gecko and WebKit can have elements with no box which are not in 
display:none subtrees.  These elements might get a box on a style or 
layout flush.  Some elements may have no box even if there is no 
display:none around (lots of examples of this with SVG, say).

The exact assumptions we really make here should be _very_ clearly 
spelled out.

Note that as far as I know WebKit can have useful computed styles even 
in display:none subtrees in some situations.  I could be wrong; I've 
only skimmed the relevant code.

>     But even that wouldn't guarantee the behavior you want in this case:
>     the UA might flush out recomputation of display, discover that a box
>     is needed and create one before it ever computes a color for that
>     box. Gecko doesn't do this right now, but nothing currently prevents it.
>
> That's perfectly fine.  The only requirement is that whenever the UA
> does update the computed value of the "color" property it record the
> "before" value at that time and it be able to distinguish a "before"
> value of "inside a display:none subtree".

I'm not quite sure what you mean, actually.  If there is a computed 
color value, and the display goes to "none", it sounds like at some 
point you want the UA to throw away that computed value, in some sense, 
right?

> There's also the question if when exactly the transition or animation
> property "takes effect".  In other words, what happens when you do:
>
> e.style.color="blue";
> e.style.transition="color 0.25s";
>
> vs
>
> e.style.transition="color 0.25s";
> e.style.color="blue";
>
> vs the more indirect mechanisms of changing DOM structure / class names
> / etc to cause selectors to match having the same effect.

Yep.  Right now the answer to those questions is UA-dependent, and for 
the two examples you wrote out above depends (in Gecko) on whether a 
flush takes place between the two inline style sets....

-Boris

Received on Wednesday, 18 April 2012 04:02:50 UTC