1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/html/document/test/bug199692-scrolled.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,34 @@ 1.4 +<!DOCTYPE html> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=199692 1.8 +--> 1.9 +<head> 1.10 + <title>Scrolled page for bug 199692 tests</title> 1.11 + <style type="text/css"> 1.12 +/* Disable default margins/padding/borders so (0, 0) gets a div. */ 1.13 +* { margin: 0; padding: 0; border: 0; } 1.14 + </style> 1.15 + <script type="application/javascript"> 1.16 +function $(id) { return document.getElementById(id); } 1.17 + 1.18 +function runTests() 1.19 +{ 1.20 + var is = window.parent.is; 1.21 + 1.22 + is(document.elementFromPoint(0, 0), $("down"), 1.23 + "document.elementFromPoint not respecting scrolling?"); 1.24 + is(document.elementFromPoint(200, 200), null, 1.25 + "should have returned null for a not-visible point"); 1.26 + is(document.elementFromPoint(3, -5), null, 1.27 + "should have returned null for a not-visible point"); 1.28 +} 1.29 + </script> 1.30 +</head> 1.31 +<!-- This page is loaded in a 200px-square iframe scrolled to #down. --> 1.32 +<body> 1.33 +<div style="height: 150px; background: lightblue;">first</div> 1.34 +<div id="down" style="height: 250px; background: lightgreen;">second</div> 1.35 +</body> 1.36 +</html> 1.37 +