1 <!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
6 <title>Test hit testing of left property while transitioning
</title>
7 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8">
14 background-color: red;
15 -webkit-transition-property: left;
16 -webkit-transition-duration:
4s;
17 -webkit-transition-timing-function: linear;
24 background-color: yellow;
28 <script type=
"text/javascript" charset=
"utf-8">
29 function checkResult(pos, isIn)
31 var elt = document.elementFromPoint(pos,
150);
32 var good = isIn ?
"inside" :
"outside";
33 var bad = isIn ?
"outside" :
"inside";
34 return (isIn == (elt.id ==
"target")) ?
35 "<span style='color:green'>PASS</span> - " + pos +
"px was " + good +
" as it should be" +
"<br>" :
36 "<span style='color:red'>FAIL</span> - " + pos +
"px was " + bad +
" and should have been " + good +
"<br>";
39 function checkResults()
41 // Test before (
150), in (
300) and after (
450)
43 result += checkResult(
150, false);
44 result += checkResult(
300, true);
45 result += checkResult(
450, false);
46 document.getElementById('result').innerHTML = result;
51 if (window.layoutTestController) {
52 if (!layoutTestController.pauseTransitionAtTimeOnElementWithId(
"left",
2.0,
"target"))
53 throw(
"Transition is not running");
56 layoutTestController.notifyDone();
59 window.setTimeout(
"checkResults()",
2000);
65 if (window.layoutTestController) {
66 layoutTestController.dumpAsText();
67 layoutTestController.waitUntilDone();
70 document.getElementById(
"target").style.left =
"300px";
71 window.setTimeout(doTest,
0);
75 <body onload=
"startTest()">
77 This test starts a transition of the 'left' 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>