1 description('Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=15189">https://bugs.webkit.org/show_bug.cgi?id=15189</a><br>');
3 var handleTextareaOnInputCallCount = 0;
4 var handleDivOnInputCallCount = 0;
5 var successfullyParsed = false;
7 function handleDivOnInput(e) {
9 testFailed('Wrong target');
11 handleDivOnInputCallCount++;
12 shouldBeEqualToString('ta.value', 'x');
16 function handleTextareaOnInput(e) {
17 if (e.target !== ta) {
18 testFailed('Wrong target');
20 handleTextareaOnInputCallCount++;
21 shouldBeEqualToString('ta.value', 'x');
25 var ta = document.getElementById('ta');
26 ta.setAttribute('oninput', 'handleTextareaOnInput(event)');
28 // Change the value before focusing.
33 if (window.eventSender) {
34 eventSender.keyDown('x', []);
35 shouldEvaluateTo('handleTextareaOnInputCallCount', 1);
36 shouldEvaluateTo('handleDivOnInputCallCount', 1);
38 // Change programmatically
39 ta.value = 'programmatically';
41 // Should not have triggered the events.
42 shouldEvaluateTo('handleTextareaOnInputCallCount', 1);
43 shouldEvaluateTo('handleDivOnInputCallCount', 1);