Bug 208082

Summary: [iOS] Send focus update immediately on becoming or resigning first responder
Product: WebKit Reporter: Daniel Bates <dbates>
Component: WebKit Misc.Assignee: Daniel Bates <dbates>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: iPhone / iPad   
OS: iOS 13   
See Also: https://bugs.webkit.org/show_bug.cgi?id=208214
https://bugs.webkit.org/show_bug.cgi?id=208281
Attachments:
Description Flags
For bots
none
Patch and test
none
Patch and test
none
Patch and test
none
To land none

Description Daniel Bates 2020-02-21 16:45:10 PST
On iOS, various event handling internal code will call -becomeFirstResponder on the content view and then perform an operation. Some operations in the engine may give different results depending on whether the page is focused or not. For example, performing a selection operation will be disallowed when the page is not focused. Currently, -becomeFirstResponderForWebView and -resignFirstResponderForWebView just calls WebPageProxy::activityStateDidChange() without specifying the ActivityStateChangeDispatchMode parameter. As a result, the default mode is ActivityStateChangeDispatchMode::Deferrable, which means the update is scheduled on a future run-loop iteration. So, implementation code that calls -becomeFirstResponder (which calls -becomeFirstResponderForWebView if the web view's content view is a WKContentView - default scenario) and then instructs the WebProcess to do other things like selection will get results as if the page was not focused.
Comment 1 Radar WebKit Bug Importer 2020-02-21 16:45:30 PST
<rdar://problem/59688413>
Comment 2 Daniel Bates 2020-02-21 16:46:44 PST
Created attachment 391434 [details]
For bots
Comment 3 Daniel Bates 2020-02-25 15:48:43 PST
Created attachment 391694 [details]
Patch and test
Comment 4 Daniel Bates 2020-02-25 15:50:21 PST
Created attachment 391696 [details]
Patch and test
Comment 5 Daniel Bates 2020-02-25 16:15:30 PST
Created attachment 391699 [details]
Patch and test
Comment 6 Daniel Bates 2020-02-26 11:07:43 PST
rs=Jer Noble
Comment 7 Daniel Bates 2020-02-26 11:08:34 PST
(In reply to Daniel Bates from comment #6)
> rs=Jer Noble

I learned today, to Jer a rubber-stamp means that you looked over the patch and talked to the person about it. <-- That's what he did.
Comment 8 Daniel Bates 2020-02-26 11:17:55 PST
Created attachment 391758 [details]
To land
Comment 9 Daniel Bates 2020-02-26 11:19:28 PST
Committed r257487: <https://trac.webkit.org/changeset/257487>