5 pre
= document
.getElementById('console');
6 txt
= document
.createTextNode(str
)
10 if (window
.layoutTestController
)
11 layoutTestController
.dumpAsText();
13 var uri
= 'http://www.example.org';
15 // Both null namespaceURI and qname
17 var doc
= document
.implementation
.createDocument(null, null, null)
19 if (doc
.documentElement
) {
20 debug('FAILURE: Document created should not have a document element')
24 debug('FAILURE: Got exception ' + e
.message
+ ' when creating document with null namespaceURI and qualifiedName')
28 // Both empty namespaceURI and qname
30 var doc
= document
.implementation
.createDocument('', '', null)
32 if (doc
.documentElement
) {
33 debug('FAILURE: Document created should not have a document element')
37 debug('FAILURE: Got exception ' + e
.message
+ ' when creating document with empty namespaceURI and qualifiedName')
41 // Null namespaceURI with qname
43 var doc
= document
.implementation
.createDocument(null, 'test', null)
45 if (!doc
.documentElement
) {
46 debug('FAILURE: Document created should have a document element')
51 debug('FAILURE: Got exception ' + e
.message
+ ' when creating document with null namespaceURI')
55 // Empty namespaceURI with qname
57 var doc
= document
.implementation
.createDocument('', 'test', null)
59 if (!doc
.documentElement
) {
60 debug('FAILURE: Document created should have a document element')
65 debug('FAILURE: Got exception ' + e
.message
+ ' when creating document with empty namespaceURI')
69 // namespaceURI with empty qname
71 var doc
= document
.implementation
.createDocument(uri
, '', null)
73 if (doc
.documentElement
) {
74 debug('FAILURE: Document created should not have a document element')
79 debug('FAILURE: Got exception ' + e
.message
+ ' when creating document with empty namespaceURI')
88 <body onload=
"runTests();">
89 This tests that it should be possible to create documents with empty/null qnames and namespaceURIs. If the test is successful, 'SUCCESS' will be displayed below, otherwise 'FAILURE' and a reason will be displayed.