1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/html/document/test/test_bug677495.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,34 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=677495 1.8 + 1.9 +As mandated by the spec, the body of a media document must only contain one child. 1.10 +--> 1.11 +<head> 1.12 + <title>Test for Bug 571981</title> 1.13 + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.14 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 1.15 + 1.16 +<script type="application/javascript"> 1.17 + SimpleTest.waitForExplicitFinish(); 1.18 + 1.19 + function frameLoaded() { 1.20 + var testframe = document.getElementById('testframe'); 1.21 + var testframeChildren = testframe.contentDocument.body.childNodes; 1.22 + is(testframeChildren.length, 1, "Body of image document has 1 child"); 1.23 + is(testframeChildren[0].nodeName, "IMG", "Only child of body must be an <img> element"); 1.24 + 1.25 + SimpleTest.finish(); 1.26 + } 1.27 +</script> 1.28 + 1.29 +</head> 1.30 +<body> 1.31 + <p id="display"></p> 1.32 + 1.33 + <iframe id="testframe" name="testframe" onload="frameLoaded()" 1.34 + src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9oMFgQGMyFwHucAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAADElEQVQI12P4//8/AAX+Av7czFnnAAAAAElFTkSuQmCC"></iframe> 1.35 + 1.36 +</body> 1.37 +</html>