Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 | |
| 3 <script src='../../resources/testharness.js'></script> | |
| 4 <script src='../../resources/testharnessreport.js'></script> | |
| 5 <script src='../../editing/assert_selection.js'></script> | |
| 6 <script> | |
| 7 test(function () { | |
| 8 assert_not_equals(window.internals, undefined, | |
| 9 'This test requires internals.'); | |
| 10 assert_selection( | |
| 11 '<div contenteditable="true">^appla| </div>', | |
|
yosin_UTC9
2016/11/14 02:28:17
nit: we don't need to have |="true"|
| |
| 12 selection => { | |
| 13 let document = selection.document; | |
|
yosin_UTC9
2016/11/14 02:28:17
nit: s/let/const/
| |
| 14 let begin = selection.anchorOffset; | |
|
yosin_UTC9
2016/11/14 02:28:17
nit: s/let/const/
nit: s/begin/start/
We usually
| |
| 15 let end = selection.focusOffset; | |
|
yosin_UTC9
2016/11/14 02:28:17
nit: s/let/const/
| |
| 16 assert_false(internals.hasSpellingMarker(document, begin, end)); | |
| 17 internals.setMarker(document, selection.getRangeAt(0), 'Spelling'); | |
| 18 assert_true(internals.hasSpellingMarker(document, begin, end)); | |
| 19 internals.replaceMisspelled(document, 'apple'); | |
| 20 }, | |
| 21 '<div contenteditable="true">apple| </div>' | |
| 22 ); | |
| 23 }, 'test setMarker and replaceMisspelled in internals'); | |
| 24 </script> | |
| OLD | NEW |