pageload-image.html (1373B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <title>Media documents: image</title> 5 <link rel="author" title="Michael Ventnor" href="mailto:mventnor@mozilla.com"> 6 <link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"> 7 <link rel="help" href="https://html.spec.whatwg.org/multipage/#read-media"> 8 <script src="/resources/testharness.js"></script> 9 <script src="/resources/testharnessreport.js"></script> 10 11 <script> 12 var t = async_test("The document for a standalone media file should have one child in the body."); 13 14 function frameLoaded() { 15 var testframe = document.getElementById('testframe'); 16 assert_equals(testframe.contentDocument.contentType, "image/png"); 17 assert_equals(testframe.contentDocument.compatMode, "CSS1Compat", "Media documents should be in standards mode"); 18 var testframeChildren = testframe.contentDocument.body.childNodes; 19 assert_equals(testframeChildren.length, 1, "Body of image document has 1 child"); 20 assert_equals(testframeChildren[0].nodeName, "IMG", "Only child of body must be an <img> element"); 21 assert_equals(testframeChildren[0].namespaceURI, "http://www.w3.org/1999/xhtml", 22 "Only child of body must be an HTML element"); 23 t.done(); 24 } 25 </script> 26 </head> 27 <body> 28 <div id="log"></div> 29 <iframe id="testframe" onload="t.step(frameLoaded)" src="/images/blue.png"></iframe> 30 </body> 31 </html>