Merge m-c to autoland
authorPhil Ringnalda <philringnalda@gmail.com>
Thu, 01 Sep 2016 21:55:08 -0700
changeset 312445 83133b8e14e63f6e9e78daa09a90a1810867060a
parent 312367 e12415c1560179174bd3bdaca11dd20e6b97d35a (current diff)
parent 312326 d5f20820c80514476f596090292a5d77c4b41e3b (diff)
child 312446 617559427df014717596246d8b0bc65ca81d6265
push id20447
push userkwierso@gmail.com
push dateFri, 02 Sep 2016 20:36:44 +0000
treeherderfx-team@969397f22187 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone51.0a1
Merge m-c to autoland
testing/web-platform/tests/dummy.xhtml
testing/web-platform/tests/dummy.xml
--- a/dom/tests/mochitest/bugs/mochitest.ini
+++ b/dom/tests/mochitest/bugs/mochitest.ini
@@ -71,16 +71,17 @@ skip-if = (buildapp == 'b2g' && toolkit 
 [test_bug393974.html]
 [test_bug394769.html]
 [test_bug396843.html]
 skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug))
 [test_bug400204.html]
 [test_bug404748.html]
 [test_bug406375.html]
 skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android'
+[test_bug411103.html]
 [test_bug414291.html]
 tags = openwindow
 [test_bug427744.html]
 skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android'
 [test_bug42976.html]
 [test_bug430276.html]
 [test_bug437361.html]
 skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android' # b2g(dom.disable_open_during_load not implemented in b2g, showmodaldialog) b2g-debug(dom.disable_open_during_load not implemented in b2g, showmodaldialog) b2g-desktop(dom.disable_open_during_load not implemented in b2g, showmodaldialog)
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/bugs/test_bug411103.html
@@ -0,0 +1,188 @@
+<!DOCTYPE html>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=411103
+-->
+<head>
+  <title>Test for Bug 411103</title>
+  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=411103">Mozilla Bug 411103</a>
+<p id="display"></p>
+<div id="content" style="display: none"></div>
+
+<!-- XML's createElement and createElementNS aren't HTML's, of course -->
+<iframe src="data:application/xml,%3Cfoo%3EXML%3C/foo%3E" name="xmlWindow"></iframe>
+
+<!-- for good measure... -->
+<iframe src="data:application/xhtml+xml,%3Chtml%20xmlns=%22http://www.w3.org/1999/xhtml%22%3E%3Cbody%3E%3Cp%3EXHTML%3C/p%3E%3C/body%3E%3C/html%3E"
+        name="xhtmlWindow"></iframe>
+
+<pre id="test">
+<script class="testbody" type="text/javascript">
+
+SimpleTest.waitForExplicitFinish();
+
+/** Test for Bug 411103 **/
+var allNSTests =
+  [
+   { args: [undefined, undefined] },
+   { args: [null, undefined] },
+   { args: [undefined, null] },
+   { args: [null, null] },
+   { args: [null, ""], code: 5 },
+   { args: ["", null] },
+   { args: ["", ""], code: 5 },
+   { args: [null, "<div>"], code: 5 },
+   { args: [null, "0div"], code: 5 },
+   { args: [null, "di v"], code: 5 },
+   { args: [null, "di<v"], code: 5 },
+   { args: [null, "-div"], code: 5 },
+   { args: [null, ".div"], code: 5 },
+   { args: ["http://example.com/", "<div>"], code: 5 },
+   { args: ["http://example.com/", "0div"], code: 5 },
+   { args: ["http://example.com/", "di<v"], code: 5 },
+   { args: ["http://example.com/", "-div"], code: 5 },
+   { args: ["http://example.com/", ".div"], code: 5 },
+   { args: [null, ":div"], code: 14 },
+   { args: [null, "div:"], code: 14 },
+   { args: ["http://example.com/", ":div"], code: 14 },
+   { args: ["http://example.com/", "div:"], code: 14 },
+   { args: [null, "d:iv"], code: 14 },
+   { args: [null, "a:b:c"], code: 14, message: "valid XML name, invalid QName" },
+   { args: ["http://example.com/", "a:b:c"], code: 14, message: "valid XML name, invalid QName" },
+   { args: [null, "a::c"], code: 14, message: "valid XML name, invalid QName" },
+   { args: ["http://example.com/", "a::c"], code: 14, message: "valid XML name, invalid QName" },
+   { args: ["http://example.com/", "a:0"], code: 5, message: "valid XML name, not a valid QName" },
+   { args: ["http://example.com/", "0:a"], code: 5, message: "0 at start makes it not a valid XML name" },
+   { args: ["http://example.com/", "a:_"] },
+   { args: ["http://example.com/", "a:\u0BC6"], code: 14,
+     message: "non-ASCII character after colon is CombiningChar, which is " +
+              "NCNameChar but not (Letter | \"_\") so invalid at start of " +
+              "NCName (but still a valid XML name, hence not 5)" },
+   { args: ["http://example.com/", "\u0BC6:a"], code: 14,
+     message: "non-ASCII character after colon is CombiningChar, which is " +
+              "NCNameChar but not (Letter | \"_\") so invalid at start of " +
+              "NCName (Gecko chooses to throw 14 here, but either is valid " +
+              "as this is both an invalid XML name and an invalid QName)" },
+   { args: ["http://example.com/", "a:a\u0BC6"] },
+   { args: ["http://example.com/", "a\u0BC6:a"] },
+   { args: ["http://example.com/", "xml:test"], code: 14, message: "binding xml prefix wrong" },
+   { args: ["http://example.com/", "xmlns:test"], code: 14, message: "binding xmlns prefix wrong" },
+   { args: ["http://www.w3.org/2000/xmlns/", "x:test"], code: 14, message: "binding namespace namespace to wrong prefix" },
+   { args: ["http://www.w3.org/2000/xmlns/", "xmlns:test"] },
+   { args: ["http://www.w3.org/XML/1998/namespace", "xml:test"] },
+   { args: ["http://www.w3.org/XML/1998/namespace", "x:test"] },
+  ];
+
+var allNoNSTests =
+  [
+   { args: [undefined] },
+   { args: [null] },
+   { args: [""], code: 5 },
+   { args: ["<div>"], code: 5 },
+   { args: ["0div"], code: 5 },
+   { args: ["di v"], code: 5 },
+   { args: ["di<v"], code: 5 },
+   { args: ["-div"], code: 5 },
+   { args: [".div"], code: 5 },
+   { args: [":"], message: "valid XML name, invalid QName" },
+   { args: [":div"], message: "valid XML name, invalid QName" },
+   { args: ["div:"], message: "valid XML name, invalid QName" },
+   { args: ["d:iv"] },
+   { args: ["a:b:c"], message: "valid XML name, invalid QName" },
+   { args: ["a::c"], message: "valid XML name, invalid QName" },
+   { args: ["a::c:"], message: "valid XML name, invalid QName" },
+   { args: ["a:0"], message: "valid XML name, not a valid QName" },
+   { args: ["0:a"], code: 5, message: "0 at start makes it not a valid XML name" },
+   { args: ["a:_"] },
+   { args: ["a:\u0BC6"],
+     message: "non-ASCII character after colon is CombiningChar, which is " +
+              "valid in pre-namespace XML" },
+   { args: ["\u0BC6:a"], code: 5, message: "not a valid start character" },
+   { args: ["a:a\u0BC6"] },
+   { args: ["a\u0BC6:a"] },
+   { args: ["xml:test"] },
+   { args: ["xmlns:test"] },
+   { args: ["x:test"] },
+   { args: ["xmlns:test"] },
+  ];
+
+function sourceify(v)
+{
+  switch (typeof v)
+  {
+    case "undefined":
+      return v;
+
+    case "string":
+      return '"' + v.replace('"', '\\"') + '"';
+
+    default:
+      return String(v);
+  }
+}
+
+function sourceifyArgs(args)
+{
+  var copy = new Array(args.length);
+  for (var i = 0, sz = args.length; i < sz; i++)
+    copy[i] = sourceify(args[i]);
+
+  return copy.join(", ");
+}
+
+function runTests(tests, methodName, document)
+{
+  for (var i = 0, sz = tests.length; i < sz; i++)
+  {
+    var test = tests[i];
+  
+    var argStr = sourceifyArgs(test.args);
+    try
+    {
+      document[methodName].apply(document, test.args);
+      var msg = "expected no exception for " +
+                "document." + methodName + "(" + argStr + ")";
+      if ("message" in test)
+        msg += "; " + test.message;
+      ok(!("code" in test), msg);
+    }
+    catch (e)
+    {
+      msg = "exception code for document." + methodName + "(" + argStr + ")";
+      if ("message" in test)
+        msg += "; " + test.message;
+      is(e.code, test.code || "no exception", msg);
+    }
+  }
+}
+
+
+function run()
+{
+  // HTML document
+  runTests(allNSTests, "createElementNS", document);
+  runTests(allNoNSTests, "createElement", document);
+
+  // XML document
+  var xmlDocument = window.frames.xmlWindow.document;
+  runTests(allNSTests, "createElementNS", xmlDocument);
+  runTests(allNoNSTests, "createElement", xmlDocument);
+
+  // XHTML document, for good measure
+  var xhtmlDocument = window.frames.xhtmlWindow.document;
+  runTests(allNSTests, "createElementNS", xhtmlDocument);
+  runTests(allNoNSTests, "createElement", xhtmlDocument);
+
+  SimpleTest.finish();
+}
+
+window.addEventListener("load", run, false);
+
+</script>
+</pre>
+</body>
+</html>
--- a/parser/expat/lib/moz_extensions.c
+++ b/parser/expat/lib/moz_extensions.c
@@ -40,24 +40,27 @@ int MOZ_XMLCheckQName(const char* ptr, c
           or we've already seen a colon. */
       if (ns_aware && (nmstrt || *colon || ptr + 2 == end)) {
         return MOZ_EXPAT_MALFORMED;
       }
       *colon = ptr;
       nmstrt = ns_aware; /* e.g. "a:0" should be valid if !ns_aware */
       break;
     case BT_NONASCII:
-      if (!IS_NAME_CHAR_MINBPC(ptr) ||
-          (nmstrt && !*colon && !IS_NMSTRT_CHAR_MINBPC(ptr))) {
-        return MOZ_EXPAT_INVALID_CHARACTER;
+      if (nmstrt && !IS_NMSTRT_CHAR_MINBPC(ptr)) {
+        /* If this is a valid name character and we're namespace-aware, the
+           QName is malformed.  Otherwise, this character's invalid at the
+           start of a name (or, if we're namespace-aware, at the start of a
+           localpart). */
+        return (IS_NAME_CHAR_MINBPC(ptr) && ns_aware) ?
+               MOZ_EXPAT_MALFORMED :
+               MOZ_EXPAT_INVALID_CHARACTER;
       }
-      if (nmstrt && *colon && !IS_NMSTRT_CHAR_MINBPC(ptr)) {
-        /* If a non-starting character like a number is right after the colon,
-           this is a namespace error, not invalid character */
-        return MOZ_EXPAT_MALFORMED;
+      if (!IS_NAME_CHAR_MINBPC(ptr)) {
+        return MOZ_EXPAT_INVALID_CHARACTER;
       }
       nmstrt = 0;
       break;
     case BT_NMSTRT:
     case BT_HEX:
       nmstrt = 0;
       break;
     case BT_DIGIT:
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -1,20 +1,12 @@
 {
   "items": {
     "manual": [
       {
-        "path": "dummy.xml",
-        "url": "/dummy.xml"
-      },
-      {
-        "path": "dummy.xhtml",
-        "url": "/dummy.xhtml"
-      },
-      {
         "path": "2dcontext/conformance-requirements/2d.coordinatespace-manual.html",
         "url": "/2dcontext/conformance-requirements/2d.coordinatespace-manual.html"
       },
       {
         "path": "2dcontext/drawing-paths-to-the-canvas/canvas_focus_drawFocusIfNeeded_AAPI_001-manual.html",
         "url": "/2dcontext/drawing-paths-to-the-canvas/canvas_focus_drawFocusIfNeeded_AAPI_001-manual.html"
       },
       {
--- a/testing/web-platform/meta/dom/historical.html.ini
+++ b/testing/web-platform/meta/dom/historical.html.ini
@@ -1,18 +1,14 @@
 [historical.html]
   type: testharness
   [Historical DOM features must be removed: CDATASection]
     expected: FAIL
-    bug: 660660
 
   [Historical DOM features must be removed: DOMError]
     expected: FAIL
-    bug: 1120178
 
   [Historical DOM features must be removed: createCDATASection]
     expected: FAIL
-    bug: 660660
 
   [Node member must be nuked: rootNode]
     expected: FAIL
-    bug: 1269155
 
--- a/testing/web-platform/meta/dom/interfaces.html.ini
+++ b/testing/web-platform/meta/dom/interfaces.html.ini
@@ -1,28 +1,25 @@
 [interfaces.html]
   type: testharness
   prefs: [dom.node.rootNode.enabled:true]
   [MutationObserver interface: operation observe(Node,MutationObserverInit)]
     expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/316
 
   [Document interface: attribute origin]
     expected: FAIL
-    bug: 931884
 
   [Document interface: operation query(DOMString)]
     expected: FAIL
 
   [Document interface: operation queryAll(DOMString)]
     expected: FAIL
 
   [Document interface: xmlDoc must inherit property "origin" with the proper type (3)]
     expected: FAIL
-    bug: 931884
 
   [Document interface: xmlDoc must inherit property "query" with the proper type (34)]
     expected: FAIL
 
   [Document interface: calling query(DOMString) on xmlDoc with too few arguments must throw TypeError]
     expected: FAIL
 
   [Document interface: xmlDoc must inherit property "queryAll" with the proper type (35)]
@@ -76,33 +73,31 @@
   [Attr interface: attribute nodeValue]
     expected: FAIL
 
   [Attr interface: attribute textContent]
     expected: FAIL
 
   [NodeFilter interface: existence and properties of interface object]
     expected: FAIL
-    bug: https://github.com/heycam/webidl/issues/96
 
   [Document interface: xmlDoc must inherit property "query" with the proper type (35)]
     expected: FAIL
 
   [Document interface: xmlDoc must inherit property "queryAll" with the proper type (36)]
     expected: FAIL
 
   [Element interface: element must inherit property "query" with the proper type (36)]
     expected: FAIL
 
   [Element interface: element must inherit property "queryAll" with the proper type (37)]
     expected: FAIL
 
   [Document interface: new Document() must inherit property "origin" with the proper type (3)]
     expected: FAIL
-    bug: 931884
 
   [Document interface: new Document() must inherit property "query" with the proper type (35)]
     expected: FAIL
 
   [Document interface: calling query(DOMString) on new Document() with too few arguments must throw TypeError]
     expected: FAIL
 
   [Document interface: new Document() must inherit property "queryAll" with the proper type (36)]
--- a/testing/web-platform/meta/dom/nodes/DOMImplementation-createDocument.html.ini
+++ b/testing/web-platform/meta/dom/nodes/DOMImplementation-createDocument.html.ini
@@ -1,22 +1,17 @@
 [DOMImplementation-createDocument.html]
   type: testharness
-  [createDocument test 67: "http://example.com/","a:0",null,"NAMESPACE_ERR"]
+  [createDocument test 6: null,"̀foo",null,"INVALID_CHARACTER_ERR"]
     expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/319
 
-  [createDocument test 197: metadata for null,null,DocumentType node]
+  [createDocument test 172: metadata for null,null,DocumentType node]
     expected: FAIL
-    bug: 520969
 
-  [createDocument test 197: null,null,DocumentType node,null]
+  [createDocument test 172: null,null,DocumentType node,null]
     expected: FAIL
-    bug: 520969
 
-  [createDocument test 210: null,"",DocumentType node]
+  [createDocument test 185: null,"",DocumentType node]
     expected: FAIL
-    bug: 520969
 
-  [createDocument test 211: null,"",DocumentType node]
+  [createDocument test 186: null,"",DocumentType node]
     expected: FAIL
-    bug: 520969
 
--- a/testing/web-platform/meta/dom/nodes/Document-createElementNS.html.ini
+++ b/testing/web-platform/meta/dom/nodes/Document-createElementNS.html.ini
@@ -1,14 +1,5 @@
 [Document-createElementNS.html]
   type: testharness
-  [createElementNS test 67 in HTML document: "http://example.com/","a:0","NAMESPACE_ERR"]
-    bug: https://github.com/whatwg/dom/issues/319
+  [createElementNS test 6: null,"̀foo","INVALID_CHARACTER_ERR"]
     expected: FAIL
 
-  [createElementNS test 67 in XML document: "http://example.com/","a:0","NAMESPACE_ERR"]
-    bug: https://github.com/whatwg/dom/issues/319
-    expected: FAIL
-
-  [createElementNS test 67 in XHTML document: "http://example.com/","a:0","NAMESPACE_ERR"]
-    bug: https://github.com/whatwg/dom/issues/319
-    expected: FAIL
-
--- a/testing/web-platform/meta/dom/nodes/Element-classlist.html.ini
+++ b/testing/web-platform/meta/dom/nodes/Element-classlist.html.ini
@@ -1,36 +1,28 @@
 [Element-classlist.html]
   type: testharness
   [classList must be correct for an element that has classes]
     expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/105
-    bug: 869788
 
   [empty classList should return the empty string since the ordered set parser skip the whitespaces]
     expected: FAIL
 
   [classList.remove must collapse whitespaces around each token and remove duplicates]
     expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/105
-    bug: 869788
 
   [classList.add must collapse whitespaces and remove duplicates when adding a token that already exists]
     expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/105
-    bug: 869788
 
   [classList.add should treat \\t as a space]
     expected: FAIL
 
   [classList.add should treat \\r as a space]
     expected: FAIL
 
   [classList.add should treat \\n as a space]
     expected: FAIL
 
   [classList.add should treat \\f as a space]
     expected: FAIL
 
   [classList.replace must collapse whitespaces around each token and remove duplicates]
     expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/105
-    bug: 869788
--- a/testing/web-platform/tests/dom/nodes/Document-createElement.html
+++ b/testing/web-platform/tests/dom/nodes/Document-createElement.html
@@ -4,154 +4,82 @@
 <link rel=help href="https://dom.spec.whatwg.org/#dom-document-createelement">
 <link rel=help href="https://dom.spec.whatwg.org/#dom-element-localname">
 <link rel=help href="https://dom.spec.whatwg.org/#dom-element-tagname">
 <link rel=help href="https://dom.spec.whatwg.org/#dom-element-prefix">
 <link rel=help href="https://dom.spec.whatwg.org/#dom-element-namespaceuri">
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <div id="log"></div>
-<iframe src="/dummy.xml"></iframe>
-<iframe src="/dummy.xhtml"></iframe>
 <script>
 function toASCIIUppercase(str) {
   var diff = "a".charCodeAt(0) - "A".charCodeAt(0);
   var res = "";
   for (var i = 0; i < str.length; ++i) {
     if ("a" <= str[i] && str[i] <= "z") {
       res += String.fromCharCode(str.charCodeAt(i) - diff);
     } else {
       res += str[i];
     }
   }
   return res;
 }
-function toASCIILowercase(str) {
-  var diff = "a".charCodeAt(0) - "A".charCodeAt(0);
-  var res = "";
-  for (var i = 0; i < str.length; ++i) {
-    if ("A" <= str[i] && str[i] <= "Z") {
-      res += String.fromCharCode(str.charCodeAt(i) + diff);
-    } else {
-      res += str[i];
-    }
-  }
-  return res;
-}
-var HTMLNS = "http://www.w3.org/1999/xhtml",
-    valid = [
-      undefined,
-      null,
-      "foo",
-      "f1oo",
-      "foo1",
-      "f\u0BC6",
-      "foo\u0BC6",
-      ":",
-      ":foo",
-      "f:oo",
-      "foo:",
-      "f:o:o",
-      "f::oo",
-      "f::oo:",
-      "foo:0",
-      "foo:_",
-      // combining char after :, invalid QName but valid Name
-      "foo:\u0BC6",
-      "foo:foo\u0BC6",
-      "foo\u0BC6:foo",
-      "xml",
-      "xmlns",
-      "xmlfoo",
-      "xml:foo",
-      "xmlns:foo",
-      "xmlfoo:bar",
-      "svg",
-      "math",
-      "FOO",
-      // Test that non-ASCII chars don't get uppercased/lowercased
-      "mar\u212a",
-      "\u0130nput",
-      "\u0131nput",
-    ],
-    invalid = [
-      "",
-      "1foo",
-      "1:foo",
-      "fo o",
-      "\u0BC6foo",
-      "}foo",
-      "f}oo",
-      "foo}",
-      "\ufffffoo",
-      "f\uffffoo",
-      "foo\uffff",
-      "<foo",
-      "foo>",
-      "<foo>",
-      "f<oo",
-      "-foo",
-      ".foo",
-      "\u0BC6",
-    ]
+test(function() {
+  var HTMLNS = "http://www.w3.org/1999/xhtml",
+      valid = [
+        //[input, localName],
+        [undefined, "undefined"],
+        [null, "null"],
+        ["foo", "foo"],
+        ["f1oo", "f1oo"],
+        ["foo1", "foo1"],
+        ["f\u0300oo", "f\u0300oo"],
+        ["foo\u0300", "foo\u0300"],
+        [":foo", ":foo"],
+        ["f:oo", "f:oo"],
+        ["foo:", "foo:"],
+        ["xml", "xml"],
+        ["xmlns", "xmlns"],
+        ["xmlfoo", "xmlfoo"],
+        ["xml:foo", "xml:foo"],
+        ["xmlns:foo", "xmlns:foo"],
+        ["xmlfoo:bar", "xmlfoo:bar"],
+        ["svg", "svg"],
+        ["math", "math"],
+        ["FOO", "foo"],
+        ["mar\u212a", "mar\u212a"],
+        ["\u0130nput", "\u0130nput"],
+        ["\u0131nput", "\u0131nput"]
+     ],
+     invalid = [
+       "",
+       "1foo",
+       "\u0300foo",
+       "}foo",
+       "f}oo",
+       "foo}",
+       "\ufffffoo",
+       "f\uffffoo",
+       "foo\uffff",
+       "<foo",
+       "foo>",
+       "<foo>",
+       "f<oo"
+     ]
 
-var xmlIframe = document.querySelector('[src="/dummy.xml"]');
-var xhtmlIframe = document.querySelector('[src="/dummy.xhtml"]');
-
-function getWin(desc) {
-  if (desc == "HTML document") {
-    return window;
-  }
-  if (desc == "XML document") {
-    assert_equals(xmlIframe.contentDocument.documentElement.textContent,
-                  "Dummy XML document", "XML document didn't load");
-    return xmlIframe.contentWindow;
-  }
-  if (desc == "XHTML document") {
-    assert_equals(xhtmlIframe.contentDocument.documentElement.textContent,
-                  "Dummy XHTML document", "XHTML document didn't load");
-    return xhtmlIframe.contentWindow;
-  }
-}
-
-
-valid.forEach(function(t) {
-  ["HTML document", "XML document", "XHTML document"].forEach(function(desc) {
-    async_test(function(testObj) {
-      window.addEventListener("load", function() {
-        testObj.step(function() {
-          var win = getWin(desc);
-          var doc = win.document;
-          var elt = doc.createElement(t)
-          assert_true(elt instanceof win.Element, "instanceof Element")
-          assert_true(elt instanceof win.Node, "instanceof Node")
-          assert_equals(elt.localName,
-                        desc == "HTML document" ? toASCIILowercase(String(t))
-                                                : String(t),
-                        "localName")
-          assert_equals(elt.tagName,
-                        desc == "HTML document" ? toASCIIUppercase(String(t))
-                                                : String(t),
-                        "tagName")
-          assert_equals(elt.prefix, null, "prefix")
-          assert_equals(elt.namespaceURI,
-                        desc == "XML document" ? null : HTMLNS, "namespaceURI")
-        });
-        testObj.done();
-      });
-    }, "createElement(" + format_value(t) + ") in " + desc);
+  valid.forEach(function(t) {
+    test(function() {
+      var elt = document.createElement(t[0])
+      assert_true(elt instanceof Element)
+      assert_true(elt instanceof Node)
+      assert_equals(elt.localName, t[1])
+      assert_equals(elt.tagName, toASCIIUppercase(t[1]))
+      assert_equals(elt.prefix, null)
+      assert_equals(elt.namespaceURI, HTMLNS)
+    }, "createElement(" + format_value(t[0]) + ")");
   });
-});
-invalid.forEach(function(arg) {
-  ["HTML document", "XML document", "XHTML document"].forEach(function(desc) {
-    async_test(function(testObj) {
-      window.addEventListener("load", function() {
-        testObj.step(function() {
-          var doc = getWin(desc).document;
-          assert_throws("InvalidCharacterError",
-                        function() { doc.createElement(arg) })
-        });
-        testObj.done();
-      });
-    }, "createElement(" + format_value(arg) + ") in " + desc);
+  invalid.forEach(function(arg) {
+    test(function() {
+      assert_throws("INVALID_CHARACTER_ERR", function() { document.createElement(arg) })
+    }, "createElement(" + format_value(arg) + ")");
   });
-});
+})
 </script>
--- a/testing/web-platform/tests/dom/nodes/Document-createElementNS.html
+++ b/testing/web-platform/tests/dom/nodes/Document-createElementNS.html
@@ -1,98 +1,70 @@
 <!DOCTYPE html>
 <meta charset=utf-8>
 <title>Document.createElementNS</title>
 <link rel=help href="https://dom.spec.whatwg.org/#dom-document-createelementns">
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <script src="Document-createElementNS.js"></script>
 <div id="log"></div>
-<iframe src="/dummy.xml"></iframe>
-<iframe src="/dummy.xhtml"></iframe>
 <script>
-var tests = createElementNS_tests.concat([
-  /* Arrays with three elements:
-   *   the namespace argument
-   *   the qualifiedName argument
-   *   the expected exception, or null if none
-   */
-  ["", "", "INVALID_CHARACTER_ERR"],
-  [null, null, null],
-  [null, "", "INVALID_CHARACTER_ERR"],
-  [undefined, null, null],
-  [undefined, undefined, null],
-  [undefined, "", "INVALID_CHARACTER_ERR"],
-  ["http://example.com/", null, null],
-  ["http://example.com/", "", "INVALID_CHARACTER_ERR"],
-  ["/", null, null],
-  ["/", "", "INVALID_CHARACTER_ERR"],
-  ["http://www.w3.org/XML/1998/namespace", null, null],
-  ["http://www.w3.org/XML/1998/namespace", "", "INVALID_CHARACTER_ERR"],
-  ["http://www.w3.org/2000/xmlns/", null, "NAMESPACE_ERR"],
-  ["http://www.w3.org/2000/xmlns/", "", "INVALID_CHARACTER_ERR"],
-  ["foo:", null, null],
-  ["foo:", "", "INVALID_CHARACTER_ERR"],
-])
-
-var xmlIframe = document.querySelector('[src="/dummy.xml"]');
-var xhtmlIframe = document.querySelector('[src="/dummy.xhtml"]');
+test(function() {
+  var tests = createElementNS_tests.concat([
+    /* Arrays with three elements:
+     *   the namespace argument
+     *   the qualifiedName argument
+     *   the expected exception, or null if none
+     */
+    ["", "", "INVALID_CHARACTER_ERR"],
+    [null, null, null],
+    [null, "", "INVALID_CHARACTER_ERR"],
+    [undefined, null, null],
+    [undefined, undefined, null],
+    [undefined, "", "INVALID_CHARACTER_ERR"],
+    ["http://example.com/", null, null],
+    ["http://example.com/", "", "INVALID_CHARACTER_ERR"],
+    ["/", null, null],
+    ["/", "", "INVALID_CHARACTER_ERR"],
+    ["http://www.w3.org/XML/1998/namespace", null, null],
+    ["http://www.w3.org/XML/1998/namespace", "", "INVALID_CHARACTER_ERR"],
+    ["http://www.w3.org/2000/xmlns/", null, "NAMESPACE_ERR"],
+    ["http://www.w3.org/2000/xmlns/", "", "INVALID_CHARACTER_ERR"],
+    ["foo:", null, null],
+    ["foo:", "", "INVALID_CHARACTER_ERR"],
+  ])
 
-function runTest(t, i, desc) {
-  async_test(function(testObj) {
-    window.addEventListener("load", function() {
-      testObj.step(function() {
-        var doc;
-        if (desc == "HTML document") {
-          doc = document;
-        } else if (desc == "XML document") {
-          doc = xmlIframe.contentDocument;
-          // Make sure we're testing the right document
-          assert_equals(doc.documentElement.textContent, "Dummy XML document");
-        } else if (desc == "XHTML document") {
-          doc = xhtmlIframe.contentDocument;
-          assert_equals(doc.documentElement.textContent, "Dummy XHTML document");
-        }
-        var namespace = t[0], qualifiedName = t[1], expected = t[2]
-        if (expected != null) {
-          assert_throws(expected, function() { doc.createElementNS(namespace, qualifiedName) })
+  tests.forEach(function(t, i) {
+    test(function() {
+      var namespace = t[0], qualifiedName = t[1], expected = t[2]
+      if (expected != null) {
+        assert_throws(expected, function() { document.createElementNS(namespace, qualifiedName) })
+      } else {
+        var element = document.createElementNS(namespace, qualifiedName)
+        assert_not_equals(element, null)
+        assert_equals(element.nodeType, Node.ELEMENT_NODE)
+        assert_equals(element.nodeType, element.ELEMENT_NODE)
+        assert_equals(element.nodeValue, null)
+        assert_equals(element.ownerDocument, document)
+        var qualified = String(qualifiedName), names = []
+        if (qualified.indexOf(":") >= 0) {
+          names = qualified.split(":", 2)
         } else {
-          var element = doc.createElementNS(namespace, qualifiedName)
-          assert_not_equals(element, null)
-          assert_equals(element.nodeType, Node.ELEMENT_NODE)
-          assert_equals(element.nodeType, element.ELEMENT_NODE)
-          assert_equals(element.nodeValue, null)
-          assert_equals(element.ownerDocument, doc)
-          var qualified = String(qualifiedName), names = []
-          if (qualified.indexOf(":") >= 0) {
-            names = qualified.split(":", 2)
-          } else {
-            names = [null, qualified]
-          }
-          assert_equals(element.prefix, names[0])
-          assert_equals(element.localName, names[1])
-          assert_equals(element.tagName, qualified)
-          assert_equals(element.nodeName, qualified)
-          assert_equals(element.namespaceURI,
-                        namespace === undefined || namespace === "" ? null
-                                                                    : namespace)
+          names = [null, qualified]
         }
-      });
-      testObj.done();
-    });
-  }, "createElementNS test " + i + " in " + desc + ": " + t.map(format_value))
-}
-
-tests.forEach(function(t, i) {
-  runTest(t, i, "HTML document")
-  runTest(t, i, "XML document")
-  runTest(t, i, "XHTML document")
+        assert_equals(element.prefix, names[0])
+        assert_equals(element.localName, names[1])
+        assert_equals(element.tagName, qualified)
+        assert_equals(element.nodeName, qualified)
+        assert_equals(element.namespaceURI, namespace === undefined ? null : namespace)
+      }
+    }, "createElementNS test " + i + ": " + t.map(function(el) { return format_value(el) }))
+  })
 })
 
-
 test(function() {
   var HTMLNS = "http://www.w3.org/1999/xhtml";
   var element = document.createElementNS(HTMLNS, "span");
   assert_equals(element.namespaceURI, HTMLNS);
   assert_equals(element.prefix, null);
   assert_equals(element.localName, "span");
   assert_equals(element.tagName, "SPAN");
   assert_true(element instanceof Node, "Should be a Node");
--- a/testing/web-platform/tests/dom/nodes/Document-createElementNS.js
+++ b/testing/web-platform/tests/dom/nodes/Document-createElementNS.js
@@ -1,92 +1,67 @@
 var createElementNS_tests = [
   /* Arrays with three elements:
    *   the namespace argument
    *   the qualifiedName argument
    *   the expected exception, or null if none
    */
-  [null, null, null],
   [null, undefined, null],
   [null, "foo", null],
   [null, "1foo", "INVALID_CHARACTER_ERR"],
   [null, "f1oo", null],
   [null, "foo1", null],
   [null, "1foo", "INVALID_CHARACTER_ERR"],
-  [null, "\u0BC6foo", "INVALID_CHARACTER_ERR"],
+  [null, "\u0300foo", "INVALID_CHARACTER_ERR"],
   [null, "}foo", "INVALID_CHARACTER_ERR"],
   [null, "f}oo", "INVALID_CHARACTER_ERR"],
   [null, "foo}", "INVALID_CHARACTER_ERR"],
   [null, "\uFFFFfoo", "INVALID_CHARACTER_ERR"],
   [null, "f\uFFFFoo", "INVALID_CHARACTER_ERR"],
   [null, "foo\uFFFF", "INVALID_CHARACTER_ERR"],
   [null, "<foo", "INVALID_CHARACTER_ERR"],
   [null, "foo>", "INVALID_CHARACTER_ERR"],
   [null, "<foo>", "INVALID_CHARACTER_ERR"],
   [null, "f<oo", "INVALID_CHARACTER_ERR"],
   [null, "^^", "INVALID_CHARACTER_ERR"],
-  [null, "fo o", "INVALID_CHARACTER_ERR"],
-  [null, "-foo", "INVALID_CHARACTER_ERR"],
-  [null, ".foo", "INVALID_CHARACTER_ERR"],
   [null, ":foo", "NAMESPACE_ERR"],
   [null, "f:oo", "NAMESPACE_ERR"],
   [null, "foo:", "NAMESPACE_ERR"],
-  [null, "f:o:o", "NAMESPACE_ERR"],
   [null, ":", "NAMESPACE_ERR"],
   [null, "xml", null],
   [null, "xmlns", "NAMESPACE_ERR"],
   [null, "xmlfoo", null],
   [null, "xml:foo", "NAMESPACE_ERR"],
   [null, "xmlns:foo", "NAMESPACE_ERR"],
   [null, "xmlfoo:bar", "NAMESPACE_ERR"],
   [null, "null:xml", "NAMESPACE_ERR"],
-  ["", null, null],
   ["", ":foo", "NAMESPACE_ERR"],
   ["", "f:oo", "NAMESPACE_ERR"],
   ["", "foo:", "NAMESPACE_ERR"],
-  [undefined, null, null],
   [undefined, undefined, null],
   [undefined, "foo", null],
   [undefined, "1foo", "INVALID_CHARACTER_ERR"],
   [undefined, "f1oo", null],
   [undefined, "foo1", null],
   [undefined, ":foo", "NAMESPACE_ERR"],
   [undefined, "f:oo", "NAMESPACE_ERR"],
   [undefined, "foo:", "NAMESPACE_ERR"],
-  [undefined, "f::oo", "NAMESPACE_ERR"],
   [undefined, "xml", null],
   [undefined, "xmlns", "NAMESPACE_ERR"],
   [undefined, "xmlfoo", null],
   [undefined, "xml:foo", "NAMESPACE_ERR"],
   [undefined, "xmlns:foo", "NAMESPACE_ERR"],
   [undefined, "xmlfoo:bar", "NAMESPACE_ERR"],
   ["http://example.com/", "foo", null],
   ["http://example.com/", "1foo", "INVALID_CHARACTER_ERR"],
-  ["http://example.com/", "<foo>", "INVALID_CHARACTER_ERR"],
-  ["http://example.com/", "fo<o", "INVALID_CHARACTER_ERR"],
-  ["http://example.com/", "-foo", "INVALID_CHARACTER_ERR"],
-  ["http://example.com/", ".foo", "INVALID_CHARACTER_ERR"],
   ["http://example.com/", "f1oo", null],
   ["http://example.com/", "foo1", null],
   ["http://example.com/", ":foo", "NAMESPACE_ERR"],
   ["http://example.com/", "f:oo", null],
-  ["http://example.com/", "f:o:o", "NAMESPACE_ERR"],
   ["http://example.com/", "foo:", "NAMESPACE_ERR"],
-  ["http://example.com/", "f::oo", "NAMESPACE_ERR"],
-  ["http://example.com/", "a:0", "NAMESPACE_ERR"],
-  ["http://example.com/", "0:a", "INVALID_CHARACTER_ERR"],
-  ["http://example.com/", "a:_", null],
-  ["http://example.com/", "a:\u0BC6", "NAMESPACE_ERR"],
-  ["http://example.com/", "\u0BC6:a", "INVALID_CHARACTER_ERR"],
-  ["http://example.com/", "a:a\u0BC6", null],
-  ["http://example.com/", "a\u0BC6:a", null],
-  ["http://example.com/", "xml:test", "NAMESPACE_ERR"],
-  ["http://example.com/", "xmlns:test", "NAMESPACE_ERR"],
-  ["http://example.com/", "test:xmlns", null],
-  ["http://example.com/", "xmlns", "NAMESPACE_ERR"],
   ["http://example.com/", "_:_", null],
   ["http://example.com/", "_:h0", null],
   ["http://example.com/", "_:test", null],
   ["http://example.com/", "l_:_", null],
   ["http://example.com/", "ns:_0", null],
   ["http://example.com/", "ns:a0", null],
   ["http://example.com/", "ns0:test", null],
   ["http://example.com/", "a.b:c", null],
deleted file mode 100644
--- a/testing/web-platform/tests/dummy.xhtml
+++ /dev/null
@@ -1,2 +0,0 @@
-<!DOCTYPE html>
-<html><head><title>Dummy XHTML document</title></head><body /></html>
deleted file mode 100644
--- a/testing/web-platform/tests/dummy.xml
+++ /dev/null
@@ -1,1 +0,0 @@
-<foo>Dummy XML document</foo>