|
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 type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
10 <script type="application/javascript" 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;version=1.8"> |
|
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_NULL, "expected null type"); |
|
33 ok(obj.pluginFallbackType == OBJLC.PLUGIN_ALTERNATE, |
|
34 "expected alternate fallback mode"); |
|
35 } |
|
36 |
|
37 // Test all non-plugin types these tags can load to make sure none of them |
|
38 // trigger plugin-specific fallbacks when loaded with no URI |
|
39 test("object", "text/html"); // Document |
|
40 test("object", "image/png"); // Image |
|
41 test("object", "image/svg+xml"); // SVG Document |
|
42 |
|
43 test("embed", "image/png"); // Image |
|
44 test("embed", "image/svg+xml"); // SVG Document |
|
45 </script> |
|
46 </pre> |
|
47 </body> |
|
48 </html> |