3 <script src=
"../../resources/run-after-layout-and-paint.js"></script>
5 function check(expect
, actual
) {
6 var console
= document
.getElementById('console');
7 var div
= document
.createElement('div');
8 div
.innerHTML
= expect
== actual
? 'PASS' : 'FAIL';
9 div
.innerHTML
+= ' expects = "' + expect
+ '", actual = "' + actual
+ '"';
10 console
.appendChild(div
);
14 if (!window
.testRunner
)
16 testRunner
.dumpAsText();
17 testRunner
.waitUntilDone();
18 var textarea
= document
.getElementById('textarea');
19 var consoleElement
= document
.getElementById('console');
20 textarea
.addEventListener('keydown', function (e
) {
21 textarea
.style
['overflow'] = 'hidden';
23 runAfterLayoutAndPaint(function() {
25 if (textInputController
.setComposition
) {
26 // Emulates start input method conversion.
27 textInputController
.setComposition('first');
28 // Then, emulates change of the composition text of the input method.
29 textInputController
.setComposition('second');
30 // Checks whether the textarea does not contain the first composition.
31 check('second', textarea
.value
);
33 testRunner
.notifyDone();
38 <body onload=
"doTest()">
39 <p>This page ensures that the composition text of an input method does not insert into the textarea when the composition text is updated but is not committed. The bug, reported in
<a href=
"https://bugs.webkit.org/show_bug.cgi?id=46868">the issue
46868</a>, should not occur here. When DRT tests this page, it will emulate changing composition text from
"first" to
"second". After that, the value of the textarea should be
"second" and should not be
"secondfirst".
</p>
40 <p>For manual test, input text into the following textarea by using an input method. The composition text which is not committed should not be inserted into the textarea.
</p>
41 <textarea id=
"textarea"></textarea>
42 <div id=
"console"></div>