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.
<rdar://problem/59688413>
Created attachment 391434 [details] For bots
Created attachment 391694 [details] Patch and test
Created attachment 391696 [details] Patch and test
Created attachment 391699 [details] Patch and test
rs=Jer Noble
(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.
Created attachment 391758 [details] To land
Committed r257487: <https://trac.webkit.org/changeset/257487>