Bug 1264323 - Set namespace when DOMParser.parseFromString(application/xhtml+xml). r=smaug
☠☠ backed out by 9d17de23a08c ☠ ☠
authorJohn Dai <jdai@mozilla.com>
Thu, 30 Jun 2016 03:58:00 +0200
changeset 343425 b97c6b960d85c9b02c821ab87944a652d75174b8
parent 343424 38eebb8512cf9ad3f151b3554d6c9db2c5bc9597
child 343426 444a4a7233f776cea47f2a9eabe6a7f301de4b51
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1264323
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1264323 - Set namespace when DOMParser.parseFromString(application/xhtml+xml). r=smaug
dom/base/nsDocument.cpp
testing/web-platform/meta/dom/nodes/Document-createElement-namespace.html.ini
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -13370,16 +13370,21 @@ void
 nsIDocument::SetCachedEncoder(already_AddRefed<nsIDocumentEncoder> aEncoder)
 {
   mCachedEncoder = aEncoder;
 }
 
 void
 nsIDocument::SetContentTypeInternal(const nsACString& aType)
 {
+  if (!IsHTMLOrXHTML() && mDefaultElementType == kNameSpaceID_None &&
+      aType.EqualsLiteral("application/xhtml+xml")) {
+    mDefaultElementType = kNameSpaceID_XHTML;
+  }
+
   mCachedEncoder = nullptr;
   mContentType = aType;
 }
 
 nsILoadContext*
 nsIDocument::GetLoadContext() const
 {
   return mDocumentContainer;
--- a/testing/web-platform/meta/dom/nodes/Document-createElement-namespace.html.ini
+++ b/testing/web-platform/meta/dom/nodes/Document-createElement-namespace.html.ini
@@ -1,11 +1,8 @@
 [Document-createElement-namespace.html]
   type: testharness
   [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 XHTML document by DOMParser ('application/xhtml+xml')]
-    expected: FAIL
-