2 <script src=
"resources/text-based-repaint.js"></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
) {
19 highlightRange('unchanged', 11, 17);
20 highlightRange('to-be-changed', 15, 21);
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=
"
33 <div id='to-be-changed' onclick='this.textContent=&quot;After change&quot;'>
34 To be changed: findme (Manual testing: Find-in-page 'findme', then click here)
36 <div style='height: 1000px'><!-- To show the scrollbar --></div>">