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