summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/layers/zindex-hit-test.html
blob: 3bfc66d5969da1cac1898357dee6f8b09dd7e223 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<!DOCTYPE html>
<head>
  <style type="text/css">
  #main {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 200px;
    height: 100px;
    z-index: -100;
    background-color: #eee;
  }
  #main:hover {
    background-color: orange;
  }
  
  #results {
    margin-top: 150px;
  }
  </style>
  <script type="text/javascript" charset="utf-8">
    if (window.testRunner)
      testRunner.dumpAsText();

    function runTest()
    {
      var hitElement = document.elementFromPoint(50, 50);
      var results = document.getElementById('results');
      var main = document.getElementById('main');
      if (hitElement == main)
        results.innerHTML = 'Hit testing found div "main": PASS';
      else
        results.innerHTML = 'Hit testing did not find div "main": FAIL';
    }
  </script>
</head>
<body onload="runTest()">
    <div id="main">
      Div with z-index: -100
    </div>
    <div id="results">
    </div>
</body>
</html>