OLD | NEW |
1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
2 <script> | 2 <script> |
3 function highlightRange(id, start, end, active) { | 3 function highlightRange(id, start, end, active) { |
4 var range = document.createRange(); | 4 var range = document.createRange(); |
5 var elem = document.getElementById(id).firstChild; | 5 var elem = document.getElementById(id).firstChild; |
6 range.setStart(elem, start); | 6 range.setStart(elem, start); |
7 range.setEnd(elem, end); | 7 range.setEnd(elem, end); |
8 window.internals.addTextMatchMarker(range, active); | 8 window.internals.addTextMatchMarker(range, active); |
9 window.internals.setMarkedTextMatchesAreHighlighted(document, true); | 9 window.internals.setMarkedTextMatchesAreHighlighted(document, true); |
10 } | 10 } |
11 function highlightTest() { | 11 function highlightTest() { |
12 highlightRange('1', 2, 5, true); | 12 highlightRange('1', 2, 5, 'kActive'); |
13 } | 13 } |
14 </script> | 14 </script> |
15 | 15 |
16 <body onload="highlightTest()"> | 16 <body onload="highlightTest()"> |
17 Test for crbug.com/504712 | 17 Test for crbug.com/504712 |
18 <p>Find In Page: The below transparent text "ndM" from findMe should be highligh
ted as orange and painted as black</p> | 18 <p>Find In Page: The below transparent text "ndM" from findMe should be highligh
ted as orange and painted as black</p> |
19 <span id="1" style="color:transparent">findMe</span> | 19 <span id="1" style="color:transparent">findMe</span> |
20 </body> | 20 </body> |
OLD | NEW |