test_bug912322.html 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <!DOCTYPE HTML>
  2. <html>
  3. <!--
  4. https://bugzilla.mozilla.org/show_bug.cgi?id=912322
  5. -->
  6. <head>
  7. <meta charset="utf-8">
  8. <title>Test for Bug 912322</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 that XBL functions aren't exposed to the web. **/
  13. funs = ['getAnonymousNodes', 'getAnonymousElementByAttribute',
  14. 'getBindingParent', 'loadBindingDocument'];
  15. for (var f of funs) {
  16. ok(!(f in document), f + " should not be available to content");
  17. ok(f in SpecialPowers.wrap(document), f + " should be available to chrome via Xray");
  18. }
  19. // Test window.controllers.
  20. ok(typeof window.controllers, 'undefined', "controllers should not be available to content");
  21. ok(typeof SpecialPowers.wrap(window).controllers, 'object', "controllers should be available over Xray");
  22. </script>
  23. </head>
  24. <body>
  25. <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=912322">Mozilla Bug 912322</a>
  26. <p id="display"></p>
  27. <div id="content" style="display: none">
  28. </div>
  29. <pre id="test">
  30. </pre>
  31. </body>
  32. </html>