summaryrefslogtreecommitdiffstats
path: root/dom/tests/mochitest/general/test_pointerPreserves3DClip.html
blob: 29c8f3e7e6c32a4b8fa324bbd67dfa92bd1af8c7 (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
<!DOCTYPE HTML>
<html>
<head>
  <title>Test for pointer events with preserve-3d and clips</title>
  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    <style type="text/css">
      .outer {
      transform-style: preserve-3d;
      }
      .container {
      overflow-y: scroll;
      overflow-x: hidden;
      width: 200px;
      height: 300px;
      }
      .content {
      width: 200px;
      height: 1000px;
      transform-style: preserve-3d;
      }
      #container1 {
      background-color: green;
      transform: translateZ(2px);
      }
      #container2 {
      height: 100px;
      transform: translateY(-200px) translateZ(10px);
      background-color: red;
      }
    </style>
  </head>
  <body onload="runTest();">
    <div class="outer" id="outer">
      <div class="container" id="container1">
	<div class="content"></div>
      </div>
      <div class="container" id="container2">
	<div class="content"></div>
      </div>
    </div>
<script class="testbody" type="text/javascript">
function runTest() {
    var outer = document.getElementById("outer");
    var x = outer.offsetLeft;
    var y = outer.offsetTop;
    var target = document.elementFromPoint(x + 100, y + 250);
    ok(target.parentNode == document.getElementById("container1"), "Find the right target.");
    SimpleTest.finish();
}

SimpleTest.waitForExplicitFinish();
</script>
  </body>
</html>