Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
<!DOCTYPE HTML>
<html>
<!--
-->
<head>
<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"
<p id="display"></p>
<div id="content">
<div id="host"></div>
</div>
<pre id="test">
<script class="testbody" type="text/javascript">
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>