1 createDocument tests modeled after createElementNS tests from mozilla which were attached to webkit bug 16833 2 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 4 5 6 PASS document.implementation.createDocument().toString() is "[object Document]" 7 PASS document.implementation.createDocument("http://www.example.com").toString() is "[object Document]" 8 PASS createDocument(, , null) 9 PASS createDocument(null, , null) 10 FAIL createDocument(, null, null) 11 FAIL createDocument(null, null, null) 12 FAIL createDocument(null, "", null) 13 FAIL createDocument("", null, null) 14 FAIL createDocument("", "", null) 15 PASS createDocument(null, "<div>", null); threw INVALID_CHARACTER_ERR 16 PASS createDocument(null, "0div", null); threw INVALID_CHARACTER_ERR 17 PASS createDocument(null, "di v", null); threw INVALID_CHARACTER_ERR 18 PASS createDocument(null, "di<v", null); threw INVALID_CHARACTER_ERR 19 PASS createDocument(null, "-div", null); threw INVALID_CHARACTER_ERR 20 PASS createDocument(null, ".div", null); threw INVALID_CHARACTER_ERR 21 PASS createDocument("http://example.com/", "<div>", null); threw INVALID_CHARACTER_ERR 22 PASS createDocument("http://example.com/", "0div", null); threw INVALID_CHARACTER_ERR 23 PASS createDocument("http://example.com/", "di<v", null); threw INVALID_CHARACTER_ERR 24 PASS createDocument("http://example.com/", "-div", null); threw INVALID_CHARACTER_ERR 25 PASS createDocument("http://example.com/", ".div", null); threw INVALID_CHARACTER_ERR 26 PASS createDocument(null, ":div", null); threw NAMESPACE_ERR 27 PASS createDocument(null, "div:", null); threw NAMESPACE_ERR 28 PASS createDocument("http://example.com/", ":div", null); threw NAMESPACE_ERR 29 PASS createDocument("http://example.com/", "div:", null); threw NAMESPACE_ERR 30 PASS createDocument(null, "d:iv", null); threw NAMESPACE_ERR 31 PASS createDocument(null, "a:b:c", null); valid XML name, invalid QName; threw NAMESPACE_ERR 32 PASS createDocument("http://example.com/", "a:b:c", null); valid XML name, invalid QName; threw NAMESPACE_ERR 33 PASS createDocument(null, "a::c", null); valid XML name, invalid QName; threw NAMESPACE_ERR 34 PASS createDocument("http://example.com/", "a::c", null); valid XML name, invalid QName; threw NAMESPACE_ERR 35 PASS createDocument("http://example.com/", "a:0", null); valid XML name, not a valid QName; threw INVALID_CHARACTER_ERR 36 PASS createDocument("http://example.com/", "0:a", null); 0 at start makes it not a valid XML name; threw INVALID_CHARACTER_ERR 37 PASS createDocument("http://example.com/", "a:_", null) 38 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 39 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 40 PASS createDocument("http://example.com/", "a:a", null) 41 PASS createDocument("http://example.com/", "a:a", null) 42 PASS createDocument("http://example.com/", "xml:test", null); binding xml prefix wrong; threw NAMESPACE_ERR 43 PASS createDocument("http://example.com/", "xmlns:test", null); binding xmlns prefix wrong; threw NAMESPACE_ERR 44 PASS createDocument("http://www.w3.org/2000/xmlns/", "x:test", null); binding namespace namespace to wrong prefix; threw NAMESPACE_ERR 45 PASS createDocument("http://www.w3.org/2000/xmlns/", "xmlns:test", null) 46 PASS createDocument("http://www.w3.org/XML/1998/namespace", "xml:test", null) 47 PASS createDocument("http://www.w3.org/XML/1998/namespace", "x:test", null) 48 PASS successfullyParsed is true 49 50 TEST COMPLETE 51 52