Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / HTMLImageElement / image-longdesc-absolute-url.html
blob32e5f2cdd42386b045f11d93f28a1d2e454f322a
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/">
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 + ")";
19 function init() {
20 if (window.testRunner)
21 testRunner.dumpAsText();
23 document.images["test"].longDesc = "test-description.html";
25 var beforeDiv = document.getElementById("before");
26 beforeDiv.innerHTML = stringResult("document.images[0].longDesc", "file:///does/not/exist/test-description.html");
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");
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>
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>