bug199692-scrolled.html (1015B)
1 <!DOCTYPE html> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=199692 5 --> 6 <head> 7 <title>Scrolled page for bug 199692 tests</title> 8 <style type="text/css"> 9 /* Disable default margins/padding/borders so (0, 0) gets a div. */ 10 * { margin: 0; padding: 0; border: 0; } 11 </style> 12 <script type="application/javascript"> 13 function $(id) { return document.getElementById(id); } 14 15 function runTests() 16 { 17 var is = window.parent.is; 18 19 is(document.elementFromPoint(0, 0), $("down"), 20 "document.elementFromPoint not respecting scrolling?"); 21 is(document.elementFromPoint(200, 200), null, 22 "should have returned null for a not-visible point"); 23 is(document.elementFromPoint(3, -5), null, 24 "should have returned null for a not-visible point"); 25 } 26 </script> 27 </head> 28 <!-- This page is loaded in a 200px-square iframe scrolled to #down. --> 29 <body> 30 <div style="height: 150px; background: lightblue;">first</div> 31 <div id="down" style="height: 250px; background: lightgreen;">second</div> 32 </body> 33 </html>