| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <div id="warning"> | 2 <div id="warning"> |
| 3 This test requires window.internals. If you use content_shell, | 3 This test requires window.internals. If you use content_shell, |
| 4 "--expose-internals-for-testing" command flag enables it. | 4 "--expose-internals-for-testing" command flag enables it. |
| 5 </div> | 5 </div> |
| 6 <div id="div" contenteditable>You has the right.</div> | 6 <div id="div" contenteditable>You has the right.</div> |
| 7 <script> | 7 <script> |
| 8 // This tests the appearance of the grammar markers rendered by Blink. | 8 // This tests the appearance of the grammar markers rendered by Blink. |
| 9 | 9 |
| 10 const div = document.getElementById('div'); | 10 const div = document.getElementById('div'); |
| 11 const text = div.firstChild; | 11 const text = div.firstChild; |
| 12 | 12 |
| 13 // Mark 'has' with grammar marker. | 13 // Mark 'has' with grammar marker. |
| 14 const range = document.createRange(); | 14 const range = document.createRange(); |
| 15 range.setStart(text, 4); | 15 range.setStart(text, 4); |
| 16 range.setEnd(text, 7); | 16 range.setEnd(text, 7); |
| 17 if (window.internals) { | 17 if (window.internals) { |
| 18 document.getElementById('warning').style.display = 'none'; | 18 document.getElementById('warning').style.display = 'none'; |
| 19 internals.setMarker(document, range, 'grammar'); | 19 internals.setMarker(document, range, 'grammar'); |
| 20 } | 20 } |
| 21 </script> | 21 </script> |
| OLD | NEW |