3 <title>Hit testing on backface
</title>
4 <style type=
"text/css" media=
"screen">
7 outline:
4px solid orange;
12 background-color: #EEE;
13 border:
1px solid black;
14 -webkit-transform-style: preserve-
3d;
15 transform: translateZ(
1px) rotateY(
180deg);
20 display: inline-block;
23 background-color: gray;
30 <script type=
"text/javascript" charset=
"utf-8">
33 var results = document.getElementById('results');
34 results.innerHTML += s + '
<br>';
39 var firstHit = document.elementFromPoint(
120,
150);
40 var secondHit = document.elementFromPoint(
300,
150);
42 var box1 = document.getElementById('box1');
43 var box2 = document.getElementById('box1');
44 var container = document.getElementById('container');
46 if (firstHit == container)
47 log('Found container on left: PASS');
49 log('Found ' + firstHit.id + ' on left: FAIL');
51 if (secondHit == box1)
52 log('Found box1 on right: PASS');
54 log('Found ' + secondHit.id + ' on right: FAIL');
59 <body onload=
"runTest()">
61 <p>There are two boxes inside a container that is rotated
180° in Y. box2 has backface-visibility: hidden, so you can't see it.
</p>
63 <div class=
"box" id=
"box1">box1
</div>
64 <div class=
"box" id=
"box2" style=
"-webkit-backface-visibility: hidden;">box2
</div>