layout/base/tests/chrome/passpointerevents_window.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 <!DOCTYPE HTML>
     2 <html>
     3 <head>
     4   <title>Test that mozpasspointerevents works</title>
     5 </head>
     6 <body onload="startTest()">
     7 <iframe id="f" style="border:none; width:200px; height:200px; pointer-events:none" mozpasspointerevents
     8         src="data:text/html,<html style='pointer-events:none'><div style='margin:100px; width:100px; height:100px; background:yellow; pointer-events:auto'>">
     9 </iframe>
    11 <script type="application/javascript">
    12 var SimpleTest = window.opener.SimpleTest;
    13 var is = window.opener.is;
    15 function startTest() {
    16   var f = document.getElementById("f");
    17   var fRect = f.getBoundingClientRect();
    18   var e1 = document.elementFromPoint(fRect.left + 10, fRect.top + 10);
    19   is(e1, document.body, "check point in transparent region of the iframe");
    20   var e2 = document.elementFromPoint(fRect.left + 110, fRect.top + 110);
    21   is(e2, f, "check point in opaque region of the iframe");
    22   window.close();
    23   SimpleTest.finish();
    24 }
    25 </script>
    26 </body>
    27 </html>

mercurial