doctype.ownerDocument is null after creation (Acid3 bug) This should be an easy fix. Test 98: expected: [object HTMLDocument], got: null - doctype's ownerDocument was wrong after creation function () { // test 98: XHTML and the DOM // (special test) var doctype = document.implementation.createDocumentType("html", "-//W3C//DTD XHTML 1.0 Strict//EN", "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"); assertEquals(doctype.ownerDocument, document, "doctype's ownerDocument was wrong after creation"); var doc = document.implementation.createDocument("http://www.w3.org/1999/xhtml", "html", doctype); doc.documentElement.appendChild(doc.createElementNS("http://www.w3.org/1999/xhtml", "head")); doc.documentElement.appendChild(doc.createElementNS("http://www.w3.org/1999/xhtml", "body")); var t = doc.createElementNS("http://www.w3.org/1999/xhtml", "title"); doc.documentElement.firstChild.appendChild(t); // ok we have a conforming XHTML1 doc in |doc| now. assertEquals(doctype.ownerDocument, doc, "doctype's ownerDocument didn't change when it was assigned to another document"); assertEquals(doc.title, "", "document had unexpected title"); t.textContent = "Sparrow"; assertEquals(doc.title, "Sparrow", "document.title did not update dynamically"); doc.body.appendChild(doc.createElementNS("http://www.w3.org/1999/xhtml", "form")); assertEquals(doc.forms.length, 1, "document.forms not updated after inserting a form"); return 7; },
Hum... // Returns the DOM ownerDocument attribute. This method never returns NULL, except in the case // of (1) a Document node or (2) a DocumentType node that is not used with any Document yet. virtual Document* ownerDocument() const;
This test is clearly wrong according to the DOM Level 2 Core spec: http://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createDocType Ian, if you agree (and plan to change the test) feel free to close this INVALID.
I fixed this yesterday, shortly after adding the test. Sorry for the confusion.