Bug 205135

Summary: UIWKDocumentContext returns 0 character rects when caret is at beginning or end of text
Product: WebKit Reporter: Daniel Bates <dbates>
Component: WebKit Misc.Assignee: Daniel Bates <dbates>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch and unit tests
none
Patch and more unit tests none

Daniel Bates
Reported 2019-12-11 14:08:13 PST
Load a web page with the following markup: [[ <!DOCTYPE html> <html> <body> <p id='text' contenteditable>The quick brown fox jumps over the lazy dog.</p> <script> getSelection().setBaseAndExtent(text.firstChild, 0, text.firstChild, 0); </script> </body> </html> ]] The request a UIWKDocumentContext for rects with word granularity. Then UIWKDocumentContext.textRects is always the empty array. But it should be non-empty.
Attachments
Patch and unit tests (6.10 KB, patch)
2019-12-11 14:24 PST, Daniel Bates
no flags
Patch and more unit tests (8.50 KB, patch)
2019-12-11 15:35 PST, Daniel Bates
no flags
Daniel Bates
Comment 1 2019-12-11 14:08:24 PST
Daniel Bates
Comment 2 2019-12-11 14:24:21 PST
Created attachment 385438 [details] Patch and unit tests
Daniel Bates
Comment 3 2019-12-11 15:35:47 PST
Created attachment 385450 [details] Patch and more unit tests Added tests when the caret is at the beginning or end of the text and the text has leading or trailing non-breakable space.
Daniel Bates
Comment 4 2019-12-11 15:43:54 PST
Comment on attachment 385450 [details] Patch and more unit tests Clearing flags on attachment: 385450 Committed r253399: <https://trac.webkit.org/changeset/253399>
Daniel Bates
Comment 5 2019-12-11 15:43:55 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.