diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/mozilla/tests/html/syntax | |
parent | Initial commit. (diff) | |
download | firefox-upstream.tar.xz firefox-upstream.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/mozilla/tests/html/syntax')
10 files changed, 146 insertions, 0 deletions
diff --git a/testing/web-platform/mozilla/tests/html/syntax/charset/README.md b/testing/web-platform/mozilla/tests/html/syntax/charset/README.md new file mode 100644 index 0000000000..0558ae1cd5 --- /dev/null +++ b/testing/web-platform/mozilla/tests/html/syntax/charset/README.md @@ -0,0 +1,7 @@ +The tests in this directory intentionally differ from WebKit and Blink. + +These are case where using the real tree builder (with `noscript`) parsing +as in the scripting enabled mode and with CDATA sections parsing with +awareness of foreign content differs from WebKit's and Blink's behavior +that works as if there was a pre-foreign content, pre-template tree builder +running in the scripting disabled mode. diff --git a/testing/web-platform/mozilla/tests/html/syntax/charset/in-noscript-after-template.html b/testing/web-platform/mozilla/tests/html/syntax/charset/in-noscript-after-template.html new file mode 100644 index 0000000000..71ef9144e0 --- /dev/null +++ b/testing/web-platform/mozilla/tests/html/syntax/charset/in-noscript-after-template.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<head> +<link rel="mismatch" href="references/in-noscript-after-template-ref.html"> +<noscript><template></template><meta charset="windows-1251"></noscript> +</head> +<body> +<p>Meta in <code>noscript</code> after <code>template</code> (which is also inside the <code>noscript</code>).</p> +<p>Test: æ</p> +<p>If ж, meta takes effect</p> +</body> diff --git a/testing/web-platform/mozilla/tests/html/syntax/charset/in-noscript-ncr.html b/testing/web-platform/mozilla/tests/html/syntax/charset/in-noscript-ncr.html new file mode 100644 index 0000000000..645f151b26 --- /dev/null +++ b/testing/web-platform/mozilla/tests/html/syntax/charset/in-noscript-ncr.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<head> +<link rel="mismatch" href="references/in-noscript-ncr-ref.html"> +<noscript><meta charset="windows-1251"></noscript> +</head> +<body> +<p>Meta with NCR in the encoding label in <code>noscript</code>.</p> +<p>Test: æ</p> +<p>If ж, meta takes effect</p> +</body> diff --git a/testing/web-platform/mozilla/tests/html/syntax/charset/in-noscript.html b/testing/web-platform/mozilla/tests/html/syntax/charset/in-noscript.html new file mode 100644 index 0000000000..e76054d618 --- /dev/null +++ b/testing/web-platform/mozilla/tests/html/syntax/charset/in-noscript.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<head> +<link rel="mismatch" href="references/in-noscript-ref.html"> +<noscript><meta charset="windows-1251"></noscript> +</head> +<body> +<p>Meta in <code>noscript</code>.</p> +<p>Test: æ</p> +<p>If ж, meta takes effect</p> +</body> diff --git a/testing/web-platform/mozilla/tests/html/syntax/charset/in-svg-in-cdata-after-gt.html b/testing/web-platform/mozilla/tests/html/syntax/charset/in-svg-in-cdata-after-gt.html new file mode 100644 index 0000000000..56783b7afc --- /dev/null +++ b/testing/web-platform/mozilla/tests/html/syntax/charset/in-svg-in-cdata-after-gt.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<head> +<link rel="mismatch" href="references/in-svg-in-cdata-after-gt-ref.html"> +</head> +<body> +<svg><![CDATA[><meta charset="windows-1251">]]></svg> +<p>In SVG in CDATA after greater-than sign in the CDATA (after head).</p> +<p>Test: æ</p> +<p>If ж, meta takes effect</p> +</body> diff --git a/testing/web-platform/mozilla/tests/html/syntax/charset/references/in-noscript-after-template-ref.html b/testing/web-platform/mozilla/tests/html/syntax/charset/references/in-noscript-after-template-ref.html new file mode 100644 index 0000000000..27defe54c0 --- /dev/null +++ b/testing/web-platform/mozilla/tests/html/syntax/charset/references/in-noscript-after-template-ref.html @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<head> +<meta charset="utf-8"> +</head> +<body> +<p>Meta in <code>noscript</code> after <code>template</code> (which is also inside the <code>noscript</code>).</p> +<p>Test: ж</p> +<p>If ж, meta takes effect</p> +</body> diff --git a/testing/web-platform/mozilla/tests/html/syntax/charset/references/in-noscript-ncr-ref.html b/testing/web-platform/mozilla/tests/html/syntax/charset/references/in-noscript-ncr-ref.html new file mode 100644 index 0000000000..3581ab68db --- /dev/null +++ b/testing/web-platform/mozilla/tests/html/syntax/charset/references/in-noscript-ncr-ref.html @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<head> +<meta charset="utf-8"> +</head> +<body> +<p>Meta with NCR in the encoding label in <code>noscript</code>.</p> +<p>Test: ж</p> +<p>If ж, meta takes effect</p> +</body> diff --git a/testing/web-platform/mozilla/tests/html/syntax/charset/references/in-noscript-ref.html b/testing/web-platform/mozilla/tests/html/syntax/charset/references/in-noscript-ref.html new file mode 100644 index 0000000000..9bb9f24b88 --- /dev/null +++ b/testing/web-platform/mozilla/tests/html/syntax/charset/references/in-noscript-ref.html @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<head> +<meta charset="utf-8"> +</head> +<body> +<p>Meta in <code>noscript</code>.</p> +<p>Test: ж</p> +<p>If ж, meta takes effect</p> +</body> diff --git a/testing/web-platform/mozilla/tests/html/syntax/charset/references/in-svg-in-cdata-after-gt-ref.html b/testing/web-platform/mozilla/tests/html/syntax/charset/references/in-svg-in-cdata-after-gt-ref.html new file mode 100644 index 0000000000..2868f47fc2 --- /dev/null +++ b/testing/web-platform/mozilla/tests/html/syntax/charset/references/in-svg-in-cdata-after-gt-ref.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<head> +<meta charset="utf-8"> +</head> +<body> +<svg></svg> +<p>In SVG in CDATA after greater-than sign in the CDATA (after head).</p> +<p>Test: ж</p> +<p>If ж, meta takes effect</p> +</body> diff --git a/testing/web-platform/mozilla/tests/html/syntax/parsing/math-parse01.html b/testing/web-platform/mozilla/tests/html/syntax/parsing/math-parse01.html new file mode 100644 index 0000000000..3aff716d9f --- /dev/null +++ b/testing/web-platform/mozilla/tests/html/syntax/parsing/math-parse01.html @@ -0,0 +1,62 @@ +<!DOCTYPE html> +<html> +<head> +<title>math in html: parsing</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +</head> +<body> +<h1>math in html: parsing</h1> + +<div id="log" style="display:block"></div> + +<div style="display:none"> +<div><math id="m1"><mtext/></math></div> +<div id="d1"><math><mrow/><mi/></math></div> +<div id="d2"><math><mrow><mrow><mn>1</mn></mrow><mi>a</mi></mrow></math></div> +<div id="d3">⟨⟩</div> +<div id="d4">𝕂</div> +<div id="d5"><math><semantics><mi>a</mi><annotation-xml><foo/><bar/></annotation-xml></semantics></math></div> +<div id="d6"><math><semantics><mi>a</mi><annotation-xml encoding="text/html"><div></div></annotation-xml></semantics><mn/></math> +</div> + + +<script> + +test(function() { +assert_equals(document.getElementById("m1"),document.getElementsByTagName("math")[0]); +},"The id attribute should be recognised on math elements"); + +test(function() { +assert_equals(document.getElementById("d1").firstChild.nodeName,"math") +},"The node name should be math"); + +test(function() { +assert_equals(document.getElementById("d1").firstChild.namespaceURI ,"http://www.w3.org/1998/Math/MathML") +},"math should be in MathML Namespace"); + +test(function() { +assert_equals(document.getElementById("d1").firstChild.childNodes.length ,2) +},"Math has 2 children (empty tag syntax)"); + +test(function() { +assert_equals(document.getElementById("d2").firstChild.childNodes.length ,1) +},"Nested mrow elements should be parsed correctly"); + +test(function() { +assert_equals(document.getElementById("d3").firstChild.nodeValue ,"\u27E8\u27E9") +},"Testing rang and lang entity code points"); + +test(function() { +assert_equals(document.getElementById("d4").firstChild.nodeValue ,"\uD835\uDD42") +},"Testing Kopf (Plane 1) entity code point"); + +test(function() { +assert_equals(document.getElementById("d5").firstChild.firstChild.childNodes[1].childNodes.length ,2) +},"Empty element tags in annotation-xml parsed as per XML."); + +test(function() { +assert_equals(document.getElementById("d6").firstChild.childNodes.length ,2) +},"html tags allowed in annotation-xml/@encoding='text/html'."); + +</script> |