gecko-dev/layout/reftests/transform-3d/animate-preserve3d-ref.html
L. David Baron 38a633181f Bug 1176969 - Disable OMT animation for any frame in a preserve-3d scene rather than only frames whose parent and child are in a preserve-3d scene. r=mattwoodrow
frame->Preserves3D() is whether the frame's parent has transform-style:
preserve-3d, which means that the frame is part of the same 3-D scene as
its parent.  frame->Preserves3DChildren() is whether the frame itself
has transform-style: preserve-3d, which means that the frame is part of
the same 3-D scene as its children.

Neither of these are valid cases for doing off-main-thread (OMT)
animation because all of the layers in a preserve-3d scene are currently
siblings of each other, rather than preserving ancestor/descendant
relationships.  This means that it's not valid to animate transform of
the parent on the compositor because the compositor animation won't
update any of its children that have layers.  Likewise, it's not valid
to animate transform of the child on the compositor because the code
that sends transform information to the compositor doesn't handle the
accumulation of transforms needed to get the "right" transform for the
child (i.e., with the transforms of its ancestors up to the top of the
3-D scene merged in).

This means that we do OMT animation for slightly fewer cases with the
patch than we did without the patch.  This means it's pretty low risk in
terms of correctness, although there's a chance it might regress
performance on one of the (somewhat limited) set of cases where the
optimization was valid.  (Bug 779598 covers doing OMT animation for
preserve-3d cases, and depends on the work ongoing in bug 1097464.)

The animate-preserve3d-parent.html reftest doesn't fail without the
patch, since something seems to invalidate in the test; it was testing
the testcase that showed correct behavior when the mouse was moving, so
this isn't incredibly surprising (although that invalidation from mouse
movement is itself worth debugging).  The animate-preserve3d-child.html
test does fail without the patch, though.

(With an initial transform of none instead of the 30deg transform, both
tests also show an invalidation bug without the patch.)
2015-06-30 11:29:55 -07:00

34 lines
581 B
HTML

<!DOCTYPE HTML>
<html>
<title>Testcase, bug 1176969</title>
<style>
body { padding: 50px }
#grandparent { perspective: 400px }
#parent {
background: blue;
height: 200px; width: 200px;
border: 1px solid black;
transform-style: preserve-3d;
transform: rotateX(-45deg) rotateY(-45deg) rotateZ(-45deg);
will-change: transform;
}
#child {
transform: translateZ(15px);
height: 100px; width: 100px; margin: 50px;
background: yellow;
box-shadow: 3px 3px olive;
}
</style>
<div id="grandparent">
<div id="parent">
<div id="child">
</div>
</div>
</div>