Created attachment 414449 [details] Example showing expected result and miscalcs If an element has a ::first-letter style rule, creating a Range within that element and measuring its client rectangles (Range#getClientRects or Range#getBoundingClientRects) will produce incorrect dimensions. The range itself is fine: Range#toString() shows that the correct characters have been selected. But the resulting rectangles are wrong, at least on the x axis (left, width). Note that *any* ::first-letter declaration on the element produces the bug, even if the styles are not layout-affecting, and even if they're invalid style values. See a quick reduction in the attached file. I don't think this is a new bug — I have observed it for years, but only got around to the reduction today.
Thanks for filing. I can reproduce this with the test case on Safari 13.1.3 as well as STP 115 (14.1).
<rdar://problem/71546397>
I am able to reproduce this bug in Safari Technology Preview 154 using attached test case and both Example 2 and 3 doe snot highlight "troublemakers" like Expected Results while both Firefox Nightly 107 and Chrome Canary 108 show expected results in all cases / example. Thanks!