Re: Proposal: will-animate property

On Fri, Dec 6, 2013 at 4:19 AM, Dirk Schulze <dschulze@adobe.com> wrote:

>
> On Dec 6, 2013, at 7:27 AM, Nat Duca <nduca@chromium.org> wrote:
>
> > Some folks try to get clever:
> > - translateZ(0) when the element is not moving, as a way to trick a layer
> > But then they do a 2d animation... using translate2d(x,y). This causes
> the element to lose its stacking context, triggering a repaint and possibly
> other unexpected behaviors.
>
> Short question off topic. What do you mean with “lose its stacking
> context”? Even 2D transforms create a stacking context and it should not
> lose it because of animations. Rather the opposite. In many implementations
> this even results in creating a layer.
>

I think what Nat meant to say here is that the element stops getting its
own layer. Setting translateZ(0) will promote it to have its own composited
layer but resetting its transform to a pure XY translation without an
explicit Z component will remove that layer and flatten the element back
with some ancestor. No changes in the stacking context will take place (and
hence no visual changes are expected) but a repaint of the ancestor's layer
will be necessary at that transition.

Received on Monday, 9 December 2013 09:04:00 UTC