mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
23 lines
752 B
HTML
23 lines
752 B
HTML
<!DOCTYPE html>
|
|
<script src="../include.js"></script>
|
|
<div>
|
|
<span id="target">Split<br>over<br>multiple<br>lines</span>
|
|
</div>
|
|
<script>
|
|
test(() => {
|
|
const before = internals.dumpDisplayList();
|
|
const fillRectsBefore = before.split('\n').filter(l => l.includes('FillRect')).length;
|
|
|
|
const selection = window.getSelection();
|
|
const range = document.createRange();
|
|
range.selectNodeContents(document.getElementById('target'));
|
|
selection.removeAllRanges();
|
|
selection.addRange(range);
|
|
|
|
const after = internals.dumpDisplayList();
|
|
const fillRectsAfter = after.split('\n').filter(l => l.includes('FillRect')).length;
|
|
|
|
println(`New FillRect commands after selection: ${fillRectsAfter - fillRectsBefore}`);
|
|
});
|
|
</script>
|