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 Error: HierarchyRequestError: DOM Exception 3. 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 Error: HierarchyRequestError: DOM Exception 3. 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 Error: HierarchyRequestError: DOM Exception 3. PASS successfullyParsed is true TEST COMPLETE