Bug 209559

Summary: WebPage::selectPositionAtPoint() does not focus an element in a non-focused frame
Product: WebKit Reporter: Daniel Bates <dbates>
Component: WebCore Misc.Assignee: Daniel Bates <dbates>
Status: RESOLVED FIXED    
Severity: Normal CC: ews-watchlist, mifenton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
For the bots
none
Patch and test
none
Patch and test none

Daniel Bates
Reported 2020-03-25 13:28:35 PDT
If the point passed to WebPage::selectPositionAtPoint() hits an element in a non-focused frame then it does nothing. This is ultimately because FrameSelection::setFocusedElementIfNeeded() early returns if the new focus element is not in a focused frame by [1] even though it is more than capable of accommodating the request: focusing the frame of the target element + focusing the target element (by way of calling FocusController::setFocusedElement()). [1] <https://trac.webkit.org/browser/trunk/Source/WebCore/editing/FrameSelection.cpp?rev=258233#L2246>
Attachments
For the bots (1.08 KB, patch)
2020-03-25 13:30 PDT, Daniel Bates
no flags
Patch and test (4.15 KB, patch)
2020-03-25 15:26 PDT, Daniel Bates
no flags
Patch and test (4.24 KB, patch)
2020-03-26 11:23 PDT, Daniel Bates
no flags
Radar WebKit Bug Importer
Comment 1 2020-03-25 13:28:46 PDT
Daniel Bates
Comment 2 2020-03-25 13:30:37 PDT
Created attachment 394539 [details] For the bots
Daniel Bates
Comment 3 2020-03-25 15:11:35 PDT
There is an existing WebPage::setFocusedFrameBeforeSelectingTextAtLocation() that other functions use 😐
Daniel Bates
Comment 4 2020-03-25 15:26:09 PDT
Created attachment 394551 [details] Patch and test
Daniel Bates
Comment 5 2020-03-26 11:23:08 PDT
Created attachment 394632 [details] Patch and test
Daniel Bates
Comment 6 2020-03-26 14:10:13 PDT
Comment on attachment 394632 [details] Patch and test Clearing flags on attachment: 394632 Committed r259078: <https://trac.webkit.org/changeset/259078>
Daniel Bates
Comment 7 2020-03-26 14:10:15 PDT
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.