1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/html/document/test/bug445004-inner.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,23 @@ 1.4 +document.domain = "example.org"; 1.5 +function $(str) { return document.getElementById(str); } 1.6 +function hookLoad(str) { 1.7 + $(str).onload = function() { window.parent.parent.postMessage('end', '*'); }; 1.8 + window.parent.parent.postMessage('start', '*'); 1.9 +} 1.10 +window.onload = function() { 1.11 + hookLoad("w"); 1.12 + $("w").contentWindow.location.href = "test1.example.org.png"; 1.13 + hookLoad("x"); 1.14 + var doc = $("x").contentDocument; 1.15 + doc.write('<img src="test1.example.org.png">'); 1.16 + doc.close(); 1.17 +}; 1.18 +function doIt() { 1.19 + hookLoad("y"); 1.20 + $("y").contentWindow.location.href = "example.org.png"; 1.21 + hookLoad("z"); 1.22 + var doc = $("z").contentDocument; 1.23 + doc.write('<img src="example.org.png">'); 1.24 + doc.close(); 1.25 +} 1.26 +window.addEventListener("message", doIt, false); 1.27 \ No newline at end of file