Bug 208082 - [iOS] Send focus update immediately on becoming or resigning first responder
Summary: [iOS] Send focus update immediately on becoming or resigning first responder
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Local Build
Hardware: iPhone / iPad iOS 13
: P2 Normal
Assignee: Daniel Bates
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-02-21 16:45 PST by Daniel Bates
Modified: 2020-02-26 17:27 PST (History)
1 user (show)

See Also:


Attachments
For bots (6.14 KB, patch)
2020-02-21 16:46 PST, Daniel Bates
no flags Details | Formatted Diff | Diff
Patch and test (12.35 KB, patch)
2020-02-25 15:48 PST, Daniel Bates
no flags Details | Formatted Diff | Diff
Patch and test (12.38 KB, patch)
2020-02-25 15:50 PST, Daniel Bates
no flags Details | Formatted Diff | Diff
Patch and test (13.73 KB, patch)
2020-02-25 16:15 PST, Daniel Bates
no flags Details | Formatted Diff | Diff
To land (13.66 KB, patch)
2020-02-26 11:17 PST, Daniel Bates
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>