haikuwebkit/LayoutTests/fast/dom/Element/getElementsByTagNameNS-null...

27 lines
1.1 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<script src="../../../resources/js-test-pre.js"></script>
</head>
<body>
<script>
description("Tests that the first parameter to Element.getElementsByTagNameNS() is nullable");
var a = document.createElementNS(null, "a");
a.id = "testAnchor";
document.body.appendChild(a);
shouldBeNull("document.body.getElementsByTagName('a')[0].namespaceURI");
shouldBeEqualToString("document.body.getElementsByTagNameNS(null, 'a')[0].id", "testAnchor");
shouldBeEqualToString("document.body.getElementsByTagNameNS(undefined, 'a')[0].id", "testAnchor");
shouldBeEqualToString("document.getElementsByTagNameNS(null, 'a')[0].id", "testAnchor");
shouldBeEqualToString("document.getElementsByTagNameNS(undefined, 'a')[0].id", "testAnchor");
shouldBe("document.body.getElementsByTagNameNS('null', 'a').length", "0");
shouldBe("document.body.getElementsByTagNameNS('undefined', 'a').length", "0");
shouldBe("document.getElementsByTagNameNS('null', 'a').length", "0");
shouldBe("document.getElementsByTagNameNS('undefined', 'a').length", "0");
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>
</html>