| Index: third_party/WebKit/LayoutTests/imported/wpt/html/the-xhtml-syntax/parsing-xhtml-documents/xhtml-mathml-dtd-entity-support.htm
|
| diff --git a/third_party/WebKit/LayoutTests/imported/wpt/html/the-xhtml-syntax/parsing-xhtml-documents/xhtml-mathml-dtd-entity-support.htm b/third_party/WebKit/LayoutTests/imported/wpt/html/the-xhtml-syntax/parsing-xhtml-documents/xhtml-mathml-dtd-entity-support.htm
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..4494f7f3c820de009b059138ea7dea4ddd50744b
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/imported/wpt/html/the-xhtml-syntax/parsing-xhtml-documents/xhtml-mathml-dtd-entity-support.htm
|
| @@ -0,0 +1,62 @@
|
| +<!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, doctypeMarkupString, mimeType, friendlyMime) {
|
| + return function () {
|
| + var doc = parse(doctypeMarkupString + "<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, doctypeMarkupString, mimeType, friendlyMime) {
|
| + for (entityName in jsonEntities) {
|
| + if ((mimeType == "text/html") || /;$/.test(entityName)) {
|
| + test(generateTestFunction(entityName, jsonEntities[entityName].characters, doctypeMarkupString, mimeType, friendlyMime), friendlyMime + " parsing " + entityName);
|
| + }
|
| + }
|
| + }
|
| +
|
| + setup(function() {}, {explicit_done: true});
|
| +
|
| + var xhr = new XMLHttpRequest();
|
| + //xhr.open("GET", "entities.json");
|
| + xhr.open("GET", "https://w3c.github.io/html/entities.json");
|
| + xhr.onload = function () {
|
| + // Note: for proper XML parsing of the Doctype, Edge requires a non-empty string for url part
|
| + var entitiesJSON = JSON.parse(xhr.response);
|
| + [
|
| + ["application/xhtml+xml", "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"foo\">", "XHTML1.0 Transitional"],
|
| + ["application/xhtml+xml", "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"foo\">", "XHTML1.1"],
|
| + ["application/xhtml+xml", "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"foo\">", "XHTML1.0 Strict"],
|
| + ["application/xhtml+xml", "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\" \"foo\">", "XHTML1.0 Frameset"],
|
| + ["application/xhtml+xml", "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML Basic 1.0//EN\" \"foo\">", "XHTML Basic"],
|
| + ["application/xhtml+xml", "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN\" \"foo\">", "XHTML1.1+MathML"],
|
| + ["application/xhtml+xml", "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN\" \"foo\">", "XHTML1.1+MathML+SVG"],
|
| + ["application/xhtml+xml", "<!DOCTYPE html PUBLIC \"-//W3C//DTD MathML 2.0//EN\" \"foo\">", "MathML"],
|
| + ["application/xhtml+xml", "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"foo\">", "XHTML Mobile"],
|
| +// ["application/xhtml+xml", "<!DOCTYPE html SYSTEM \"mathml.dtd\">", "SYSTEM MathML"], // Experimental
|
| + ["text/html", "<!DOCTYPE html>", "HTML"]
|
| + ].forEach(function (row) {
|
| + setupTests(entitiesJSON, row[1], row[0], row[2]);
|
| + });
|
| + done();
|
| + }
|
| + xhr.send();
|
| +
|
| +</script>
|
|
|