Re: [css3-animations] Effect of display:none and visibility:hidden on animations

On 7/16/11 7:07 PM, Sylvain Galineau wrote:
> There does not seem to be agreement for display:none yet; WebKit does not run the animation and applying display:none resets the animation. But getComputedStyle() indicates Gecko animates the specified properties when display is none.
> WebKit's behavior is certainly performance-friendly

You need to be careful here.

Gecko normally does no style computation of any sort for elements in a 
display:none subtree (except for computing the display of the root, of 
course).  No selector matching for descendants, no computed style 
determination, no animations, etc.

_If_ you ask for the style of a node in such a subtree, then we'll go 
ahead and do the work of figuring that style out.  At that point we may 
do animations on it (though I suspect this only works on the root of the 
display:none subtree).

The behavior you see will depend on whether the node you're working with 
is the root of the display:none subtree or not, and likely on the exact 
timing of your getComputedStyle calls...

This probably does need to be specified somehow.  The problem, of 
course, is that the thing that triggers animations (determination of 
computed style) doesn't occur at a defined time.  Or rather conceptually 
it happens for all elements immediately but no UA actually does that.


Received on Sunday, 17 July 2011 01:05:13 UTC