Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / repaint / text-match-document-change.html
blob7f83978c15553437f90fd66fa7ef8c47cf963061
1 <!DOCTYPE html>
2 <script src="resources/text-based-repaint.js"></script>
3 <script>
4 function highlightRange(id, start, end) {
5 var frameWindow = document.getElementById('iframe').contentWindow;
6 var range = frameWindow.document.createRange();
7 var elem = frameWindow.document.getElementById(id).firstChild;
8 range.setStart(elem, start);
9 range.setEnd(elem, end);
10 frameWindow.internals.addTextMatchMarker(range, false);
13 function repaintTest() {
14 document.getElementById('iframe').contentDocument.getElementById('to-be-changed').textContent = 'After change';
17 if (window.internals) {
18 onload = function() {
19 highlightRange('unchanged', 11, 17);
20 highlightRange('to-be-changed', 15, 21);
21 runRepaintTest();
24 </script>
25 Tests paint invalidation of the scrollbar (to repaint tickmarks) on document change when there are text match markers.
26 Passes if the tickmarks are updated on document change.<br>
27 <!-- Currently paint invalidation of main frame scrollbar is not tracked,
28 so use a frame to show the invalidation of tickmarks. -->
29 <iframe id="iframe" style="position: absolute; top: 100px; height: 400px" srcdoc="
30 <div id='unchanged'>
31 Unchanged: findme
32 </div>
33 <div id='to-be-changed' onclick='this.textContent=&amp;quot;After change&amp;quot;'>
34 To be changed: findme (Manual testing: Find-in-page 'findme', then click here)
35 </div>
36 <div style='height: 1000px'><!-- To show the scrollbar --></div>">
37 </iframe>