OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <ol contenteditable> | 2 <ol contenteditable> |
3 <li>Press enter | 3 <li>Press enter |
4 </ol> | 4 </ol> |
5 <p>Then click here</p> | 5 <p>Then click here</p> |
6 <script> | 6 <script> |
7 if (window.testRunner) { | 7 if (window.testRunner) { |
8 testRunner.dumpAsText(); | 8 testRunner.dumpAsText(); |
9 testRunner.waitUntilDone(); | 9 testRunner.waitUntilDone(); |
10 } | 10 } |
11 | 11 |
12 var list = document.querySelector('ol'); | 12 var list = document.querySelector('ol'); |
13 var p = document.querySelector('p'); | 13 var p = document.querySelector('p'); |
14 var observerRuns = 0; | 14 var observerRuns = 0; |
15 var observer = new WebKitMutationObserver(function() { ++observerRuns; }); | 15 var observer = new MutationObserver(function() { ++observerRuns; }); |
16 observer.observe(list, {childList: true}); | 16 observer.observe(list, {childList: true}); |
17 list.addEventListener('blur', function() { | 17 list.addEventListener('blur', function() { |
18 document.body.innerHTML = observerRuns == 1 ? 'PASSED' : 'FAILED'; | 18 document.body.innerHTML = observerRuns == 1 ? 'PASSED' : 'FAILED'; |
19 if (window.testRunner) | 19 if (window.testRunner) |
20 testRunner.notifyDone(); | 20 testRunner.notifyDone(); |
21 }); | 21 }); |
22 list.focus(); | 22 list.focus(); |
23 if (window.eventSender) { | 23 if (window.eventSender) { |
24 eventSender.scheduleAsynchronousKeyDown('\n'); | 24 eventSender.scheduleAsynchronousKeyDown('\n'); |
25 eventSender.mouseMoveTo(p.offsetLeft + p.offsetWidth / 2, p.offsetTop +
p.offsetHeight / 2); | 25 eventSender.mouseMoveTo(p.offsetLeft + p.offsetWidth / 2, p.offsetTop +
p.offsetHeight / 2); |
26 eventSender.scheduleAsynchronousClick(); | 26 eventSender.scheduleAsynchronousClick(); |
27 } | 27 } |
28 </script> | 28 </script> |
OLD | NEW |