Use testRunner instead of layoutTestController in fast/doctypes, dom, dynamic, encodi...
[WebKit-https.git] / LayoutTests / fast / dom / HTMLImageElement / image-longdesc-absolute-url.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2         "http://www.w3.org/TR/html4/loose.dtd">
3 <html>
4 <head>
5     <title>Image Tester</title>
6     <base id="foo" href="file:///does/not/exist/">
7
8 <script type="text/javascript" language="javascript">
9     function stringResult(value, expected) {
10         var result = eval(value);
11         var resultString;
12         if (result == expected)
13             resultString = "SUCCESS";
14         else
15             resultString = "FAILURE";
16         return "<strong>" + resultString +  "<\/strong> (" + value + " = " + result + ")";
17     }
18
19     function init() {
20         if (window.testRunner)
21             testRunner.dumpAsText();
22     
23         document.images["test"].longDesc = "test-description.html";
24             
25         var beforeDiv = document.getElementById("before");
26         beforeDiv.innerHTML = stringResult("document.images[0].longDesc", "file:///does/not/exist/test-description.html");
27         
28         document.getElementById("foo").setAttribute("href", "file:///also/does/not/exist/");
29         var afterDiv = document.getElementById("after");
30         afterDiv.innerHTML = stringResult("document.images[0].longDesc", "file:///also/does/not/exist/test-description.html");
31     }
32 </script>
33 </head>
34 <body onLoad="init()">
35 <p>
36 The image object.longDesc is expected to be the full path to the image description, relative to the document base.<br>
37 To match WinIE (but not FireFox), we resolve the image path in the getter, rather than the setter, allowing for pages to change the Document base URL via javascript and have object.longDesc reflect said change.
38 </p>
39
40 <img id="test" name="test" longdesc="" style="display: none">
41 <div style="font-size:small" id="before"></div>
42 <p>After changing the base URL:</p>
43 <div style="font-size:small" id="after"></div>
44 </body>
45 </html>