Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <script src="../../resources/testharness.js"></script> | 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> | 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <script src="../assert_selection.js"></script> | 4 <script src="../assert_selection.js"></script> |
| 5 <script src="spellcheck_test.js"></script> | 5 <script src="spellcheck_test.js"></script> |
| 6 | 6 |
| 7 <script> | 7 <script> |
| 8 // This file shows sample usage of spellcheck_test.js | 8 // This file shows sample usage of spellcheck_test.js |
| 9 | 9 |
| 10 spellcheck_test( | 10 spellcheck_test( |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 37 | 37 |
| 38 spellcheck_test( | 38 spellcheck_test( |
| 39 '<input type="text">|', | 39 '<input type="text">|', |
| 40 document => { | 40 document => { |
| 41 document.querySelector('input').focus(); | 41 document.querySelector('input').focus(); |
| 42 document.execCommand('insertText', false, 'asd.'); | 42 document.execCommand('insertText', false, 'asd.'); |
| 43 }, | 43 }, |
| 44 '<input type="text" value="_asd_.">', | 44 '<input type="text" value="_asd_.">', |
| 45 'Mark misspellings in <input>.'); | 45 'Mark misspellings in <input>.'); |
| 46 | 46 |
| 47 spellcheck_test( | |
| 48 '<div contenteditable spellcheck="false">zz.|</div>', | |
| 49 '', | |
| 50 '<div contenteditable spellcheck="false">zz.</div>', | |
| 51 { | |
| 52 title: 'No marker on misspelled word when spellcheck=false.', | |
| 53 callback: sample => spellcheck_test( | |
| 54 sample, | |
| 55 document => { | |
| 56 var div = document.querySelector('div'); | |
|
yosin_UTC9
2016/10/26 07:50:20
nit: s/var/const/
Xiaocheng
2016/10/26 08:01:17
Done.
| |
| 57 div.setAttribute('spellcheck', 'true'); | |
| 58 // Trigger spellchecker by selection change. | |
| 59 document.getSelection().collapse(div, 0); | |
| 60 }, | |
| 61 '<div contenteditable spellcheck="true">_zz_.</div>', | |
| 62 'Marker appears after setting spellcheck=true.' | |
| 63 ) | |
| 64 }); | |
| 65 | |
| 47 // TODO(xiaochengh): Design interface for checking marker description. | 66 // TODO(xiaochengh): Design interface for checking marker description. |
| 48 </script> | 67 </script> |
| OLD | NEW |