bug199692-scrolled.html 1015 B

1234567891011121314151617181920212223242526272829303132333435
  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. function runTests()
  15. {
  16. var is = window.parent.is;
  17. is(document.elementFromPoint(0, 0), $("down"),
  18. "document.elementFromPoint not respecting scrolling?");
  19. is(document.elementFromPoint(200, 200), null,
  20. "should have returned null for a not-visible point");
  21. is(document.elementFromPoint(3, -5), null,
  22. "should have returned null for a not-visible point");
  23. }
  24. </script>
  25. </head>
  26. <!-- This page is loaded in a 200px-square iframe scrolled to #down. -->
  27. <body>
  28. <div style="height: 150px; background: lightblue;">first</div>
  29. <div id="down" style="height: 250px; background: lightgreen;">second</div>
  30. </body>
  31. </html>