Files
ladybird/Tests/LibWeb/Screenshot/input/selection-trailing-whitespace.html
Jelle Raaijmakers 69fa144539 LibWeb: Keep track of trailing whitespace for wrapped lines
When rendering selections, we want to extend the selection rect for
wrapped lines to show that there is whitespace present. We don't
actually store this whitespace in the fragments; it's purely a visual
clue.

This reflects how both Chrome and Firefox deal with selection ranges
over wrapped lines.
2026-02-06 10:47:50 +00:00

15 lines
528 B
HTML

<!DOCTYPE html>
<meta name="fuzzy" content="maxDifference=0-1;totalPixels=0-530" />
<link rel="match" href="../expected/selection-trailing-whitespace-ref.html" />
<style>
body { margin: 0; }
#container { width: 100px; }
</style>
<!-- Test that trailing whitespace at end of wrapped lines is included in selection highlight. -->
<div id="container"><span id="text">one two three four</span></div>
<script>
let range = document.createRange();
range.selectNodeContents(text);
window.getSelection().addRange(range);
</script>