test_bug810494.html (1415B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=810494 5 --> 6 <head> 7 <meta charset="utf-8"> 8 <title>Test for Bug 810494</title> 9 <script src="/tests/SimpleTest/SimpleTest.js"></script> 10 <script src="/tests/SimpleTest/SpecialPowers.js"></script> 11 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 12 </head> 13 <body> 14 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=810494">Mozilla Bug 810494</a> 15 <pre id="test"> 16 <script type="application/javascript"> 17 18 function test(tag, type) { 19 "use strict"; 20 info("testing " + tag + " tag with type " + type); 21 22 const OBJLC = SpecialPowers.Ci.nsIObjectLoadingContent; 23 let obj = document.createElement(tag); 24 obj.type = type; 25 document.body.appendChild(obj); 26 27 obj instanceof OBJLC; 28 obj = SpecialPowers.wrap(obj); 29 30 // We expect this tag to simply go to alternate content, not get a 31 // pluginProblem binding or fire any events. 32 ok(obj.displayedType == OBJLC.TYPE_FALLBACK, "expected null type"); 33 } 34 35 // Test all non-plugin types these tags can load to make sure none of them 36 // trigger plugin-specific fallbacks when loaded with no URI 37 test("object", "text/html"); // Document 38 test("object", "image/png"); // Image 39 test("object", "image/svg+xml"); // SVG Document 40 41 test("embed", "image/png"); // Image 42 test("embed", "image/svg+xml"); // SVG Document 43 </script> 44 </pre> 45 </body> 46 </html>