mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-28 02:27:19 +02:00
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.
15 lines
528 B
HTML
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>
|