| <!DOCTYPE html> |
| <script src="../../resources/run-after-layout-and-paint.js"></script> |
| <style> |
| div { |
| width: 100px; |
| height: 20px; |
| font: 12px; |
| overflow: hidden; |
| white-space: pre; |
| text-overflow: ellipsis; |
| direction: rtl; |
| } |
| </style> |
| |
| <div id="markAllComposition">אבגדהוזחטיכךלמםסעפףצץקרשת</div> |
| <div id="markStartComposition">אבגדהוזחטיכךלמםסעפףצץקרשת</div> |
| <div id="markEndComposition">אבגדהוזחטיכךלמםסעפףצץקרשת</div> |
| |
| <div id="markAllSpelling">אבגדהוזחטיכךלמםסעפףצץקרשת</div> |
| <div id="markStartSpelling">אבגדהוזחטיכךלמםסעפףצץקרשת</div> |
| <div id="markEndSpelling">אבגדהוזחטיכךלמםסעפףצץקרשת</div> |
| |
| <div id="markAllTextMatch">אבגדהוזחטיכךלמםסעפףצץקרשת</div> |
| <div id="markStartTextMatch">אבגדהוזחטיכךלמםסעפףצץקרשת</div> |
| <div id="markEndTextMatch">אבגדהוזחטיכךלמםסעפףצץקרשת</div> |
| |
| <script> |
| function addCompositionMarker(elem, start, end) { |
| const range = document.createRange(); |
| const textNode = elem.firstChild; |
| range.setStart(textNode, start); |
| range.setEnd(textNode, end); |
| if (typeof internals !== 'undefined') |
| internals.addCompositionMarker(range, 'orange', 'thin', 'lightBlue'); |
| }; |
| |
| function addSpellingMarker(elem, start, end) { |
| const range = document.createRange(); |
| const textNode = elem.firstChild; |
| range.setStart(textNode, start); |
| range.setEnd(textNode, end); |
| if (typeof internals !== 'undefined') |
| internals.setMarker(document, range, 'spelling'); |
| }; |
| |
| function addTextMatchMarker(elem, start, end) { |
| const range = document.createRange(); |
| const textNode = elem.firstChild; |
| range.setStart(textNode, start); |
| range.setEnd(textNode, end); |
| if (typeof internals !== 'undefined') { |
| internals.addTextMatchMarker(range, 'kActive'); |
| internals.setMarkedTextMatchesAreHighlighted(document, true); |
| } |
| }; |
| |
| onload = runAfterLayoutAndPaint(function() { |
| addCompositionMarker(markAllComposition, 0, 25); |
| addCompositionMarker(markStartComposition, 0, 20); |
| addCompositionMarker(markEndComposition, 5, 25); |
| |
| addSpellingMarker(markAllSpelling, 0, 25); |
| addSpellingMarker(markStartSpelling, 0, 20); |
| addSpellingMarker(markEndSpelling, 5, 25); |
| |
| addTextMatchMarker(markAllTextMatch, 0, 25); |
| addTextMatchMarker(markStartTextMatch, 0, 20); |
| addTextMatchMarker(markEndTextMatch, 5, 25); |
| }, true); |
| </script> |