| <html> |
| <head> |
| <style> |
| iframe { width: 400px; height: 200px;} |
| </style> |
| <script> |
| if (window.testRunner) { |
| testRunner.dumpAsText(); |
| testRunner.waitUntilDone(); |
| } |
| |
| function loaded() |
| { |
| document.getElementsByTagName('h4')[0].innerHTML = document.domain; |
| var iframe = document.getElementById("i"); |
| // The iframe uses eventSender to emulate a user navigatation, which requires absolute coordinates. |
| // Because the iframe is cross-origin, it can't get the offsets itself, so leak them. |
| frames[0].postMessage({x: iframe.offsetLeft, y: iframe.offsetTop}, "*"); |
| } |
| </script> |
| </head> |
| <body onload="loaded();"> |
| <p>This tests that an iframe in sandbox with 'allow-top-navigation-by-user-activation' |
| can navigate the top level page, if it is trigged by a user gesture.</p> |
| <h4>DOMAIN</h4> |
| <iframe id="i" sandbox="allow-scripts allow-top-navigation-by-user-activation" src="resources/iframe-that-performs-parent-navigation.html"></iframe> |
| </body> |
| </html> |