summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/generate.py
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/generate.py
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/generate.py')
-rwxr-xr-xtesting/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/generate.py77
1 files changed, 77 insertions, 0 deletions
diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/generate.py b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/generate.py
new file mode 100755
index 000000000..88c4da198
--- /dev/null
+++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/generate.py
@@ -0,0 +1,77 @@
+#!/usr/bin/python
+import os
+import sys
+
+THIS_NAME = "generate.py"
+
+# Note: these lists must be kept in sync with the lists in
+# Document-createElement-namespace.html, and this script must be run whenever
+# the lists are updated. (We could keep the lists in a shared JSON file, but
+# seems like too much effort.)
+FILES = (
+ ("empty", ""),
+ ("minimal_html", "<!doctype html><title></title>"),
+
+ ("xhtml", '<html xmlns="http://www.w3.org/1999/xhtml"></html>'),
+ ("svg", '<svg xmlns="http://www.w3.org/2000/svg"></svg>'),
+ ("mathml", '<mathml xmlns="http://www.w3.org/1998/Math/MathML"></mathml>'),
+
+ ("bare_xhtml", "<html></html>"),
+ ("bare_svg", "<svg></svg>"),
+ ("bare_mathml", "<math></math>"),
+
+ ("xhtml_ns_removed", """\
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head><script>
+ var newRoot = document.createElementNS(null, "html");
+ document.removeChild(document.documentElement);
+ document.appendChild(newRoot);
+ </script></head>
+</html>
+"""),
+ ("xhtml_ns_changed", """\
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head><script>
+ var newRoot = document.createElementNS("http://www.w3.org/2000/svg", "abc");
+ document.removeChild(document.documentElement);
+ document.appendChild(newRoot);
+ </script></head>
+</html>
+"""),
+)
+
+EXTENSIONS = (
+ "html",
+ "xhtml",
+ "xml",
+ "svg",
+ # Was not able to get server MIME type working properly :(
+ #"mml",
+)
+
+def __main__():
+ if len(sys.argv) > 1:
+ print "No arguments expected, aborting"
+ return
+
+ if not os.access(THIS_NAME, os.F_OK):
+ print "Must be run from the directory of " + THIS_NAME + ", aborting"
+ return
+
+ for name in os.listdir("."):
+ if name == THIS_NAME:
+ continue
+ os.remove(name)
+
+ manifest = open("MANIFEST", "w")
+
+ for name, contents in FILES:
+ for extension in EXTENSIONS:
+ f = open(name + "." + extension, "w")
+ f.write(contents)
+ f.close()
+ manifest.write("support " + name + "." + extension + "\n")
+
+ manifest.close()
+
+__main__()