OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <title>Element.getElementsByClassName</title> |
| 3 <script src="../../../../resources/testharness.js"></script> |
| 4 <script src="../../../../resources/testharnessreport.js"></script> |
| 5 <div id="log"></div> |
| 6 <script> |
| 7 test(function() { |
| 8 var a = document.createElement("a"), b = document.createElement("b") |
| 9 b.className = "foo" |
| 10 a.appendChild(b) |
| 11 var list = a.getElementsByClassName("foo") |
| 12 assert_array_equals(list, [b]) |
| 13 var secondList = a.getElementsByClassName("foo") |
| 14 assert_true(list === secondList || list !== secondList, "Caching is allowed.") |
| 15 }, "getElementsByClassName should work on disconnected subtrees.") |
| 16 test(function() { |
| 17 var list = document.getElementsByClassName("foo") |
| 18 assert_false(list instanceof NodeList, "NodeList") |
| 19 assert_true(list instanceof HTMLCollection, "HTMLCollection") |
| 20 }, "Interface should be correct.") |
| 21 </script> |
OLD | NEW |