test_bug829872.html 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <!DOCTYPE HTML>
  2. <html>
  3. <!--
  4. https://bugzilla.mozilla.org/show_bug.cgi?id=829872
  5. -->
  6. <head>
  7. <meta charset="utf-8">
  8. <title>Test for Bug 829872</title>
  9. <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  10. <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
  11. <script type="application/javascript">
  12. /** Test for Bug 829872 and Bug 968003 **/
  13. SimpleTest.waitForExplicitFinish();
  14. var gLoadCount = 0;
  15. function loaded() {
  16. if (++gLoadCount == 3)
  17. go();
  18. }
  19. function check(elem, desc) {
  20. is(elem.contentDocument, null, "null cross-origin contentDocument for " + desc);
  21. ok(SpecialPowers.wrap(elem).contentWindow.eval('frameElement === null;'),
  22. "null cross-origin frameElement for " + desc);
  23. if (!(elem instanceof HTMLFrameElement))
  24. is(elem.getSVGDocument(), null, "null cross-origin getSVGDocument() for " + desc);
  25. }
  26. function go() {
  27. ok(true, "Starting test");
  28. check($('ifr'), "iframe element");
  29. check($('obj'), "object element");
  30. check($('framesetholder').contentDocument.getElementById('fr'), "frameset frame");
  31. SimpleTest.finish();
  32. }
  33. </script>
  34. </head>
  35. <body>
  36. <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=829872">Mozilla Bug 829872</a>
  37. <p id="display"></p>
  38. <div id="content" style="display: none">
  39. </div>
  40. <pre id="test">
  41. </pre>
  42. <iframe id="ifr" onload="loaded();" src="http://example.org/tests/js/xpconnect/tests/mochitest/file_empty.html"></iframe>
  43. <object id="obj" onload="loaded();" data="http://example.org/tests/js/xpconnect/tests/mochitest/file_empty.html"></object>
  44. <iframe id="framesetholder" src="data:text/html,<html><head></head><frameset cols='100%'><frame id='fr' onload='parent.loaded();' src='http://example.org/tests/js/xpconnect/tests/mochitest/file_empty.html' /></frameset></html>"></iframe>
  45. </body>
  46. </html>