OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <style> |
| 5 .container { |
| 6 position: absolute; |
| 7 height: 200px; |
| 8 width:200px; |
| 9 background-color: gray; |
| 10 } |
| 11 |
| 12 .nopreserve { |
| 13 top: 0; |
| 14 left: 0; |
| 15 } |
| 16 |
| 17 .preserve { |
| 18 top: 250px; |
| 19 left: 0; |
| 20 -webkit-transform-style: preserve-3d; |
| 21 -moz-transform-style: preserve-3d; |
| 22 transform-style: preserve-3d; |
| 23 } |
| 24 |
| 25 .box { |
| 26 width: 100%; |
| 27 position: absolute; |
| 28 height: 100%; |
| 29 top: 0; |
| 30 } |
| 31 |
| 32 .red { |
| 33 background-color: red; |
| 34 -webkit-transform: perspective( 600px ) rotateY( 45deg ); |
| 35 -moz-transform: perspective( 600px ) rotateY( 45deg ); |
| 36 transform: perspective( 600px ) rotateY( 45deg ); |
| 37 } |
| 38 |
| 39 .blue { |
| 40 background-color: blue; |
| 41 -webkit-transform: perspective( 600px ) rotateY( -45deg ); |
| 42 -moz-transform: perspective( 600px ) rotateY( -45deg ); |
| 43 transform: perspective( 600px ) rotateY( -45deg ); |
| 44 } |
| 45 |
| 46 /* target1 contain points with negative z-offsets */ |
| 47 #target { |
| 48 position: relative; |
| 49 height: 160px; |
| 50 width: 160px; |
| 51 margin: 20px; |
| 52 background-color: #DDD; |
| 53 -webkit-transform: rotate3d(0, 1, 0, -45deg); |
| 54 -webkit-transform-origin: right; |
| 55 -moz-transform: rotate3d(0, 1, 0, -45deg); |
| 56 -moz-transform-origin: right; |
| 57 transform: rotate3d(0, 1, 0, -45deg); |
| 58 transform-origin: right; |
| 59 } |
| 60 |
| 61 #description { |
| 62 margin-top: 460px; |
| 63 } |
| 64 </style> |
| 65 <script src="resources/hit-test-utils.js"></script> |
| 66 <script> |
| 67 const hitTestData = [ |
| 68 |
| 69 { 'point': [10, 100], 'target' : 'container-nopreserve' }, |
| 70 { 'point': [20, 100], 'target' : 'target2' }, |
| 71 { 'point': [80, 100], 'target' : 'target1' }, |
| 72 { 'point': [100, 100], 'target' : 'target1' }, |
| 73 { 'point': [120, 100], 'target' : 'target1' }, |
| 74 { 'point': [180, 100], 'target' : 'target1' }, |
| 75 { 'point': [190, 100], 'target' : 'container-nopreserve' }, |
| 76 |
| 77 { 'point': [10, 250], 'target' : 'container-preserve' }, |
| 78 { 'point': [20, 250], 'target' : 'target4' }, |
| 79 { 'point': [80, 250], 'target' : 'target4' }, |
| 80 { 'point': [100, 250], 'target' : 'target4' }, |
| 81 { 'point': [120, 250], 'target' : 'target3' }, |
| 82 { 'point': [180, 250], 'target' : 'target3' }, |
| 83 { 'point': [190, 250], 'target' : 'container-preserve' }, |
| 84 |
| 85 ]; |
| 86 window.addEventListener('load', runTest, false); |
| 87 </script> |
| 88 </head> |
| 89 <body> |
| 90 |
| 91 <div id="container-nopreserve" class="container nopreserve"> |
| 92 <div id="target2" class="box red"> |
| 93 </div> |
| 94 <div id="target1" class="box blue"> |
| 95 </div> |
| 96 </div> |
| 97 |
| 98 <div id="container-preserve" class="container preserve"> |
| 99 <div id="target3" class="box blue"> |
| 100 </div> |
| 101 <div id="target4" class="box red"> |
| 102 </div> |
| 103 </div> |
| 104 |
| 105 <p id="description">Checks that hit testing is correct when two layers with ne
gative z-offset overlap</p> |
| 106 |
| 107 <div id="results"></div> |
| 108 |
| 109 </body> |
| 110 </html> |
OLD | NEW |