1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/html/document/test/test_bug765780.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,46 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=765780 1.8 +--> 1.9 +<head> 1.10 + <meta charset="utf-8"> 1.11 + <title>Test for Bug 765780</title> 1.12 + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.13 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 1.14 + <script type="application/javascript"> 1.15 + /** Test for Bug 765780 **/ 1.16 + SimpleTest.waitForExplicitFinish(); 1.17 + window.onload = function() { 1.18 + var f = $("f"); 1.19 + var doc = f.contentDocument; 1.20 + doc.designMode = "on"; 1.21 + var s = doc.createElement("script"); 1.22 + s.textContent = "parent.called = true;"; 1.23 + 1.24 + window.called = false; 1.25 + doc.body.appendChild(s); 1.26 + ok(called, "Script in designMode iframe should have run"); 1.27 + 1.28 + doc = doc.querySelector("iframe").contentDocument; 1.29 + var s = doc.createElement("script"); 1.30 + s.textContent = "parent.parent.called = true;"; 1.31 + 1.32 + window.called = false; 1.33 + doc.body.appendChild(s); 1.34 + ok(called, "Script in designMode iframe's child should have run"); 1.35 + 1.36 + SimpleTest.finish(); 1.37 + } 1.38 + </script> 1.39 +</head> 1.40 +<body> 1.41 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=765780">Mozilla Bug 765780</a> 1.42 +<!-- Important: iframe needs to not be display: none --> 1.43 +<p id="display"><iframe id="f" src="data:text/html,<iframe></iframe>"></iframe> </p> 1.44 +<div id="content" style="display: none"> 1.45 +</div> 1.46 +<pre id="test"> 1.47 +</pre> 1.48 +</body> 1.49 +</html>