Use testRunner instead of layoutTestController in tests still found to be using layou...
[WebKit-https.git] / LayoutTests / fast / forms / input-set-composition-scroll.html
1 <!DOCTYPE html>
2 <p>This tests whether an input field scrolls to the end of the new composition when setComposition is called.</p>
3 <input size="10"/>
4 <pre id="log">
5 </pre>
6 <script>
7 function log(s) {
8     document.getElementById('log').appendChild(document.createTextNode(s + "\n"));
9 }
10
11 if (window.testRunner)
12     window.testRunner.dumpAsText();
13
14 var input = document.querySelector('input');
15 input.focus();
16 textInputController.setComposition('longsinglewordstringcomposition');
17 var maxScrollLeft = input.scrollWidth - input.clientWidth;
18 if (maxScrollLeft - input.scrollLeft < 5)
19     log("SUCCESS: input has scrolled to the end of the composition");
20 else
21     log("FAILED: input has not scrolled to the end of the composition. scrollLeft=" + input.scrollLeft);
22 </script>