Mozilla/mozilla/content/html/document/test/bug445004-outer-write.html
bzbarsky%mit.edu 1b3e511f1c Bug 445004. Make the base and document URI of document.written documents be the
base and document URI of the document on whose current context our code is
running. r+sr=jst, r=dcamp

Bug 465752. Fix Equals() to work right on javascript: URIs. r=dcamp, sr=jst.

Both a=ss


git-svn-id: svn://10.0.0.236/trunk@255943 18797224-902f-48f8-a5cc-f745e15eee43
2009-01-28 00:56:09 +00:00

12 lines
1.6 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<base href="http://example.org/tests/content/html/document/test/bug445004-outer.html">
<script>document.domain = "example.org"</script>
</head>
<body>
<iframe width="500" height="200" src="javascript:&quot;<!DOCTYPE html> <html> <script> function $(str) { return document.getElementById(str); } function hookLoad(str) { $(str).onload = function() { window.parent.parent.postMessage('end', '*'); }; window.parent.parent.postMessage('start', '*'); } window.onload = function() { hookLoad(\&quot;w\&quot;); $(\&quot;w\&quot;).contentWindow.location.href = \&quot;example.org.png\&quot;; hookLoad(\&quot;x\&quot;); var doc = $(\&quot;x\&quot;).contentDocument; doc.write('<img src=\&quot;example.org.png\&quot;>'); doc.close(); }; function doIt() { hookLoad(\&quot;y\&quot;); $(\&quot;y\&quot;).contentWindow.location.href = \&quot;example.org.png\&quot;; hookLoad(\&quot;z\&quot;); var doc = $(\&quot;z\&quot;).contentDocument; doc.write('<img src=\&quot;example.org.png\&quot;>'); doc.close(); } </script> <body> <iframe name=\&quot;w\&quot; id=\&quot;w\&quot; width=\&quot;100\&quot; height=\&quot;100\&quot;></iframe> <iframe name=\&quot;x\&quot; id=\&quot;x\&quot; width=\&quot;100\&quot; height=\&quot;100\&quot;></iframe> <iframe name=\&quot;y\&quot; id=\&quot;y\&quot; width=\&quot;100\&quot; height=\&quot;100\&quot;></iframe> <iframe name=\&quot;z\&quot; id=\&quot;z\&quot; width=\&quot;100\&quot; height=\&quot;100\&quot;></iframe><img src=\&quot;example.org.png\&quot;> </body> </html>&quot; "
onload="window.frames[0].doIt();"></iframe>
</body>
</html>