2 <!-- This test reproduces a perspective w < 0 error addressed in
3 https://bugs.webkit.org/show_bug.cgi?id=79136. In that bug, as a layer is being
4 transformed, it may get "clamped" by the homogeneous coordinate w < 0. When
5 projecting individual points, this was handled correctly, but projecting quads was
6 ignoring this clamping, causing invalid quads to be generated, which ultimately did
7 not hit-test correctly.
10 <style type=
"text/css">
12 -webkit-perspective: 1000px;
13 -webkit-perspective-origin-x: 145px;
14 /* removing this property fixes the issue, but doesn't provide the desired rendering */
15 -webkit-perspective-origin-y: 189px;
22 -webkit-transform-style: preserve-3d
;
35 background-color: gray
;
38 .highlightOnHover:hover {
39 background-color: orange
;
43 transform: rotateX
(-240deg) translateZ
(200px)
47 transform: rotateX
(-300deg) translateZ
(200px)
51 background-color: green
;
61 <script src=
"resources/hit-test-utils.js"></script>
64 // Points near the corners of the top layer
65 { 'point': [35, 100], 'target' : 'topLayer' },
66 { 'point': [370, 100], 'target' : 'topLayer' },
67 { 'point': [40, 40], 'target' : 'topLayer' },
68 { 'point': [365, 40], 'target' : 'topLayer' },
70 // Points within the axis-aligned bounding box of the top layer, but not actually on the layer itself
71 { 'point': [35, 40], 'target' : 'backgroundLayer' },
72 { 'point': [370, 40], 'target' : 'backgroundLayer' },
74 // Points near the corners of the top layer
75 { 'point': [40, 340], 'target' : 'bottomLayer' },
76 { 'point': [365, 340], 'target' : 'bottomLayer' },
77 { 'point': [35, 260], 'target' : 'bottomLayer' },
78 { 'point': [370, 280], 'target' : 'bottomLayer' },
80 // Points within the axis-aligned bounding box of the bottom layer, but not actually on the layer itself
81 { 'point': [35, 340], 'target' : 'backgroundLayer' },
82 { 'point': [371, 340], 'target' : 'backgroundLayer' },
85 window
.addEventListener('load', runTest
, false);
91 <div id=
"backgroundLayer"></div>
94 <div id=
"intermediate" class=
"host" style=
"transform: rotate3d(1, 0, 0, 270deg)">
95 <div id=
"topLayer" class=
"highlightOnHover rotatedUp green box" style=
""></div>
96 <div id=
"bottomLayer" class=
"highlightOnHover rotatedDown green box" style=
""></div>
100 <div id=
"results"></div>