3 <div class=
"one">Line
1<div class=
"two">Line
2</div><p>Line
<i>3</i></p></div>
4 <div id=
"test" class=
"one two"><div class=
"one two">line
4</div><p class=
"two">line
5</p></div>
5 <p><ol id=
"console"></ol></p>
6 <script type=
"text/javascript">
8 testRunner
.dumpAsText();
12 var item
= document
.createElement("li");
13 item
.appendChild(document
.createTextNode(message
));
14 document
.getElementById("console").appendChild(item
);
17 HTMLCollection
.prototype.dump = function()
21 for (; i
< this.length
; i
++)
22 result
+= this[i
] + ", ";
23 result
+= "length: " + i
;
28 var elm
= document
.getElementById("test");
30 log(document
.getElementsByClassName("one").dump());
31 log(document
.getElementsByClassName("two").dump());
32 log(document
.getElementsByClassName("one two").dump());
33 log(document
.getElementsByClassName("one\t\t\n \ftwo").dump());
34 log(document
.getElementsByClassName("").dump());
35 log(document
.getElementsByClassName("onetwo").dump());
36 log(document
.getElementsByClassName(null).dump());
37 log(document
.getElementsByClassName(undefined).dump());
39 log(elm
.getElementsByClassName("one").dump());
40 log(elm
.getElementsByClassName("two").dump());
41 log(elm
.getElementsByClassName("one two").dump());
42 log(elm
.getElementsByClassName("one\t\t\n \ftwo").dump());
43 log(elm
.getElementsByClassName("").dump());
44 log(elm
.getElementsByClassName("onetwo").dump());
45 log(elm
.getElementsByClassName(null).dump());
46 log(elm
.getElementsByClassName(undefined).dump());
48 log("Exception: " + ex
.description
);