This tests that various combinations of replaceChild on the document works as specified. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". replacing element with element PASS doc.replaceChild(newChild, doc.documentElement) did not throw exception.
replacing element with element in fragment PASS doc.replaceChild(fragment, doc.documentElement); did not throw exception.
replacing element with multiple elements in fragment PASS doc.replaceChild(fragment, doc.documentElement); threw exception HierarchyRequestError: Failed to execute 'replaceChild' on 'Node': Only one element on document allowed.. replacing element with doctype PASS doc.replaceChild(newChild, doc.documentElement) did not throw exception. replacing element with doctype when a doctype already exists PASS doc.replaceChild(newChild, doc.documentElement) threw exception HierarchyRequestError: Failed to execute 'replaceChild' on 'Node': Only one doctype on document allowed.. replacing doctype with doctype PASS doc.replaceChild(newChild, doc.doctype) did not throw exception. replacing doctype with element PASS doc.replaceChild(newChild, doc.doctype) did not throw exception. replacing element with doctype when an element already exists PASS doc.replaceChild(newChild, doc.documentElement) threw exception HierarchyRequestError: Failed to execute 'replaceChild' on 'Node': Only one doctype on document allowed.. PASS successfullyParsed is true TEST COMPLETE