diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /dom/tests/mochitest/webcomponents/test_shadowdom_ime.html | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/tests/mochitest/webcomponents/test_shadowdom_ime.html')
-rw-r--r-- | dom/tests/mochitest/webcomponents/test_shadowdom_ime.html | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/dom/tests/mochitest/webcomponents/test_shadowdom_ime.html b/dom/tests/mochitest/webcomponents/test_shadowdom_ime.html new file mode 100644 index 0000000000..e023ff04a2 --- /dev/null +++ b/dom/tests/mochitest/webcomponents/test_shadowdom_ime.html @@ -0,0 +1,59 @@ +<!DOCTYPE HTML> +<html> +<!-- +https://bugzilla.mozilla.org/show_bug.cgi?id=1553852 +--> +<head> + <title>Test for Bug 1429982</title> + <script src="/tests/SimpleTest/SimpleTest.js"></script> + <script src="/tests/SimpleTest/EventUtils.js"></script> + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> +</head> +<body> +<a target="_blank" + href="https://bugzilla.mozilla.org/show_bug.cgi?id=1553852">Mozilla Bug 1553852</a> +<p id="display"></p> +<div id="content"> + <div id="host"></div> +</div> +<pre id="test"> +<script class="testbody" type="text/javascript"> + +/** Test for Bug 1553852 **/ +SimpleTest.waitForExplicitFinish() +SimpleTest.waitForFocus(function() { + let div = document.createElement('div'); + div.setAttribute('contenteditable', 'true'); + + let shadow = document.getElementById('host').attachShadow({mode: 'open'}); + shadow.appendChild(div); + div.focus(); + + let testString = '\uD842\uDFB7\u91CE\u5BB6'; + synthesizeCompositionChange( + { "composition": + { "string": testString, + "clauses": + [ + { "length": testString.length, "attr": COMPOSITION_ATTR_RAW_CLAUSE }, + ], + }, + "caret": { "start": testString.length, "length": 0 }, + }); + is(div.innerText, testString, + "The value of contenteditable div should be " + testString + + " during composition"); + + synthesizeComposition({ type: "compositioncommitasis" }); + is(div.innerText, testString, + "The value of contenteditable div should be " + testString + + " after compositionend"); + + SimpleTest.finish(); +}); + +</script> +</pre> +</body> +</html> + |