<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html lang="en">
<head>
  <title>Test hit testing of left property while animating</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <style>
    #target {
      position: absolute;
      left: 100px;
      height: 200px;
      width: 200px;
      background-color: red;
      -webkit-animation-duration: 4s;
      -webkit-animation-timing-function: linear;
    }
    @-webkit-keyframes "anim" {
        from { left: 100px; }
        to { left: 300px; }
    }
    
    .dot {
        width: 10px;
        height: 10px;
        top: 100px;
        background-color: yellow;
        position:absolute;
    }
    </style>

   <script src="resources/animation-test-helpers.js" type="text/javascript" charset="utf-8"></script>
   <script type="text/javascript" charset="utf-8">
        function checkResult(pos, isIn)
        {
            var elt = document.elementFromPoint(pos, 150);
            var good = isIn ? "inside" : "outside";
            var bad = isIn ? "outside" : "inside";
            return (isIn == (elt.id == "target")) ?
                "<span style='color:green'>PASS</span> - " + pos + "px was " + good + " as it should be" + "<br>" :
                "<span style='color:red'>FAIL</span> - " + pos + "px was " + bad + " and should have been " + good + "<br>";
        }
        
        function checkResults()
        {
            // Test before (150), in (300) and after (450)
            var result = "";
            result += checkResult(150, false);
            result += checkResult(300, true);
            result += checkResult(450, false);
            document.getElementById('result').innerHTML = result;
        }
     
        function doTest()
        {
            if (window.testRunner) {
                if (!testRunner.pauseAnimationAtTimeOnElementWithId("anim", 2.0, "target"))
                    throw("Transition is not running");
        
                checkResults();
                testRunner.notifyDone();
            }
            else {
                window.setTimeout("checkResults()", 2000);
            }
        }
    
        function startTest()
        {
            if (window.testRunner) {
                testRunner.dumpAsText();
                testRunner.waitUntilDone();
            }
      
            document.getElementById("target").style.webkitAnimationName = "anim";
            waitForAnimationToStart(document.getElementById('target'), doTest);
        }
   </script>
</head>
<body onload="startTest()">
    <div>
        This test starts an animation of the 'left' property and then does elementFromPoint calls
        at the shown yellow dots to see if hit testing works
    </div>
    <div id="target"></div>
    <div class="dot" style="left:150px"></div>
    <div class="dot" style="left:300px"></div>
    <div class="dot" style="left:450px"></div>
    <div id="result" style="position:absolute; top:250px"></div>
</body>
</html>
