createDocument tests modeled after createElementNS tests from mozilla which were attached to webkit bug 16833

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".


PASS document.implementation.createDocument().toString() is "[object Document]"
PASS document.implementation.createDocument("http://www.example.com").toString() is "[object Document]"
PASS createDocument(, , null)
PASS createDocument(null, , null)
FAIL createDocument(, null, null)
FAIL createDocument(null, null, null)
FAIL createDocument(null, "", null)
FAIL createDocument("", null, null)
FAIL createDocument("", "", null)
PASS createDocument(null, "<div>", null); threw INVALID_CHARACTER_ERR
PASS createDocument(null, "0div", null); threw INVALID_CHARACTER_ERR
PASS createDocument(null, "di v", null); threw INVALID_CHARACTER_ERR
PASS createDocument(null, "di<v", null); threw INVALID_CHARACTER_ERR
PASS createDocument(null, "-div", null); threw INVALID_CHARACTER_ERR
PASS createDocument(null, ".div", null); threw INVALID_CHARACTER_ERR
PASS createDocument("http://example.com/", "<div>", null); threw INVALID_CHARACTER_ERR
PASS createDocument("http://example.com/", "0div", null); threw INVALID_CHARACTER_ERR
PASS createDocument("http://example.com/", "di<v", null); threw INVALID_CHARACTER_ERR
PASS createDocument("http://example.com/", "-div", null); threw INVALID_CHARACTER_ERR
PASS createDocument("http://example.com/", ".div", null); threw INVALID_CHARACTER_ERR
PASS createDocument(null, ":div", null); threw NAMESPACE_ERR
PASS createDocument(null, "div:", null); threw NAMESPACE_ERR
PASS createDocument("http://example.com/", ":div", null); threw NAMESPACE_ERR
PASS createDocument("http://example.com/", "div:", null); threw NAMESPACE_ERR
PASS createDocument(null, "d:iv", null); threw NAMESPACE_ERR
PASS createDocument(null, "a:b:c", null); valid XML name, invalid QName; threw NAMESPACE_ERR
PASS createDocument("http://example.com/", "a:b:c", null); valid XML name, invalid QName; threw NAMESPACE_ERR
PASS createDocument(null, "a::c", null); valid XML name, invalid QName; threw NAMESPACE_ERR
PASS createDocument("http://example.com/", "a::c", null); valid XML name, invalid QName; threw NAMESPACE_ERR
PASS createDocument("http://example.com/", "a:0", null); valid XML name, not a valid QName; threw INVALID_CHARACTER_ERR
PASS createDocument("http://example.com/", "0:a", null); 0 at start makes it not a valid XML name; threw INVALID_CHARACTER_ERR
PASS createDocument("http://example.com/", "a:_", null)
FAIL createDocument("http://example.com/", "a:ெ", null); non-ASCII character after colon is CombiningChar, which is NCNameChar but not (Letter | "_") so invalid at start of NCName (but still a valid XML name, hence not INVALID_CHARACTER_ERR); expected NAMESPACE_ERR, threw INVALID_CHARACTER_ERR
PASS createDocument("http://example.com/", "ெ:a", null); non-ASCII character after colon is CombiningChar, which is NCNameChar but not (Letter | "_") so invalid at start of NCName (Gecko chooses to throw NAMESPACE_ERR here, but either is valid as this is both an invalid XML name and an invalid QName); threw INVALID_CHARACTER_ERR
PASS createDocument("http://example.com/", "a:aெ", null)
PASS createDocument("http://example.com/", "aெ:a", null)
PASS createDocument("http://example.com/", "xml:test", null); binding xml prefix wrong; threw NAMESPACE_ERR
PASS createDocument("http://example.com/", "xmlns:test", null); binding xmlns prefix wrong; threw NAMESPACE_ERR
PASS createDocument("http://www.w3.org/2000/xmlns/", "x:test", null); binding namespace namespace to wrong prefix; threw NAMESPACE_ERR
PASS createDocument("http://www.w3.org/2000/xmlns/", "xmlns:test", null)
PASS createDocument("http://www.w3.org/XML/1998/namespace", "xml:test", null)
PASS createDocument("http://www.w3.org/XML/1998/namespace", "x:test", null)
PASS successfullyParsed is true

TEST COMPLETE

