summaryrefslogtreecommitdiffstats
path: root/layout/style/test/test_parse_eof.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
commit2aa4a82499d4becd2284cdb482213d541b8804dd (patch)
treeb80bf8bf13c3766139fbacc530efd0dd9d54394c /layout/style/test/test_parse_eof.html
parentInitial commit. (diff)
downloadfirefox-2aa4a82499d4becd2284cdb482213d541b8804dd.tar.xz
firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.zip
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/style/test/test_parse_eof.html')
-rw-r--r--layout/style/test/test_parse_eof.html69
1 files changed, 69 insertions, 0 deletions
diff --git a/layout/style/test/test_parse_eof.html b/layout/style/test/test_parse_eof.html
new file mode 100644
index 0000000000..63ef95b980
--- /dev/null
+++ b/layout/style/test/test_parse_eof.html
@@ -0,0 +1,69 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset=utf-8>
+ <title>Test parsing behaviour of backslash just before EOF</title>
+ <link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
+ <meta name="flags" content="">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+
+<style>#a::before { content: "ab\</style>
+<style>#b { background-image: url("ab\</style>
+<style>#c { background-image: url(ab\</style>
+<style>#d { counter-reset: ab\</style>
+
+<style>
+#a-ref::before { content: "ab"; }
+#b-ref { background-image: url("ab"); }
+#c-ref { background-image: url(ab�); }
+#d-ref { counter-reset: ab�; }
+</style>
+
+<div style="display: none">
+ <div id="a"></div>
+ <div id="b"></div>
+ <div id="c"></div>
+ <div id="d"></div>
+
+ <div id="a-ref"></div>
+ <div id="b-ref"></div>
+ <div id="c-ref"></div>
+ <div id="d-ref"></div>
+</div>
+
+<script>
+var a = document.getElementById("a");
+var b = document.getElementById("b");
+var c = document.getElementById("c");
+var d = document.getElementById("d");
+var a_ref = document.getElementById("a-ref");
+var b_ref = document.getElementById("b-ref");
+var c_ref = document.getElementById("c-ref");
+var d_ref = document.getElementById("d-ref");
+
+test(function() {
+ assert_equals(window.getComputedStyle(a, ":before").content,
+ window.getComputedStyle(a_ref, ":before").content);
+}, "test backslash before EOF inside a string");
+
+test(function() {
+ assert_equals(window.getComputedStyle(b).backgroundImage,
+ window.getComputedStyle(b_ref).backgroundImage);
+}, "test backslash before EOF inside a url(\"\")");
+
+test(function() {
+ assert_equals(window.getComputedStyle(c).backgroundImage,
+ window.getComputedStyle(c_ref).backgroundImage);
+}, "test backslash before EOF inside a url()");
+
+test(function() {
+ assert_equals(window.getComputedStyle(d).counterReset,
+ window.getComputedStyle(d_ref).counterReset);
+}, "test backslash before EOF outside a string");
+</script>
+
+</body>
+</html>