diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index 6306b89fc10a..1ae96d223c71 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -1550,8 +1550,6 @@ nsDocument::nsDocument(const char* aContentType) , mAnimatingImages(true) , mViewportType(Unknown) { - mDefaultElementType = kNameSpaceID_XHTML; - SetContentTypeInternal(nsDependentCString(aContentType)); if (!gDocumentLeakPRLog) diff --git a/dom/base/test/test_XHRSendData.html b/dom/base/test/test_XHRSendData.html index 2274643202c3..05e0b4f49c2e 100644 --- a/dom/base/test/test_XHRSendData.html +++ b/dom/base/test/test_XHRSendData.html @@ -34,7 +34,7 @@ is(testDoc1.inputEncoding, "windows-1252", "wrong encoding"); testDoc2 = document.implementation.createDocument("", "", null); testDoc2.appendChild(testDoc2.createComment(" doc 2 ")); -testDoc2.appendChild(testDoc2.createElementNS(null, "res")); +testDoc2.appendChild(testDoc2.createElement("res")); testDoc2.documentElement.appendChild(testDoc2.createTextNode("text")); is(testDoc2.inputEncoding, "UTF-8", "wrong encoding"); diff --git a/dom/base/test/unit/test_xml_serializer.js b/dom/base/test/unit/test_xml_serializer.js index 267fd9c8117a..c74d067a8115 100644 --- a/dom/base/test/unit/test_xml_serializer.js +++ b/dom/base/test/unit/test_xml_serializer.js @@ -175,7 +175,7 @@ function test5() { // Handling of kids in the null namespace when the default is a // different namespace (bug 301260). var doc = ParseXML('') - var child = doc.createElementNS(null, 'child'); + var child = doc.createElement('child'); doc.documentElement.appendChild(child); do_check_serialize(doc); do_check_eq(SerializeXML(doc), diff --git a/dom/html/nsHTMLDocument.cpp b/dom/html/nsHTMLDocument.cpp index 87cf1379d70c..7bb56d898df9 100644 --- a/dom/html/nsHTMLDocument.cpp +++ b/dom/html/nsHTMLDocument.cpp @@ -176,6 +176,7 @@ nsHTMLDocument::nsHTMLDocument() // bother initializing members to 0. mType = eHTML; + mDefaultElementType = kNameSpaceID_XHTML; mCompatMode = eCompatibility_NavQuirks; } diff --git a/dom/imptests/failures/html/dom/nodes/test_Node-properties.html.json b/dom/imptests/failures/html/dom/nodes/test_Node-properties.html.json index 272c5e890a5a..8c7b35264d9f 100644 --- a/dom/imptests/failures/html/dom/nodes/test_Node-properties.html.json +++ b/dom/imptests/failures/html/dom/nodes/test_Node-properties.html.json @@ -1,5 +1,7 @@ { "document.characterSet": true, "foreignDoc.characterSet": true, - "xmlDoc.characterSet": true + "xmlDoc.characterSet": true, + "xmlElement.namespaceURI": true, + "detachedXmlElement.namespaceURI": true } diff --git a/dom/imptests/html/dom/nodes/test_Document-createElement-namespace.html b/dom/imptests/html/dom/nodes/test_Document-createElement-namespace.html index c9f1a33eaf36..4898eeabc813 100644 --- a/dom/imptests/html/dom/nodes/test_Document-createElement-namespace.html +++ b/dom/imptests/html/dom/nodes/test_Document-createElement-namespace.html @@ -24,7 +24,11 @@ function testDoc(doc, contentType) { "Wrong MIME type -- incorrect server config?"); } - assert_equals(doc.createElement("x").namespaceURI, "http://www.w3.org/1999/xhtml"); + var expectedNamespace = contentType == "text/html" || + contentType == "application/xhtml+xml" + ? "http://www.w3.org/1999/xhtml" : null; + + assert_equals(doc.createElement("x").namespaceURI, expectedNamespace); } // First test various objects we create in JS diff --git a/testing/web-platform/meta/custom-elements/creating-and-passing-registries/share-registry-create-document.html.ini b/testing/web-platform/meta/custom-elements/creating-and-passing-registries/share-registry-create-document.html.ini new file mode 100644 index 000000000000..482a2a2df574 --- /dev/null +++ b/testing/web-platform/meta/custom-elements/creating-and-passing-registries/share-registry-create-document.html.ini @@ -0,0 +1,5 @@ +[share-registry-create-document.html] + type: testharness + [Document created by createDocument with HTML namespace should share an existing registry] + expected: FAIL + diff --git a/testing/web-platform/meta/dom/nodes/Document-constructor.html.ini b/testing/web-platform/meta/dom/nodes/Document-constructor.html.ini new file mode 100644 index 000000000000..d86bc27bc9a0 --- /dev/null +++ b/testing/web-platform/meta/dom/nodes/Document-constructor.html.ini @@ -0,0 +1,5 @@ +[Document-constructor.html] + type: testharness + [new Document(): URL parsing] + expected: FAIL + diff --git a/testing/web-platform/meta/dom/nodes/Document-createElement-namespace.html.ini b/testing/web-platform/meta/dom/nodes/Document-createElement-namespace.html.ini deleted file mode 100644 index 9647b1f7331e..000000000000 --- a/testing/web-platform/meta/dom/nodes/Document-createElement-namespace.html.ini +++ /dev/null @@ -1,74 +0,0 @@ -[Document-createElement-namespace.html] - type: testharness - [Created element's namespace in created XML document] - expected: FAIL - - [Created element's namespace in created XHTML document] - expected: FAIL - - [Created element's namespace in created SVG document] - expected: FAIL - - [Created element's namespace in created MathML document] - expected: FAIL - - [Created element's namespace in empty.xml] - expected: FAIL - - [Created element's namespace in empty.svg] - expected: FAIL - - [Created element's namespace in minimal_html.xml] - expected: FAIL - - [Created element's namespace in minimal_html.svg] - expected: FAIL - - [Created element's namespace in xhtml.xml] - expected: FAIL - - [Created element's namespace in xhtml.svg] - expected: FAIL - - [Created element's namespace in svg.xml] - expected: FAIL - - [Created element's namespace in svg.svg] - expected: FAIL - - [Created element's namespace in mathml.xml] - expected: FAIL - - [Created element's namespace in mathml.svg] - expected: FAIL - - [Created element's namespace in bare_xhtml.xml] - expected: FAIL - - [Created element's namespace in bare_xhtml.svg] - expected: FAIL - - [Created element's namespace in bare_svg.xml] - expected: FAIL - - [Created element's namespace in bare_svg.svg] - expected: FAIL - - [Created element's namespace in bare_mathml.xml] - expected: FAIL - - [Created element's namespace in bare_mathml.svg] - expected: FAIL - - [Created element's namespace in xhtml_ns_removed.xml] - expected: FAIL - - [Created element's namespace in xhtml_ns_removed.svg] - expected: FAIL - - [Created element's namespace in xhtml_ns_changed.xml] - expected: FAIL - - [Created element's namespace in xhtml_ns_changed.svg] - expected: FAIL - diff --git a/testing/web-platform/meta/dom/nodes/Node-properties.html.ini b/testing/web-platform/meta/dom/nodes/Node-properties.html.ini new file mode 100644 index 000000000000..2e1731cc21b4 --- /dev/null +++ b/testing/web-platform/meta/dom/nodes/Node-properties.html.ini @@ -0,0 +1,8 @@ +[Node-properties.html] + type: testharness + [xmlElement.namespaceURI] + expected: FAIL + + [detachedXmlElement.namespaceURI] + expected: FAIL +