OLD | NEW |
| (Empty) |
1 <!-- Based on compositing/overflow/text-match-highlight.html --> | |
2 <!DOCTYPE HTML> | |
3 <script src="resources/paint-invalidation-test.js"></script> | |
4 <script> | |
5 function highlightRange(id, start, end, active) { | |
6 var range = document.createRange(); | |
7 var elem = document.getElementById(id).firstChild; | |
8 range.setStart(elem, start); | |
9 range.setEnd(elem, end); | |
10 internals.addTextMatchMarker(range, active); | |
11 } | |
12 function paintInvalidationTest() { | |
13 highlightRange('1', 0, 6, false); | |
14 highlightRange('2', 0, 6, false); | |
15 highlightRange('3', 0, 6, false); | |
16 highlightRange('4', 0, 6, false); | |
17 highlightRange('5', 0, 6, false); | |
18 highlightRange('svg1', 8, 14, true); | |
19 highlightRange('svg2', 0, 6, false); | |
20 highlightRange('svg3', 0, 6, false); | |
21 highlightRange('svg3', 26, 32, false); | |
22 internals.setMarkedTextMatchesAreHighlighted(document, true); | |
23 } | |
24 if (window.internals) | |
25 onload = runPaintInvalidationTest; | |
26 </script> | |
27 <style> | |
28 body { margin: 0 } | |
29 </style> | |
30 Based on svg/custom/text-match-highlight.html. Here run it as a repaint test to
check correctness of invalidation.<br> | |
31 Automatic test requires run-layout-test. To manually test, open this file in Chr
ome and find 'findme' in the page.<br> | |
32 There should be 9 highlighted instances of "<span id="1">findme</span>". The 6th
higlighted instance should be active.<br> | |
33 <div style="overflow: scroll; height: 500px"> | |
34 Lorum ipsum <span id="2">findme</span> lorum ipsum <span id="3">findme</span><
span id="4">findme</span> lorum.<br/> | |
35 longtext<span id="5">findme</span>noyou.<br/> | |
36 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xl
ink" width="450" height="300"> | |
37 <defs> | |
38 <path id="textpath" | |
39 d="M 100 200 | |
40 C 200 100 300 0 400 100 | |
41 C 500 200 600 300 700 200 | |
42 C 800 100 900 100 900 100" /> | |
43 </defs> | |
44 <text x="10" y="50" id="svg1">Can you findme in this boring text?</text> | |
45 <text x="10" y="100" style="font-size: 10px; font-family: monospace;" id="sv
g2">Findme in a typewriter!</text> | |
46 <g transform="scale(0.3) translate(0 400)"> | |
47 <text font-family="Verdana" font-size="42.5" fill="blue" > | |
48 <textPath xlink:href="#textpath" id="svg3">Findme on a path! Did you fin
dme?</textPath> | |
49 </text> | |
50 </g> | |
51 </svg> | |
52 <div style="height: 1000px"></div> | |
53 </div> | |
54 | |
OLD | NEW |