[Webkit-unassigned] [Bug 219087] New: ::first-letter styles cause Range clientRect miscalculations

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Nov 18 07:32:28 PST 2020


https://bugs.webkit.org/show_bug.cgi?id=219087

            Bug ID: 219087
           Summary: ::first-letter styles cause Range clientRect
                    miscalculations
           Product: WebKit
           Version: Safari Technology Preview
          Hardware: All
                OS: All
            Status: NEW
          Severity: Minor
          Priority: P2
         Component: Layout and Rendering
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: j at josephpearson.org
                CC: bfulgham at webkit.org, simon.fraser at apple.com,
                    zalan at apple.com

Created attachment 414449

  --> https://bugs.webkit.org/attachment.cgi?id=414449&action=review

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20201118/8ab20dec/attachment-0001.htm>


More information about the webkit-unassigned mailing list