| <!DOCTYPE html> |
| <style> |
| html, body { |
| height: 100px; |
| width: 100px; |
| background: green; |
| padding: 0; |
| margin: 0; |
| } |
| |
| div#child { |
| position: relative; |
| top : 700px; |
| width: 50px; |
| height: 300px; |
| background: red; |
| } |
| |
| </style> |
| <body> |
| <div id='child'></div> |
| </body> |
| |
| <script> |
| document.addEventListener("contextmenu", function(){ |
| top.debug("PASS context_menu_triggered in iframe"); |
| }); |
| |
| document.addEventListener("click", function(){ |
| top.debug("PASS click_triggered in iframe"); |
| }); |
| |
| window.onload = function(evt) { |
| document.scrollingElement.scrollTop = "1000"; |
| top.debug("iframe's scroll top is " + document.scrollingElement.scrollTop); |
| top.postMessage("subframe-loaded", "*"); |
| } |
| |
| </script> |