<!DOCTYPE html>
<script src="../../resources/run-after-layout-and-paint.js"></script>
<style>
div {
width: 150px;
height: 30px;
font-size: 20px;
overflow: hidden;
text-overflow: ellipsis;
white-space: pre;
}
</style>
<div id="markAllComposition">pppppppppppppppppp</div>
<br>
<div id="markAllSpelling">pppppppppppppppppp</div>
<br>
<div id="markAllTextMatch">pppppppppppppppppp</div>
<script>
function addCompositionMarker(elem, start, end) {
const range = document.createRange();
const textNode = elem.firstChild;
range.setStart(textNode, start);
range.setEnd(textNode, end);
if (typeof internals !== 'undefined')
internals.addCompositionMarker(range, 'orange', 'thin', 'solid', 'transparent', 'lightBlue');
};
function addSpellingMarker(elem, start, end) {
const range = document.createRange();
const textNode = elem.firstChild;
range.setStart(textNode, start);
range.setEnd(textNode, end);
if (typeof internals !== 'undefined')
internals.setMarker(document, range, 'spelling');
};
function addTextMatchMarker(elem, start, end) {
const range = document.createRange();
const textNode = elem.firstChild;
range.setStart(textNode, start);
range.setEnd(textNode, end);
if (typeof internals !== 'undefined') {
internals.addTextMatchMarker(range, 'kActive');
internals.setMarkedTextMatchesAreHighlighted(document, true);
}
};
onload = runAfterLayoutAndPaint(function() {
if (window.testRunner)
testRunner.setPageZoomFactor(2)
addCompositionMarker(markAllComposition, 0, 18);
addSpellingMarker(markAllSpelling, 0, 15);
addTextMatchMarker(markAllTextMatch, 0, 16);
}, true);
</script>