1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/base/tests/chrome/passpointerevents_window.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,27 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<head> 1.7 + <title>Test that mozpasspointerevents works</title> 1.8 +</head> 1.9 +<body onload="startTest()"> 1.10 +<iframe id="f" style="border:none; width:200px; height:200px; pointer-events:none" mozpasspointerevents 1.11 + src="data:text/html,<html style='pointer-events:none'><div style='margin:100px; width:100px; height:100px; background:yellow; pointer-events:auto'>"> 1.12 +</iframe> 1.13 + 1.14 +<script type="application/javascript"> 1.15 +var SimpleTest = window.opener.SimpleTest; 1.16 +var is = window.opener.is; 1.17 + 1.18 +function startTest() { 1.19 + var f = document.getElementById("f"); 1.20 + var fRect = f.getBoundingClientRect(); 1.21 + var e1 = document.elementFromPoint(fRect.left + 10, fRect.top + 10); 1.22 + is(e1, document.body, "check point in transparent region of the iframe"); 1.23 + var e2 = document.elementFromPoint(fRect.left + 110, fRect.top + 110); 1.24 + is(e2, f, "check point in opaque region of the iframe"); 1.25 + window.close(); 1.26 + SimpleTest.finish(); 1.27 +} 1.28 +</script> 1.29 +</body> 1.30 +</html>