LibWeb: Draw caret for empty <input>s and <textarea>s

Our change to generate spans in PaintableWithLines from fragments also
broke drawing the caret for empty <input>s and <textarea>s, since spans
was empty in that case.

Fix this by moving caret drawing to PaintableWithLines, and only
invoking it if we have a cursor position set.
This commit is contained in:
Jelle Raaijmakers
2026-02-10 11:26:13 +01:00
committed by Jelle Raaijmakers
parent a69df4d25b
commit 3bc4374344
Notes: github-actions[bot] 2026-02-11 10:29:24 +00:00
6 changed files with 83 additions and 28 deletions

View File

@@ -0,0 +1,9 @@
<!DOCTYPE html>
<script src="../include.js"></script>
<input value="hello" style="width: 100px" />
<script>
test(() => {
document.querySelector("input").focus();
println(internals.dumpDisplayList());
});
</script>