[Webkit-unassigned] [Bug 205527] New: getClientRects(), getBoundingClientRect() for range that spans multi-lines differs depending on whether text is selected
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Dec 20 15:58:43 PST 2019
https://bugs.webkit.org/show_bug.cgi?id=205527
Bug ID: 205527
Summary: getClientRects(), getBoundingClientRect() for range
that spans multi-lines differs depending on whether
text is selected
Product: WebKit
Version: WebKit Local Build
Hardware: All
OS: All
Status: NEW
Severity: Normal
Priority: P2
Component: Text
Assignee: webkit-unassigned at lists.webkit.org
Reporter: dbates at webkit.org
CC: mmaxfield at apple.com,
webkit-bug-importer at group.apple.com, zalan at apple.com
Created attachment 386273
--> https://bugs.webkit.org/attachment.cgi?id=386273&action=review
Test
Steps to reproduce:
1. Open the attached test.
The results before selection and after selection should be identical! They are not.
Maybe this bug should be split into two: one for getClientRects() and one for getBoundingClientRect()? Filing one bug for now as I think the root cause will address both issues also since getBoundingClientRect() is spec'ed to use the result of getClientRects().
I suspect the difference is due to whether we are using simple line layout (the "before selection" result) and line box layout (the "after selection case"). Simple line layout does not appears to return a rect when the selection is at the boundary. In the test case this is the box that represents the " " at the end of the first line, which also happens to coincide with where the text wraps. Simple line layout does not account for this and simply returns the rects from the second line! Line box layout does account for this. I made sure it did as part of the fix for bug #160786.
I suspect ^^^ is also the reason why getBoundingClientRect() returns differing results.
--
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/20191220/3bb31f56/attachment.htm>
More information about the webkit-unassigned
mailing list