Re: transition using matrix to/from zero values can not be decomposed

On Jun 23, 2013, at 3:38 AM, Jon Ronnenberg <jon.ronnenberg@gmail.com> wrote:

> Thank you both. I didn't think of using scaleY but it's perfect in this use-case.
> 
> Still, I believe there exist further corner cases where it's desirable to animate to/from zero values, using a matrix. Shouldn't the spec matrix interpolation handle such cases?

There are certain cases that can not be described with matrix interpolations (like 3 turns around the own axis) and certain value interpolations that are not supported by the algorithm for decomposing/recomposing. That is absolutely fine as long as it is defined in the spec. This is one of the reasons why you should use the other transform functions where possible.

The interpolation algorithm in the spec is just one way to do smooth interpolations between matrices, but doesn't guarantee that it is your preferred way of interpolation.

Greetings,
Dirk

> 
> 
> On Sun, Jun 23, 2013 at 4:58 AM, Rik Cabanier <cabanier@gmail.com> wrote:
> yes,
> in general it's much better to use the other transform function than a matrix. Matrix interpolation was added for completeness but you shouldn't really be using it.
> 
> The current matrix decomposition logic also only matches Chrome at the moment. Both Safari and Firefox will use different interpolation logic so your animation might look different.
> 
> 
> On Sat, Jun 22, 2013 at 7:32 PM, Shane Stephens <shans@google.com> wrote:
> 
> On Jun 23, 2013 11:48 AM, "Jon Ronnenberg" <jon.ronnenberg@gmail.com> wrote:
> >
> > According to Decomposing the Matrix, transitions from matrix(1, 0, 0, 0, 0, 0) to matrix(1, 0, 0, 1, 0, 0) is not possible. This simple transform is saying an element is zero units high and will become it's full height. Imagine a slide-down animation.
> >
> > Due to this, browser vendors can not "fix" this without violating the specs and web authors have to work around this limitation by using max-height transitions with guessed maximum height or revert to use javascript.
> 
> That may be true with regards to browser vendors, but web authors can use the much simpler work around of transitioning scaleY.
> 
> Cheers,
>     - Shane
> 
> > I'm not sure if this is a documentation bug or a spec omission. But I sincerely hope that this is not the intended behavior.
> >
> > It should be said that all browsers that supports transform transitions can animate from matrix(1, 0, 0, 0.0001, 0, 0) to matrix(1, 0, 0, 1, 0, 0). Webkit does however leave a 1px artifact instead of hiding the element completely.
> >
> > Cheers, Jon
> 
> 

Received on Sunday, 23 June 2013 15:27:22 UTC