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/tests/html/syntax/serializing-html-fragments/initial-linefeed-pre.html | |
parent | Initial commit. (diff) | |
download | firefox-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/serializing-html-fragments/initial-linefeed-pre.html')
-rw-r--r-- | testing/web-platform/tests/html/syntax/serializing-html-fragments/initial-linefeed-pre.html | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/syntax/serializing-html-fragments/initial-linefeed-pre.html b/testing/web-platform/tests/html/syntax/serializing-html-fragments/initial-linefeed-pre.html new file mode 100644 index 0000000000..d4e30bb60d --- /dev/null +++ b/testing/web-platform/tests/html/syntax/serializing-html-fragments/initial-linefeed-pre.html @@ -0,0 +1,48 @@ +<!doctype html> +<title>innerHTML getter for pre/textarea/listing with initial LF</title> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> +<div id="outer"> +<div id="inner"> +<pre id="pre1"> +x</pre> +<pre id="pre2"> + +x</pre> +<textarea id="textarea1"> +x</textarea> +<textarea id="textarea2"> + +x</textarea> +<listing id="listing1"> +x</listing> +<listing id="listing2"> + +x</listing> +</div> +</div> + +<script> +var expected_outer = '\n<div id="inner">\n<pre id="pre1">x</pre>\n<pre id="pre2">\nx</pre>\n<textarea id="textarea1">x</textarea>\n<textarea id="textarea2">\nx</textarea>\n<listing id="listing1">x</listing>\n<listing id="listing2">\nx</listing>\n</div>\n'; +var expected_inner = expected_outer.replace('\n<div id="inner">', '').replace('</div>\n', ''); +var expected_1 = 'x'; +var expected_2 = '\nx'; + +test(function() { + assert_equals(outer.innerHTML, expected_outer); +}, 'outer div'); + +test(function() { + assert_equals(inner.innerHTML, expected_inner); +}, 'inner div'); + +['pre', 'textarea', 'listing'].forEach(function(tag) { + test(function() { + assert_equals(document.getElementById(tag + '1').innerHTML, expected_1); + }, tag + '1'); + + test(function() { + assert_equals(document.getElementById(tag + '2').innerHTML, expected_2); + }, tag + '2'); +}); +</script> |