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

[css3-transitions] Why isn't the display property animatable?

From: Andy Earnshaw <andyearnshaw@gmail.com>
Date: Tue, 29 May 2012 01:03:36 +0100
Message-ID: <CAOrM_WPo17N2SvjeBxaurq_F=8f2jAiDm5jvE3jRqo_daXDrvQ@mail.gmail.com>
To: www-style@w3.org
On Mon, May 28, 2012 at 9:01 PM, Tab Atkins Jr. <jackalmage@gmail.com>wrote:

> "Just changing the rendered width/height" isn't so simple,
> unfortunately.  How does that interact with another animation
> animating width or height explicitly, for example?
Either I'm oversimplifying or your overcomplicating the steps, but let me
ask you how `padding-top` and `-bottom` would animate with `height`? Why
would you expect another animation that affects the rendered height of a
box to be any more complicated than that?

> This is why, so far, all the animatable property types are animated
> solely by doing a linear interpolation of some numbers in the
> representation.  That's easy to understand and self-contained.

Indeed, but why would animating the rendered height or width of a box from
0 to computed be any less linear?

> As for me thinking it odd, if we assume that all the difficulties with
> a property transition affecting other properties have been ironed out,
> then I merely think it odd to choose one particular method of
> animating 'display' as the "correct" default version when there are
> several equally-valid ways to do that.  That is why I referred to
> jQuery - they provide three different versions in the core library,
> all of which I've used at some point in my webdev experience.  If we
> were to do this kind of thing, we should do it in a way that's
> extensible, so authors can choose which kind of effect they want for
> fading something in/out, and even create their own.
> ~TJ

Again, I have to disagree here. jQuery's animation may throw opacity into
the mix, but it still slides (albeit diagonally, which I don't think would
work well for table rows). I think it makes sense to do a vertical slide
for block (and similar) boxes because those box types affect the layout by
pushing the content following it downwards. Likewise, a horizontal slide
for inline (and similar) or floated boxes because those elements push
content around it horizontally. Doing it any other way wouldn't make sense,
but in fairness you could throw `opacity` or `font-size` or whatever people
decide looks best if you wanted to. Again, I just think some animation is
better than none as far as web developers like me or you are concerned, and
animating an element from being hidden and not affecting layout to being
visible and affecting layout -- without having to jump through hoops like
animating `font-size` and `border-width` -- just seems like a no-brainer.
Received on Tuesday, 29 May 2012 00:04:05 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:59 UTC