summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/css-generated-content/hit-test-generated-content.html
blob: 4dde038c725a128a77af8ba962bd46d3db035f93 (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
45
<html>
<head>
<style>
#target {
  position: relative;
  width: 100px;
  height: 100px;
}

#target::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: gray;
  content: "";
}

</style>
<script type="text/javascript" charset="utf-8">
  if (window.testRunner)
    testRunner.dumpAsText();

  function runTest()
  {
    var hitElement = document.elementFromPoint(58, 58);
    var results = document.getElementById('results')
    if (hitElement && hitElement.id == 'target')
      results.innerHTML = 'elementFromPoint found target: PASS';
    else
      results.innerHTML = 'elementFromPoint did not find target: FAIL';
  }
</script>
</head>
<body onload="runTest()">

<p>Tests hit testing on generated content</p>
<div id="target">&nbsp;</div>

<div id="results">
</div>

</body>
</html>