| <p>This test reports the value that document.all returns for various null-like arguments.</p> |
| <p>Written for <a href="http://bugs.webkit.org/show_bug.cgi?id=13106">http://bugs.webkit.org/show_bug.cgi?id=13106</a>.</p> |
| <hr> |
| <pre id="log"></pre> |
| |
| <script> |
| function log(s) |
| { |
| document.getElementById("log").appendChild(document.createTextNode(s)); |
| } |
| |
| function getDescription(value) |
| { |
| if (value === undefined) |
| return "undefined"; |
| if (value === null) |
| return "null"; |
| if (typeof value == "number") |
| return value; |
| if (typeof value == "string") |
| return '"' + value + '"'; |
| |
| return "unkown description"; |
| } |
| |
| window.onload = function onload() |
| { |
| if ("testRunner" in this) |
| testRunner.dumpAsText(); |
| |
| var arguments = [ |
| 0, |
| "", |
| "0", |
| undefined, |
| null |
| ]; |
| |
| for (var i = 0; i < arguments.length; i++) { //> |
| var value = arguments[i]; |
| var description = getDescription(value); |
| log("document.all[" + description + "]: " + document.all[value] + "\n"); |
| log("document.all(" + description + "): " + document.all(value) + "\n"); |
| log("document.all.item(" + description + "): " + document.all.item(value) + "\n"); |
| log("\n"); |
| } |
| } |
| |
| </script> |