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 font-size 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 {
26 from { font-size: 1em; }
27 to { font-size: 2em; }
30 <script type="text/javascript" charset="utf-8">
31 if (window.testRunner) {
32 testRunner.dumpAsText();
33 testRunner.waitUntilDone();
37 const defaultTolerance = 1;
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 fontSize = parseInt(window.getComputedStyle(document.getElementById('box')).fontSize);
53 if (!isEqual(fontSize, expected)) {
54 result = "FAIL(was:"+fontSize+", expected:"+expected+")";
60 setTimeout("snapshot(13)", 333);
62 window.setTimeout(function() {
63 document.getElementById('result').innerHTML = result;
64 if (window.testRunner)
65 testRunner.notifyDone();
69 document.addEventListener('webkitAnimationStart', start, false);
74 This test performs an animation of the font-size 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.
78 Here is some text. Here is some text. Here is some text. Here is some text. Here is some text. Here is some text.