blob: 24fb11fef4e1872f142b0f572df551c07393b1bd [file] [log] [blame]
dino@apple.com58635032018-09-12 20:59:33 +00001<!DOCTYPE html><!-- webkit-test-runner [ experimental:WebAnimationsCSSIntegrationEnabled=true ] -->
mikelawther@chromium.orgb649e392012-07-27 04:32:08 +00002<style>
3#box {
4 width: 10%;
5 height: 100px;
6 background-color: green;
7 -webkit-transition: all 1s linear;
8}
9
10#box.final {
11 width: 400px;
12 height: 90%;
13}
14</style>
15Tests transitions to and from a mix of absolute and percent values
16</p>
17<div style="width: 500px; height: 500px;">
18 <div id="box"></div>
19</div>
20
21<div id="result">
22<script src="resources/transition-test-helpers.js"></script>
23<script type="text/javascript">
24
25const expectedValues = [
26 // [time, element-id, property, expected-value, tolerance]
27 // The transition takes 1 second, so we compute tolerance to allow
28 // 10% or 100ms variance, (endValue - startValue) / 10.
29 [0.5, 'box', 'width', 225, 35],
30 [0.5, 'box', 'height', 275, 35],
31];
32
33function setupTest()
34{
35 var box = document.getElementById('box');
36 box.className = 'final';
37}
38
39runTransitionTest(expectedValues, setupTest, usePauseAPI);
40</script>