webapps

changeset 550:a88b5a758f9a

Update getElementsByTagName test to current spec.
author Ms2ger <ms2ger@gmail.com>
date Thu, 07 Jul 2011 12:08:10 +0200
parents 2de86e9886ef
children 82a01a1d6a67
files DOMCore/tests/submissions/Ms2ger/Document-getElementsByTagName.html
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line diff
     1.1 --- a/DOMCore/tests/submissions/Ms2ger/Document-getElementsByTagName.html	Tue Jul 05 14:49:03 2011 +0200
     1.2 +++ b/DOMCore/tests/submissions/Ms2ger/Document-getElementsByTagName.html	Thu Jul 07 12:08:10 2011 +0200
     1.3 @@ -8,7 +8,9 @@
     1.4  test(function() {
     1.5    assert_true(document.getElementsByTagName("html") instanceof NodeList, "NodeList")
     1.6    assert_false(document.getElementsByTagName("html") instanceof HTMLCollection, "HTMLCollection")
     1.7 -  assert_true(document.getElementsByTagName("html") !== document.getElementsByTagName("html"), "no caching")
     1.8 +  assert_true(document.getElementsByTagName("html") !== document.getElementsByTagName("html") ||
     1.9 +              document.getElementsByTagName("html") === document.getElementsByTagName("html"),
    1.10 +              "Caching is allowed.")
    1.11  })
    1.12  test(function() {
    1.13    var l = document.getElementsByTagName("nosuchtag")
    1.14 @@ -24,15 +26,19 @@
    1.15    assert_equals(document.getElementsByTagName("i").length, 0)
    1.16    assert_equals(document.body.getElementsByTagName("I").length, 0)
    1.17    assert_equals(document.body.getElementsByTagName("i").length, 0)
    1.18 +  document.body.removeChild(i)
    1.19  })
    1.20  test(function() {
    1.21    var t = document.body.appendChild(document.createElementNS("test", "te:st"))
    1.22 -  assert_equals(document.getElementsByTagName("st").length, 0)
    1.23 -  assert_equals(document.getElementsByTagName("te:st")[0], t)
    1.24 +  assert_equals(document.getElementsByTagName("st").length, 1)
    1.25 +  assert_equals(document.getElementsByTagName("st")[0], t)
    1.26 +  assert_equals(document.getElementsByTagName("te:st").length, 0)
    1.27 +  document.body.removeChild(t)
    1.28  })
    1.29  test(function() {
    1.30    var h = document.body.appendChild(document.createElementNS("http://www.w3.org/1999/xhtml", "te:st"))
    1.31    assert_equals(document.getElementsByTagName("st")[0], h)
    1.32    assert_equals(document.getElementsByTagName("TE:ST").length, 0)
    1.33 +  document.body.removeChild(h)
    1.34  })
    1.35  </script>
Set up and maintained by W3C Systems Team, please report bugs to sysreq@w3.org.

W3C would like to thank Microsoft who donated the server that allows us to run this service.