historical.html (1784B)
1 <!doctype html> 2 <title>Historical object element features should not be supported</title> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <div id=log></div> 6 <object id=object></object> 7 <script> 8 test(function() { 9 var elm = document.getElementById('object'); 10 assert_equals(typeof elm, 'object', 'typeof'); 11 assert_throws_js(TypeError, function() { 12 elm(); 13 }); 14 }, 'object legacycaller should not be supported'); 15 16 test(() => { 17 const obj = document.createElement("object"); 18 assert_false("typeMustMatch" in obj); 19 }, "object's typeMustMatch IDL attribute should not be supported"); 20 21 async_test(t => { 22 const obj = document.createElement("object"); 23 t.add_cleanup(() => obj.remove()); 24 obj.setAttribute("data", "/common/blank.html"); 25 obj.setAttribute("type", "text/plain"); 26 obj.setAttribute("typemustmatch", ""); 27 obj.onload = t.step_func_done(() => { 28 assert_not_equals(obj.contentDocument, null, "/common/blank.html should be loaded"); 29 }); 30 obj.onerror = t.unreached_func(); 31 document.body.appendChild(obj); 32 }, "object's typemustmatch content attribute should not be supported"); 33 34 async_test(t => { 35 const obj = document.createElement("object"); 36 t.add_cleanup(() => obj.remove()); 37 obj.setAttribute("data", "/common/blank.html"); 38 obj.setAttribute("codebase", "https://test.invalid/"); 39 obj.onload = t.step_func_done(() => { 40 assert_not_equals(obj.contentDocument, null, "/common/blank.html should be loaded"); 41 assert_equals(obj.contentDocument.location.origin, location.origin, "document should be loaded with current origin as base"); 42 }); 43 obj.onerror = t.unreached_func(); 44 document.body.appendChild(obj); 45 }, "object's codebase content attribute should not be supported"); 46 </script>