OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <title>Test offsetX/offsetY on various types of elements</title> | 3 <title>Test offsetX/offsetY on various types of elements</title> |
4 <script type="text/javascript" charset="utf-8"> | 4 <script type="text/javascript" charset="utf-8"> |
5 if (window.testRunner) { | 5 if (window.testRunner) { |
6 testRunner.dumpAsText(); | 6 testRunner.dumpAsText(); |
7 testRunner.waitUntilDone(); | 7 testRunner.waitUntilDone(); |
8 } | 8 } |
9 | 9 |
10 function mousemoved(e) | 10 function mousemoved(e) |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 70 |
71 offsetX = 7; | 71 offsetX = 7; |
72 offsetY = 6; | 72 offsetY = 6; |
73 positions = sumPositions(document.getElementById('inside-overflow')); | 73 positions = sumPositions(document.getElementById('inside-overflow')); |
74 clientY = positions.offsetTop + positions.clientTop - positions.scrollTop
+ offsetY; | 74 clientY = positions.offsetTop + positions.clientTop - positions.scrollTop
+ offsetY; |
75 | 75 |
76 var content = document.getElementById('overflow-contents'); | 76 var content = document.getElementById('overflow-contents'); |
77 positions = sumPositions(content); | 77 positions = sumPositions(content); |
78 var inside = document.getElementById('inside-overflow'); | 78 var inside = document.getElementById('inside-overflow'); |
79 var overflow = document.getElementById('overflow'); | 79 var overflow = document.getElementById('overflow'); |
80 clientX = positions.offsetLeft + overflow.clientLeft + content.clientWidth
- inside.clientWidth - window.scrollX + offsetX; | 80 var borderWidth = 2; |
| 81 var scrollbarWidth = overflow.offsetWidth - overflow.clientWidth - 2*borde
rWidth; |
| 82 clientX = positions.offsetLeft + overflow.clientLeft + content.clientWidth
- scrollbarWidth - inside.clientWidth - window.scrollX + offsetX; |
81 dispatchEvent(clientX, clientY, 'inside-overflow', offsetX, offsetY); | 83 dispatchEvent(clientX, clientY, 'inside-overflow', offsetX, offsetY); |
82 | 84 |
83 offsetX = 11; | 85 offsetX = 11; |
84 offsetY = 16; | 86 offsetY = 16; |
85 positions = sumPositions(document.getElementById('transformed')); | 87 positions = sumPositions(document.getElementById('transformed')); |
86 var sin20 = Math.sin(-20 * Math.PI / 180); | 88 var sin20 = Math.sin(-20 * Math.PI / 180); |
87 var cos20 = Math.cos(-20 * Math.PI / 180); | 89 var cos20 = Math.cos(-20 * Math.PI / 180); |
88 clientX = positions.offsetLeft + positions.clientLeft - positions.scrollLe
ft + 100 + Math.round(100 - (100 - offsetX) * cos20 - (60 - offsetY) * sin20); | 90 clientX = positions.offsetLeft + positions.clientLeft - positions.scrollLe
ft + 100 + Math.round(100 - (100 - offsetX) * cos20 - (60 - offsetY) * sin20); |
89 clientY = positions.offsetTop + positions.clientTop - positions.scrollTop
+ 50 + Math.round(60 + (100 - offsetX) * sin20 - (60 - offsetY) * cos20); | 91 clientY = positions.offsetTop + positions.clientTop - positions.scrollTop
+ 50 + Math.round(60 + (100 - offsetX) * sin20 - (60 - offsetY) * cos20); |
90 dispatchEvent(clientX, clientY, 'transformed', offsetX, offsetY); | 92 dispatchEvent(clientX, clientY, 'transformed', offsetX, offsetY); |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, qui
s nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.<
/p> | 288 <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, qui
s nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.<
/p> |
287 <div id="inside-overflow">In RTL overflow</div> | 289 <div id="inside-overflow">In RTL overflow</div> |
288 <p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dol
ore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, su
nt in culpa qui officia deserunt mollit anim id est laborum.</p> | 290 <p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dol
ore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, su
nt in culpa qui officia deserunt mollit anim id est laborum.</p> |
289 </div> | 291 </div> |
290 </div> | 292 </div> |
291 <div id="results"></div> | 293 <div id="results"></div> |
292 <div id="mousepos"></div> | 294 <div id="mousepos"></div> |
293 | 295 |
294 </body> | 296 </body> |
295 </html> | 297 </html> |
OLD | NEW |