diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/html/the-xhtml-syntax | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-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/html/the-xhtml-syntax')
6 files changed, 67 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/the-xhtml-syntax/.gitkeep b/testing/web-platform/tests/html/the-xhtml-syntax/.gitkeep new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/testing/web-platform/tests/html/the-xhtml-syntax/.gitkeep diff --git a/testing/web-platform/tests/html/the-xhtml-syntax/parsing-xhtml-documents/.gitkeep b/testing/web-platform/tests/html/the-xhtml-syntax/parsing-xhtml-documents/.gitkeep new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/testing/web-platform/tests/html/the-xhtml-syntax/parsing-xhtml-documents/.gitkeep diff --git a/testing/web-platform/tests/html/the-xhtml-syntax/parsing-xhtml-documents/xhtml-mathml-dtd-entity-support.htm b/testing/web-platform/tests/html/the-xhtml-syntax/parsing-xhtml-documents/xhtml-mathml-dtd-entity-support.htm new file mode 100644 index 000000000..8460f5ff1 --- /dev/null +++ b/testing/web-platform/tests/html/the-xhtml-syntax/parsing-xhtml-documents/xhtml-mathml-dtd-entity-support.htm @@ -0,0 +1,67 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<title>HTML entities for various XHTML Doctype variants</title> +<link rel=help href="http://w3c.github.io/html/xhtml.html#parsing-xhtml-documents"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<div id="log"></div> +<script> + var parser = new DOMParser(); + var parse = parser.parseFromString.bind(parser); + + function generateTestFunction(entitystring, expectedString, publicId, systemId, mimeType, friendlyMime) { + return function () { + var doctypeString = '<!DOCTYPE html'; + if (publicId != null) + doctypeString += ' PUBLIC "' + publicId + '" "' + systemId + '">'; + else if (systemId != null) + doctypeString += ' SYSTEM "' + systemId + '">'; + else // both are null + doctypeString += '>'; + var doc = parse(doctypeString + "<html><head></head><body id='test'>"+entitystring+"</body></html>", mimeType); + var root = doc.getElementById('test'); + assert_not_equals(root, null, friendlyMime + " parsing the entity reference caused a parse error;"); + assert_true(!!root.firstChild); + // Next line because some browsers include the partial parsed result in the parser error returned document. + assert_equals(root.firstChild.nodeType, 3/*Text*/, friendlyMime + " parsing the entity reference caused a parse error;"); + var text = root.firstChild.data; + for (var i = 0, len = expectedString.length; i < len; i++) { + assert_equals(text.charCodeAt(i),expectedString.charCodeAt(i)); + } + } + } + + function setupTests(jsonEntities, publicId, systemId, mimeType, friendlyMime) { + for (entityName in jsonEntities) { + if ((mimeType == "text/html") || /;$/.test(entityName)) { + test(generateTestFunction(entityName, jsonEntities[entityName].characters, publicId, systemId, mimeType, friendlyMime), friendlyMime + " parsing " + entityName); + } + } + } + + setup(function() {}, {explicit_done: true}); + + var xhr = new XMLHttpRequest(); + xhr.open("GET", "/common/entities.json"); + xhr.onload = function () { + var entitiesJSON = JSON.parse(xhr.response); + [ + ["application/xhtml+xml", "-//W3C//DTD XHTML 1.0 Transitional//EN", "foo", "XHTML1.0 Transitional"], + ["application/xhtml+xml", "-//W3C//DTD XHTML 1.1//EN", "foo", "XHTML1.1"], + ["application/xhtml+xml", "-//W3C//DTD XHTML 1.0 Strict//EN", "foo", "XHTML1.0 Strict"], + ["application/xhtml+xml", "-//W3C//DTD XHTML 1.0 Frameset//EN", "foo", "XHTML1.0 Frameset"], + ["application/xhtml+xml", "-//W3C//DTD XHTML Basic 1.0//EN", "foo", "XHTML Basic"], + ["application/xhtml+xml", "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN", "foo", "XHTML1.1+MathML"], + ["application/xhtml+xml", "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN", "foo", "XHTML1.1+MathML+SVG"], + ["application/xhtml+xml", "-//W3C//DTD MathML 2.0//EN", "foo", "MathML"], + ["application/xhtml+xml", "-//WAPFORUM//DTD XHTML Mobile 1.0//EN", "foo", "XHTML Mobile"], +// ["application/xhtml+xml", null, "mathml.dtd", "SYSTEM MathML"], // Experimental + ["text/html", null, null, "HTML"] + ].forEach(function (row) { + setupTests(entitiesJSON, row[1], row[2], row[0], row[3]); + }); + done(); + } + xhr.send(); + +</script> diff --git a/testing/web-platform/tests/html/the-xhtml-syntax/parsing-xhtml-fragments/.gitkeep b/testing/web-platform/tests/html/the-xhtml-syntax/parsing-xhtml-fragments/.gitkeep new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/testing/web-platform/tests/html/the-xhtml-syntax/parsing-xhtml-fragments/.gitkeep diff --git a/testing/web-platform/tests/html/the-xhtml-syntax/serializing-xhtml-fragments/.gitkeep b/testing/web-platform/tests/html/the-xhtml-syntax/serializing-xhtml-fragments/.gitkeep new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/testing/web-platform/tests/html/the-xhtml-syntax/serializing-xhtml-fragments/.gitkeep diff --git a/testing/web-platform/tests/html/the-xhtml-syntax/writing-xhtml-documents/.gitkeep b/testing/web-platform/tests/html/the-xhtml-syntax/writing-xhtml-documents/.gitkeep new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/testing/web-platform/tests/html/the-xhtml-syntax/writing-xhtml-documents/.gitkeep |