Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / collection-null-like-arguments.html
blob055f60af01792e84421b220689f1bea846345a43
1 <p>This test reports the value that document.all returns for various null-like arguments.</p>
2 <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>
3 <hr>
4 <pre id="log"></pre>
6 <script>
7 function log(s)
9 document.getElementById("log").appendChild(document.createTextNode(s));
12 function getDescription(value)
14 if (value === undefined)
15 return "undefined";
16 if (value === null)
17 return "null";
18 if (typeof value == "number")
19 return value;
20 if (typeof value == "string")
21 return '"' + value + '"';
23 return "unkown description";
26 window.onload = function onload()
28 if ("testRunner" in this)
29 testRunner.dumpAsText();
31 var arguments = [
33 "",
34 "0",
35 undefined,
36 null
39 for (var i = 0; i < arguments.length; i++) { //>
40 var value = arguments[i];
41 var description = getDescription(value);
42 log("document.all[" + description + "]: " + document.all[value] + "\n");
43 log("document.all(" + description + "): " + document.all(value) + "\n");
44 log("document.all.item(" + description + "): " + document.all.item(value) + "\n");
45 log("\n");
49 </script>