| 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 jsTestIsAsync = true; | 8 jsTestIsAsync = true; |
| 9 if (window.testRunner) { | 9 if (window.testRunner) { |
| 10 testRunner.setBackingScaleFactor( | 10 testRunner.setBackingScaleFactor( |
| 11 2, | 11 2, |
| 12 () => setTimeout(() => testRunner.notifyDone(), 0)); | 12 () => setTimeout(() => testRunner.notifyDone(), 0)); |
| 13 } | 13 } |
| 14 | 14 |
| 15 // This tests the appearance of the grammar markers rendered by Blink. | 15 // This tests the appearance of the grammar markers rendered by Blink. |
| 16 | 16 |
| 17 const div = document.getElementById('div'); | 17 const div = document.getElementById('div'); |
| 18 const text = div.firstChild; | 18 const text = div.firstChild; |
| 19 | 19 |
| 20 // Mark 'has' with grammar marker. | 20 // Mark 'has' with grammar marker. |
| 21 const range = document.createRange(); | 21 const range = document.createRange(); |
| 22 range.setStart(text, 4); | 22 range.setStart(text, 4); |
| 23 range.setEnd(text, 7); | 23 range.setEnd(text, 7); |
| 24 if (window.internals) { | 24 if (window.internals) { |
| 25 document.getElementById('warning').style.display = 'none'; | 25 document.getElementById('warning').style.display = 'none'; |
| 26 internals.setMarker(document, range, 'grammar'); | 26 internals.setMarker(document, range, 'grammar'); |
| 27 } | 27 } |
| 28 </script> | 28 </script> |
| OLD | NEW |