4 if (window.layoutTestController) {
5 layoutTestController.dumpAsText();
6 layoutTestController.waitUntilDone();
9 var object1Result = "";
10 var object2Result = "";
11 var embed3Result = "";
12 var embed4Result = "";
13 var object5Result = "";
16 document.addEventListener("beforeload", function(event) {
20 if (event.target.id == "object1") {
21 object1Result = (event.url == "object-attr" ? "does" : "does not");
22 } else if (event.target.id == "object2") {
23 object2Result = (event.url == "object-param" ? "does" : "does not");
24 } else if (event.target.id == "embed3") {
25 embed3Result = (event.url == "embed-attr" ? "does" : "does not");
26 } else if (event.target.id == "embed4") {
27 embed4Result = (event.url == "embed-attr" ? "does" : "does not");
28 } else if (event.target.id == "object5") {
29 object5Result = (event.url == "object-param" ? "does" : "does not");
32 if (!notified && object1Result != "" && object2Result != "" && embed3Result != "" && embed4Result != "" && object5Result != "") {
33 debug("An <object> with a 'data' @attr and a 'src' <param> should load the URL from the 'data' @attr and " + object1Result + ".");
34 debug("An <object> with a 'src' <param> should load the URL from the 'src' <param> and " + object2Result + ".");
35 debug("An <object> with no URL specified and a nested <embed> should load the URL from the 'src' @attr of the <embed> and " + embed3Result + ".");
36 debug("An <object> with a URL specified in a 'src' <param> and a nested <embed> should load the URL from the 'src' @attr of the <embed> and " + embed3Result + ".");
37 debug("An <object> with a URL specified in a 'src' <param> and a MIME type specified in a 'type' <param> should load the URL from the 'src' <param> and " + object5Result + ".");
39 if (window.layoutTestController)
40 layoutTestController.notifyDone();
45 document.getElementById('console').innerHTML += str + "<br>";
50 <p>This test verifies that the right URL is loaded when there is an <object> with a 'src' <param> and a fallback <embed>.</p>
51 <div id="console"></div>
52 <object id="object1" type="application/x-webkit-test-netscape" data="object-attr">
53 <param name="src" value="object-param"></param>
54 <embed id="embed1" type="application/x-webkit-test-netscape" src="embed-attr">
56 <object id="object2" type="application/x-webkit-test-netscape">
57 <param name="movie" value="object-param"></param>
58 <embed id="embed2" type="application/x-webkit-test-netscape" src="embed-attr">
61 <embed id="embed3" type="application/x-webkit-test-netscape" src="embed-attr">
64 <param name="code" value="object-param"></param>
65 <embed id="embed4" type="application/x-webkit-test-netscape" src="embed-attr">
68 <param name="url" value="object-param"></param>
69 <param name="type" value="application/x-webkit-test-netscape"></param>