11 background-color: red;
12 transform: translateX(
100px);
13 -webkit-transition-property: transform;
14 -webkit-transition-duration:
4s;
15 -webkit-transition-timing-function: linear;
22 background-color: yellow;
26 <script src=
"../animations/resources/animation-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 internals
.pauseAnimations(2);
55 testRunner
.notifyDone();
58 window
.setTimeout("checkResults()", 2000);
64 if (window
.testRunner
) {
65 testRunner
.dumpAsText();
66 testRunner
.waitUntilDone();
69 document
.getElementById("target").style
.webkitTransform
= "translateX(300px)";
70 requestAnimationFrame(doTest
);
74 <body onload=
"startTest()">
76 This test starts a transition of the 'transform' property and then does elementFromPoint calls
77 at the shown yellow dots to see if hit testing works
79 <div id=
"target"></div>
80 <div class=
"dot" style=
"left:150px"></div>
81 <div class=
"dot" style=
"left:300px"></div>
82 <div class=
"dot" style=
"left:450px"></div>
83 <div id=
"result"></div>