1 <!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
6 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8">
7 <title>Test of width Animation Using em Units
</title>
8 <style type=
"text/css" media=
"screen">
20 border:
1px solid black;
21 -webkit-animation-duration:
1s;
22 -webkit-animation-timing-function: linear;
23 -webkit-animation-name:
"anim";
25 @-webkit-keyframes
"anim" {
30 <script type=
"text/javascript" charset=
"utf-8">
31 if (window.layoutTestController) {
32 layoutTestController.dumpAsText();
33 layoutTestController.waitUntilDone();
37 const defaultTolerance =
10;
39 function isEqual(actual, desired, tolerance)
41 if (tolerance == undefined || tolerance ==
0)
42 tolerance = defaultTolerance;
43 var diff = Math.abs(actual - desired);
44 return diff < tolerance;
47 function snapshot(expected)
52 var width = parseInt(window.getComputedStyle(document.getElementById('box')).width);
53 if (!isEqual(width, expected)) {
54 result =
"FAIL(was:"+width+
", expected:"+expected+
")";
60 setTimeout(
"snapshot(133)",
333);
62 window.setTimeout(function() {
63 document.getElementById('result').innerHTML = result;
64 if (window.layoutTestController)
65 layoutTestController.notifyDone();
69 document.addEventListener('webkitAnimationStart', start, false);
74 This test performs an animation of the width property using 'em' units. It tests whether or not we are properly
75 getting the default font-size.
77 Here is some text. Here is some text. Here is some text. Here is some text. Here is some text. Here is some text.