| Index: LayoutTests/fast/repaint/text-match-document-change.html
|
| diff --git a/LayoutTests/fast/repaint/text-match-document-change.html b/LayoutTests/fast/repaint/text-match-document-change.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..7f83978c15553437f90fd66fa7ef8c47cf963061
|
| --- /dev/null
|
| +++ b/LayoutTests/fast/repaint/text-match-document-change.html
|
| @@ -0,0 +1,37 @@
|
| +<!DOCTYPE html>
|
| +<script src="resources/text-based-repaint.js"></script>
|
| +<script>
|
| +function highlightRange(id, start, end) {
|
| + var frameWindow = document.getElementById('iframe').contentWindow;
|
| + var range = frameWindow.document.createRange();
|
| + var elem = frameWindow.document.getElementById(id).firstChild;
|
| + range.setStart(elem, start);
|
| + range.setEnd(elem, end);
|
| + frameWindow.internals.addTextMatchMarker(range, false);
|
| +}
|
| +
|
| +function repaintTest() {
|
| + document.getElementById('iframe').contentDocument.getElementById('to-be-changed').textContent = 'After change';
|
| +}
|
| +
|
| +if (window.internals) {
|
| + onload = function() {
|
| + highlightRange('unchanged', 11, 17);
|
| + highlightRange('to-be-changed', 15, 21);
|
| + runRepaintTest();
|
| + };
|
| +}
|
| +</script>
|
| +Tests paint invalidation of the scrollbar (to repaint tickmarks) on document change when there are text match markers.
|
| +Passes if the tickmarks are updated on document change.<br>
|
| +<!-- Currently paint invalidation of main frame scrollbar is not tracked,
|
| + so use a frame to show the invalidation of tickmarks. -->
|
| +<iframe id="iframe" style="position: absolute; top: 100px; height: 400px" srcdoc="
|
| + <div id='unchanged'>
|
| + Unchanged: findme
|
| + </div>
|
| + <div id='to-be-changed' onclick='this.textContent=&quot;After change&quot;'>
|
| + To be changed: findme (Manual testing: Find-in-page 'findme', then click here)
|
| + </div>
|
| + <div style='height: 1000px'><!-- To show the scrollbar --></div>">
|
| +</iframe>
|
|
|