text-selection has too much height in spans with relative positions

87 views
Skip to first unread message

Milan Hauth

unread,
Dec 14, 2025, 10:35:45 AM12/14/25
to Chromium-discuss
minimal example:

```html
<div>
 <span>1</span>
 <span style="position: relative; top: 2em">2</span>
</div>
```


complex example:


reproduce:
select text in spans with relative positions

actual:
text-selection highlight has too much height
above the selected text
in spans with relative positions.
the text-selection highlight
starts at the relative position y=0

expected:
text-selection highlight should have the same height
as with selected text in spans with absolute positions

this fails in chrome 137.0.7151.119
this works in firefox 139.0.4-1

use case:
EPUB-FXL = fixed-layout EPUB

Milan Hauth

unread,
Jan 8, 2026, 10:23:08 AM (3 days ago) Jan 8
to Chromium-discuss, Milan Hauth
> actual:
> text-selection highlight has too much height

text-search highlight has the expected height
(text-search = Ctrl+F)

so the fix is as simple as using the same height
for text-selection highlight and text-search highlight

Stephen Chenney

unread,
Jan 8, 2026, 10:32:03 AM (3 days ago) Jan 8
to mil...@gmail.com, Chromium-discuss
Could you file a bug please? With the example links in your original email.

Assign it to me if you want. I can't promise anything but I'll certainly take a look.

Stephen.

--
--
Chromium Discussion mailing list: chromium...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

Milan Hauth

unread,
Jan 8, 2026, 11:05:20 AM (3 days ago) Jan 8
to Stephen Chenney, Chromium-discuss
> Could you file a bug please?

https://issues.chromium.org/issues/474158711
Reply all
Reply to author
Forward
0 new messages