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.
<rdar://problem/56887914>
Created attachment 385438 [details] Patch and unit tests
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.
Comment on attachment 385450 [details] Patch and more unit tests Clearing flags on attachment: 385450 Committed r253399: <https://trac.webkit.org/changeset/253399>
All reviewed patches have been landed. Closing bug.