Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: third_party/WebKit/LayoutTests/paint/invalidation/compositing/text-match-highlight.html

Issue 2802543002: Update window.internals.addTextMatchMarker() to take enum instead of bool (Closed)
Patch Set: Fix one more test, add k prefix Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <script src="../resources/text-based-repaint.js"></script> 2 <script src="../resources/text-based-repaint.js"></script>
3 <script> 3 <script>
4 function highlightRange(id, start, end, active) { 4 function highlightRange(id, start, end, active) {
5 var range = document.createRange(); 5 var range = document.createRange();
6 var elem = document.getElementById(id).firstChild; 6 var elem = document.getElementById(id).firstChild;
7 range.setStart(elem, start); 7 range.setStart(elem, start);
8 range.setEnd(elem, end); 8 range.setEnd(elem, end);
9 internals.addTextMatchMarker(range, active); 9 internals.addTextMatchMarker(range, active);
10 } 10 }
11 function repaintTest() { 11 function repaintTest() {
12 highlightRange('1', 0, 6, false); 12 highlightRange('1', 0, 6, 'kInactive');
13 highlightRange('2', 0, 6, false); 13 highlightRange('2', 0, 6, 'kInactive');
14 highlightRange('3', 0, 6, false); 14 highlightRange('3', 0, 6, 'kInactive');
15 highlightRange('4', 0, 6, false); 15 highlightRange('4', 0, 6, 'kInactive');
16 highlightRange('5', 0, 6, false); 16 highlightRange('5', 0, 6, 'kInactive');
17 highlightRange('svg1', 8, 14, true); 17 highlightRange('svg1', 8, 14, 'kActive');
18 highlightRange('svg2', 0, 6, false); 18 highlightRange('svg2', 0, 6, 'kInactive');
19 highlightRange('svg3', 0, 6, false); 19 highlightRange('svg3', 0, 6, 'kInactive');
20 highlightRange('svg3', 26, 32, false); 20 highlightRange('svg3', 26, 32, 'kInactive');
21 internals.setMarkedTextMatchesAreHighlighted(document, true); 21 internals.setMarkedTextMatchesAreHighlighted(document, true);
22 } 22 }
23 if (window.internals) 23 if (window.internals)
24 onload = runRepaintAndPixelTest; 24 onload = runRepaintAndPixelTest;
25 </script> 25 </script>
26 <style> 26 <style>
27 body { margin: 0 } 27 body { margin: 0 }
28 </style> 28 </style>
29 Based on svg/custom/text-match-highlight.html. Here run it as a repaint test to check correctness of invalidation.<br> 29 Based on svg/custom/text-match-highlight.html. Here run it as a repaint test to check correctness of invalidation.<br>
30 Automatic test requires run-layout-test. To manually test, open this file in Chr ome and find 'findme' in the page.<br> 30 Automatic test requires run-layout-test. To manually test, open this file in Chr ome and find 'findme' in the page.<br>
(...skipping 12 matching lines...) Expand all
43 <text x="10" y="50" id="svg1">Can you findme in this boring text?</text> 43 <text x="10" y="50" id="svg1">Can you findme in this boring text?</text>
44 <text x="10" y="100" style="font-size: 10px; font-family: monospace;" id="sv g2">Findme in a typewriter!</text> 44 <text x="10" y="100" style="font-size: 10px; font-family: monospace;" id="sv g2">Findme in a typewriter!</text>
45 <g transform="scale(0.3) translate(0 400)"> 45 <g transform="scale(0.3) translate(0 400)">
46 <text font-family="Verdana" font-size="42.5" fill="blue" > 46 <text font-family="Verdana" font-size="42.5" fill="blue" >
47 <textPath xlink:href="#textpath" id="svg3">Findme on a path! Did you fin dme?</textPath> 47 <textPath xlink:href="#textpath" id="svg3">Findme on a path! Did you fin dme?</textPath>
48 </text> 48 </text>
49 </g> 49 </g>
50 </svg> 50 </svg>
51 <div style="height: 1000px"></div> 51 <div style="height: 1000px"></div>
52 </div> 52 </div>
53
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698