|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <head> |
|
4 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
5 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
|
6 </head> |
|
7 <body> |
|
8 <script type="application/javascript;version=1.7"> |
|
9 "use strict"; |
|
10 |
|
11 SimpleTest.waitForExplicitFinish(); |
|
12 |
|
13 function checkPointerEvents() { |
|
14 let iframe = this; |
|
15 let fRect = iframe.getBoundingClientRect(); |
|
16 let e1 = document.elementFromPoint(fRect.left + 10, fRect.top + 10); |
|
17 let e2 = document.elementFromPoint(fRect.left + 110, fRect.top + 110); |
|
18 if (e1 === document.body && e2 === iframe) { |
|
19 is(e1, document.body, "check point in transparent region of the iframe"); |
|
20 is(e2, iframe, "check point in opaque region of the iframe"); |
|
21 SimpleTest.finish(); |
|
22 } |
|
23 else { |
|
24 SimpleTest.executeSoon(checkPointerEvents.bind(iframe)); |
|
25 } |
|
26 } |
|
27 |
|
28 function runTest() { |
|
29 let iframe = document.createElement("iframe"); |
|
30 SpecialPowers.wrap(iframe).setAttribute('mozbrowser', 'true'); |
|
31 SpecialPowers.wrap(iframe).setAttribute('mozpasspointerevents', 'true'); |
|
32 SpecialPowers.wrap(iframe).setAttribute('remote', 'true'); |
|
33 iframe.style = "border:none; width:400px; height:400px; pointer-events:none"; |
|
34 iframe.src = "data:text/html,<html style='pointer-events:none'><div style='margin:100px; width:100px; height:100px; background:yellow; pointer-events:auto'>"; |
|
35 |
|
36 document.body.appendChild(iframe); |
|
37 |
|
38 SimpleTest.executeSoon(checkPointerEvents.bind(iframe)); |
|
39 } |
|
40 addEventListener("load", function() { |
|
41 SpecialPowers.addPermission("browser", true, document); |
|
42 SpecialPowers.addPermission("embed-apps", true, document); |
|
43 SpecialPowers.pushPrefEnv({ |
|
44 "set": [ |
|
45 ["dom.ipc.browser_frames.oop_by_default", true], |
|
46 ["dom.mozBrowserFramesEnabled", true] |
|
47 ] |
|
48 }, runTest); |
|
49 }); |
|
50 </script> |
|
51 </body> |
|
52 </html> |