summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/syntax/parsing/ambiguous-ampersand.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/html/syntax/parsing/ambiguous-ampersand.html
parentInitial commit. (diff)
downloadfirefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz
firefox-43a97878ce14b72f0981164f87f2e35e14151312.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/tests/html/syntax/parsing/ambiguous-ampersand.html')
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/ambiguous-ampersand.html36
1 files changed, 36 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/syntax/parsing/ambiguous-ampersand.html b/testing/web-platform/tests/html/syntax/parsing/ambiguous-ampersand.html
new file mode 100644
index 0000000000..e6d5a82215
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/ambiguous-ampersand.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<meta charset="UTF-8">
+<title>Ambiguous ampersand</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div><a href='?a=b&c=d&a0b=c&copy=1&noti=n&not=in&notin=&notin;&not;&;& &'>Link</a><p>Text: ?a=b&c=d&a0b=c&copy=1&noti=n&not=in&notin=&notin;&not;&;& &</p></div>
+<script>
+var markup = "<div><a href='?a=b&c=d&a0b=c&copy=1&noti=n&not=in&notin=&notin;&not;&;& &'>Link</a><p>Text: ?a=b&c=d&a0b=c&copy=1&noti=n&not=in&notin=&notin;&not;&;& &</p></div>";
+
+for (var i = 0; i < markup.length; ++i) {
+ document.write(markup.charAt(i));
+}
+</script>
+
+<script>
+function checkDiv(div, provenance) {
+ test(function() {
+ assert_equals(div.childNodes.length, 2, "Number of elements " + provenance);
+ let a = div.firstChild;
+ let href = a.href;
+ let question = href.indexOf('?');
+ href = href.substring(question);
+ assert_equals(href, "?a=b&c=d&a0b=c&copy=1&noti=n&not=in&notin=%E2%88%89%C2%AC&;&%20&", "attribute " + provenance);
+ let p = a.nextSibling;
+ assert_equals(p.textContent, "Text: ?a=b&c=d&a0b=c©=1¬i=n¬=in¬in=∉¬&;& &", "text " + provenance)
+ }, "Check div structure: " + provenance);
+}
+
+
+let divs = document.getElementsByTagName("div");
+test(function() {
+ assert_equals(divs.length, 2);
+}, "Check number of divs");
+checkDiv(divs[0], "network");
+checkDiv(divs[1], "document.write");
+</script>