blob: 125c28a68828b66fc109eec26fb61d5e688a77fb [file] [log] [blame]
<!doctype html>
This test performs an animation of the matrix operator. The matrix is defined so that the
decomposition (unmatrix) algorithm is tested on the path where the matrix is negated and the
the scaling factors are also negated.
The animation is started and a snapshot is taken after start. The "d" component of matrix
should be negative.
<style type="text/css" media="screen">
#box {
width: 100px;
height: 100px;
background-color: blue;
animation-duration: 10s;
@keyframes anim {
from { transform: matrix(1, 0, 0, -1, 0, 0); }
to { transform: matrix(1, 0, 0, 1, 0, 0); }
<script type="text/javascript" charset="utf-8">
if (window.testRunner) {
result = "PASS";
function snapshot()
var boxComputedStyle = window.getComputedStyle(document.getElementById('box'));
var matrix = new WebKitCSSMatrix(boxComputedStyle.transform);
// "d" component (scaleY) should be negative.
if (matrix["d"] > 0)
result = "FAIL(scaleY was positive, expected to be negative)";
document.getElementById('result').innerHTML = result;
if (window.testRunner)
function startAnimation()
document.getElementById("box").style.animationName = "anim";
document.addEventListener('webkitAnimationStart', snapshot, false);
<div id="box"></div>
<div id="result"></div>