summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/css/pseudo-element-hit-test.html
blob: 0e197e9bde0823e07b6a0f1a73069c92f8469f0f (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<!doctype html>
<script src="../../resources/js-test.js"></script>
<style>
#left {
  position: absolute;
  top: 0;
  left: 0;
}
#right {
  position: absolute;
  top: 0;
  left: 200px;
}
#button {
  margin: 0;
  width: 50px;
  height: 50px;
}
#button:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 50px;
  height: 50px;
  background: rgba(0, 255, 0, 0.3);
}
#div {
  margin: 0;
  width: 50px;
  height: 50px;
  border: 1px solid blue;
}
#div:before {
  content: 'BEFORE';
  display: table-cell;
  will-change: position;
  padding: 25px;
  background: rgba(0, 255, 0, 0.3);
}
#console {
  position: absolute;
  top: 200px;
}
</style>

<div id='left'>
  <button id='button'>Button Test</button>
</div>
<div id='right'>
  <div id='div'>Div Test</div>
</div>

<div id='console'></div>

<script>
shouldBe('document.elementFromPoint(25, 25).id', "'button'");
shouldBe('document.elementFromPoint(225, 25).id', "'div'");
</script>