OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../resources/ahem.js"></script> |
| 3 <script src="../../resources/run-after-layout-and-paint.js"></script> |
| 4 <pre id="demo" style="font-family: Ahem; width: 2em; white-space: pre-wrap">a b
</pre> |
| 5 <p>Test for crbug.com/521047. Passes if find-in-page marker highlight is visible
in both lines above. |
| 6 <script> |
| 7 function highlightRange(id, start, end, active) { |
| 8 var range = document.createRange(); |
| 9 var elem = document.getElementById(id).firstChild; |
| 10 range.setStart(elem, start); |
| 11 range.setEnd(elem, end); |
| 12 if (window.internals) { |
| 13 window.internals.addTextMatchMarker(range, active); |
| 14 window.internals.setMarkedTextMatchesAreHighlighted(document, true); |
| 15 } |
| 16 } |
| 17 |
| 18 runAfterLayoutAndPaint(function() { |
| 19 highlightRange('demo', 0, 4, true); |
| 20 }, true); |
| 21 </script> |
OLD | NEW |