blob: 5e1a366dfa2b489b28ef2de6813bb3f8c88d3d58 [file] [log] [blame]
<!doctype html><!-- webkit-test-runner [ experimental:WebAnimationsCSSIntegrationEnabled=false ] -->
<html>
<head>
<title>cubic-bezier value overflow: Transforms</title>
<style>
.box {
position: relative;
left: 0;
height: 100px;
width: 100px;
margin: 10px;
background-color: blue;
-webkit-transition: -webkit-transform 1s linear;
-webkit-transform: rotate(0deg);
}
.animating > .box {
-webkit-transform: rotate(180deg);
}
</style>
<script src="resources/transition-test-helpers.js"></script>
<script>
function DegreesToRotation(angle) {
return roundNumber(Math.cos(angle * Math.PI / 180), 5);
}
const expectedValues = [
// [time, element-id, property, expected-value, tolerance]
[0.5, "box1", "-webkit-transform.0", DegreesToRotation(137), 0.3],
[0.95, "box1", "-webkit-transform.0", DegreesToRotation(190), 0.3],
[0.10, "box2", "-webkit-transform.0", DegreesToRotation(-27), 0.3],
[0.50, "box2", "-webkit-transform.0", DegreesToRotation(75), 0.3],
[0.95, "box2", "-webkit-transform.0", DegreesToRotation(193), 0.3],
[0.10, "box3", "-webkit-transform.0", DegreesToRotation(-68), 0.3],
[0.50, "box3", "-webkit-transform.0", DegreesToRotation(-203), 0.3],
[0.15, "box4", "-webkit-transform.0", DegreesToRotation(231), 0.3],
[0.50, "box4", "-webkit-transform.0", DegreesToRotation(80), 0.3],
[0.80, "box4", "-webkit-transform.0", DegreesToRotation(48), 0.3],
];
function setupTest() {
document.getElementById('container').className = 'animating';
}
runTransitionTest(expectedValues, setupTest, usePauseAPI);
</script>
</head>
<body>
<div id="container">
<div class="box" id="box1" style="-webkit-transition-timing-function: cubic-bezier(0.3, 1.5, 0.8, 1.5);"></div>
<div class="box" id="box2" style="-webkit-transition-timing-function: cubic-bezier(0.4, -0.8, 0.7, 1.7);"></div>
<div class="box" id="box3" style="-webkit-transition-timing-function: cubic-bezier(0.7, -2, 1, -1.5);"></div>
<div class="box" id="box4" style="-webkit-transition-timing-function: cubic-bezier(0, 4, 1, -3);"></div>
</div>
<div id="result"></div>
</body>
</html>