1 <!DOCTYPE html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
11 background-color: red;
12 -webkit-transform: translateX(100px);
13 -webkit-transition-property: -webkit-transform;
14 -webkit-transition-duration: 4s;
15 -webkit-transition-timing-function: linear;
22 background-color: yellow;
26 <script src="resources/transition-test-helpers.js"></script>
27 <script type="text/javascript">
28 function checkResult(pos, isIn)
30 var elt = document.elementFromPoint(pos, 150);
31 var good = isIn ? "inside" : "outside";
32 var bad = isIn ? "outside" : "inside";
33 return (isIn == (elt.id == "target")) ?
34 "<span style='color:green'>PASS</span> - " + pos + "px was " + good + " as it should be" + "<br>" :
35 "<span style='color:red'>FAIL</span> - " + pos + "px was " + bad + " and should have been " + good + "<br>";
38 function checkResults()
40 // Test before (150), in (300) and after (450)
42 result += checkResult(150, false);
43 result += checkResult(300, true);
44 result += checkResult(450, false);
45 document.getElementById('result').innerHTML = result;
50 if (window.testRunner) {
51 var target = document.getElementById('target');
52 if (!pauseTransitionAtTimeOnElement("-webkit-transform", 2.0, target))
53 throw("Transition is not running");
56 testRunner.notifyDone();
59 window.setTimeout("checkResults()", 2000);
65 if (window.testRunner) {
66 testRunner.dumpAsText();
67 testRunner.waitUntilDone();
70 document.getElementById("target").style.webkitTransform = "translateX(300px)";
71 waitForAnimationStart(doTest);
75 <body onload="startTest()">
77 This test starts a transition of the '-webkit-transform' property and then does elementFromPoint calls
78 at the shown yellow dots to see if hit testing works
80 <div id="target"></div>
81 <div class="dot" style="left:150px"></div>
82 <div class="dot" style="left:300px"></div>
83 <div class="dot" style="left:450px"></div>
84 <div id="result"></div>