| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src=../../resources/testharness.js></script> | 4 <script src="../../resources/testharness.js"></script> |
| 5 <script src=../../resources/testharnessreport.js></script> | 5 <script src="../../resources/testharnessreport.js"></script> |
| 6 <script src=resources/util.js></script> | 6 <script src="../assert_selection.js"></script> |
| 7 <title>Testing moving cursor to a misspelled word</title> | 7 <script src="spellcheck_test.js"></script> |
| 8 </head> | 8 |
| 9 <body> | |
| 10 <div id="src" contenteditable></div> | |
| 11 <script> | 9 <script> |
| 12 var node = document.getElementById('src'); | 10 spellcheck_test( |
| 13 | 11 '<div contenteditable>zz |</div>', |
| 14 var steps = [ | 12 '', |
| 15 function() { | 13 '<div contenteditable>_zz_ </div>', |
| 16 node.focus(); | 14 { |
| 17 document.execCommand('InsertText', false, 'z'); | 15 title: 'Has marker on initially misspelled word.', |
| 18 document.execCommand('InsertText', false, 'z'); | 16 callback: sample => spellcheck_test( |
| 19 document.execCommand('InsertText', false, ' '); | 17 sample, |
| 20 }, | 18 document => { |
| 21 function() { | 19 testRunner.execCommand('DeleteBackward'); |
| 22 testRunner.execCommand('DeleteBackward'); | 20 testRunner.execCommand('DeleteBackward'); |
| 23 testRunner.execCommand('DeleteBackward'); | 21 document.execCommand('InsertText', false, ' '); |
| 24 document.execCommand('InsertText', false, ' '); | 22 }, |
| 25 } | 23 '<div contenteditable>z </div>', |
| 26 ]; | 24 'Blink spellchecks a word again when changing a misspelled word') |
| 27 | 25 }); |
| 28 var assertions = [ | |
| 29 () => assert_true(internals.hasSpellingMarker(document, 0, 2)), | |
| 30 () => assert_false(internals.hasSpellingMarker(document, 0, 1)) | |
| 31 ]; | |
| 32 | |
| 33 runSpellingTest(steps, assertions, 'Blink spellchecks a word again when changing
a misspelled word'); | |
| 34 </script> | 26 </script> |
| 35 </body> | |
| 36 </html> | |
| OLD | NEW |